From 11a8dbf830bebb3a06a8ea6a05a6fb8ddc622f37 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 5 Dec 2022 01:27:02 +0000 Subject: [PATCH 01/44] fix TestNetworkPlugins tests for Linux with Docker driver --- go.mod | 18 +- go.sum | 31 +- pkg/kapi/kapi.go | 10 +- pkg/minikube/bootstrapper/certs.go | 13 + pkg/minikube/bootstrapper/images/images.go | 7 +- pkg/minikube/cni/calico.go | 2 - pkg/minikube/cni/calico.yaml | 919 +++++++++++-- pkg/minikube/cni/cilium.yaml | 778 +++++++++++ pkg/minikube/cni/cni.go | 42 + pkg/minikube/cni/flannel.go | 656 +-------- pkg/minikube/cni/flannel.yaml | 205 +++ pkg/minikube/cruntime/docker.go | 13 +- pkg/minikube/download/download.go | 3 +- pkg/minikube/download/iso.go | 2 +- pkg/minikube/driver/auxdriver/install.go | 2 +- pkg/minikube/image/cache.go | 2 +- pkg/minikube/kubeconfig/settings.go | 2 +- pkg/minikube/machine/start.go | 2 +- pkg/util/lock/lock.go | 2 +- pkg/util/lock/lock_test.go | 2 +- .../docs/tutorials/includes/kube-flannel.yaml | 602 --------- .../go/compute/metadata/LICENSE | 202 +++ .../licenses/cloud.google.com/go/iam/LICENSE | 202 +++ .../cloud.google.com/go/internal/LICENSE | 202 +++ .../cloud.google.com/go/storage/LICENSE | 202 +++ .../cloud.google.com/go/trace/LICENSE | 202 +++ .../Delta456/box-cli-maker/v2/LICENSE | 21 + .../docker-credential-gcr/LICENSE | 201 +++ .../exporter/trace/LICENSE | 202 +++ .../internal/resourcemapping/LICENSE | 202 +++ .../github.com/MakeNowJust/heredoc/LICENSE | 21 + .../github.com/PuerkitoBio/purell/LICENSE | 12 + .../github.com/PuerkitoBio/urlesc/LICENSE | 27 + .../github.com/VividCortex/ewma/LICENSE | 21 + .../github.com/VividCortex/godaemon/LICENSE | 19 + .../github.com/Xuanwo/go-locale/LICENSE | 201 +++ .../github.com/aws/aws-sdk-go/LICENSE.txt | 202 +++ .../github.com/aws/aws-sdk-go/NOTICE.txt | 3 + .../internal/sync/singleflight/LICENSE | 27 + .../github.com/bgentry/go-netrc/netrc/LICENSE | 20 + .../licenses/github.com/blang/semver/LICENSE | 22 + .../github.com/blang/semver/v4/LICENSE | 22 + .../github.com/briandowns/spinner/LICENSE | 174 +++ .../github.com/cenkalti/backoff/v4/LICENSE | 20 + .../github.com/cheggaaa/pb/v3/LICENSE | 12 + .../github.com/cloudevents/sdk-go/v2/LICENSE | 201 +++ .../github.com/containerd/containerd/LICENSE | 191 +++ .../github.com/containerd/containerd/NOTICE | 16 + .../stargz-snapshotter/estargz/LICENSE | 202 +++ .../coreos/go-systemd/v22/dbus/LICENSE | 191 +++ .../coreos/go-systemd/v22/dbus/NOTICE | 5 + .../cyphar/filepath-securejoin/LICENSE | 28 + .../github.com/davecgh/go-spew/spew/LICENSE | 15 + .../github.com/docker/cli/cli/config/LICENSE | 191 +++ .../github.com/docker/cli/cli/config/NOTICE | 19 + .../github.com/docker/distribution/LICENSE | 202 +++ .../docker/docker-credential-helpers/LICENSE | 20 + .../licenses/github.com/docker/docker/LICENSE | 191 +++ .../licenses/github.com/docker/docker/NOTICE | 19 + .../github.com/docker/go-connections/LICENSE | 191 +++ .../github.com/docker/go-units/LICENSE | 191 +++ .../github.com/docker/machine/LICENSE | 191 +++ .../github.com/emicklei/go-restful/v3/LICENSE | 22 + .../github.com/fatih/color/LICENSE.md | 20 + .../github.com/fsnotify/fsnotify/LICENSE | 28 + .../licenses/github.com/go-logr/logr/LICENSE | 201 +++ .../licenses/github.com/go-logr/stdr/LICENSE | 201 +++ .../github.com/go-openapi/jsonpointer/LICENSE | 202 +++ .../go-openapi/jsonreference/LICENSE | 202 +++ .../github.com/go-openapi/swag/LICENSE | 202 +++ .../github.com/godbus/dbus/v5/LICENSE | 25 + .../licenses/github.com/gogo/protobuf/LICENSE | 35 + .../github.com/golang/groupcache/lru/LICENSE | 191 +++ .../github.com/golang/protobuf/LICENSE | 28 + .../github.com/google/gnostic/LICENSE | 203 +++ .../github.com/google/go-cmp/cmp/LICENSE | 27 + .../google/go-containerregistry/LICENSE | 202 +++ .../google/go-github/v43/github/LICENSE | 27 + .../google/go-querystring/query/LICENSE | 27 + .../licenses/github.com/google/gofuzz/LICENSE | 202 +++ .../google/slowjam/pkg/stacklog/LICENSE | 201 +++ .../licenses/github.com/google/uuid/LICENSE | 27 + .../client/LICENSE | 202 +++ .../github.com/googleapis/gax-go/v2/LICENSE | 27 + .../licenses/github.com/gookit/color/LICENSE | 20 + .../github.com/hashicorp/go-cleanhttp/LICENSE | 363 +++++ .../hashicorp/go-cleanhttp/README.md | 30 + .../hashicorp/go-cleanhttp/cleanhttp.go | 58 + .../github.com/hashicorp/go-cleanhttp/doc.go | 20 + .../github.com/hashicorp/go-cleanhttp/go.mod | 3 + .../hashicorp/go-cleanhttp/handlers.go | 48 + .../hashicorp/go-cleanhttp/handlers_test.go | 72 + .../hashicorp/go-getter/.circleci/config.yml | 176 +++ .../.github/workflows/codeql-analysis.yml | 50 + .../go-getter/.github/workflows/release.yml | 78 ++ .../github.com/hashicorp/go-getter/.gitignore | 1 + .../hashicorp/go-getter/.goreleaser.yml | 58 + .../github.com/hashicorp/go-getter/LICENSE | 354 +++++ .../github.com/hashicorp/go-getter/README.md | 448 ++++++ .../hashicorp/go-getter/checksum.go | 317 +++++ .../github.com/hashicorp/go-getter/client.go | 347 +++++ .../hashicorp/go-getter/client_mode.go | 24 + .../hashicorp/go-getter/client_option.go | 100 ++ .../go-getter/client_option_insecure.go | 14 + .../go-getter/client_option_progress.go | 38 + .../go-getter/client_option_progress_test.go | 65 + .../hashicorp/go-getter/cmd/go-getter/main.go | 93 ++ .../cmd/go-getter/progress_tracking.go | 77 ++ .../github.com/hashicorp/go-getter/common.go | 14 + .../hashicorp/go-getter/copy_dir.go | 85 ++ .../hashicorp/go-getter/decompress.go | 65 + .../hashicorp/go-getter/decompress_bzip2.go | 37 + .../go-getter/decompress_bzip2_test.go | 34 + .../hashicorp/go-getter/decompress_gzip.go | 41 + .../go-getter/decompress_gzip_test.go | 34 + .../hashicorp/go-getter/decompress_tar.go | 150 ++ .../go-getter/decompress_tar_test.go | 107 ++ .../hashicorp/go-getter/decompress_tbz2.go | 33 + .../go-getter/decompress_tbz2_test.go | 73 + .../hashicorp/go-getter/decompress_testing.go | 171 +++ .../hashicorp/go-getter/decompress_tgz.go | 39 + .../go-getter/decompress_tgz_test.go | 95 ++ .../hashicorp/go-getter/decompress_txz.go | 39 + .../go-getter/decompress_txz_test.go | 84 ++ .../hashicorp/go-getter/decompress_tzst.go | 39 + .../go-getter/decompress_tzst_test.go | 95 ++ .../hashicorp/go-getter/decompress_xz.go | 41 + .../hashicorp/go-getter/decompress_xz_test.go | 34 + .../hashicorp/go-getter/decompress_zip.go | 91 ++ .../go-getter/decompress_zip_test.go | 131 ++ .../hashicorp/go-getter/decompress_zstd.go | 40 + .../go-getter/decompress_zstd_test.go | 34 + .../github.com/hashicorp/go-getter/detect.go | 106 ++ .../hashicorp/go-getter/detect_bitbucket.go | 66 + .../go-getter/detect_bitbucket_test.go | 63 + .../hashicorp/go-getter/detect_file.go | 67 + .../hashicorp/go-getter/detect_file_test.go | 115 ++ .../go-getter/detect_file_unix_test.go | 70 + .../hashicorp/go-getter/detect_gcs.go | 43 + .../hashicorp/go-getter/detect_gcs_test.go | 41 + .../hashicorp/go-getter/detect_git.go | 26 + .../hashicorp/go-getter/detect_git_test.go | 69 + .../hashicorp/go-getter/detect_github.go | 47 + .../hashicorp/go-getter/detect_github_test.go | 44 + .../hashicorp/go-getter/detect_gitlab.go | 47 + .../hashicorp/go-getter/detect_gitlab_test.go | 44 + .../hashicorp/go-getter/detect_s3.go | 73 + .../hashicorp/go-getter/detect_s3_test.go | 89 ++ .../hashicorp/go-getter/detect_ssh.go | 49 + .../hashicorp/go-getter/detect_test.go | 92 ++ .../hashicorp/go-getter/folder_storage.go | 65 + .../go-getter/folder_storage_test.go | 48 + .../github.com/hashicorp/go-getter/get.go | 152 +++ .../hashicorp/go-getter/get_base.go | 20 + .../hashicorp/go-getter/get_file.go | 36 + .../hashicorp/go-getter/get_file_copy.go | 86 ++ .../hashicorp/go-getter/get_file_copy_test.go | 82 ++ .../hashicorp/go-getter/get_file_test.go | 204 +++ .../hashicorp/go-getter/get_file_unix.go | 99 ++ .../hashicorp/go-getter/get_file_windows.go | 130 ++ .../github.com/hashicorp/go-getter/get_gcs.go | 220 +++ .../hashicorp/go-getter/get_gcs_test.go | 261 ++++ .../github.com/hashicorp/go-getter/get_git.go | 376 ++++++ .../hashicorp/go-getter/get_git_test.go | 913 +++++++++++++ .../github.com/hashicorp/go-getter/get_hg.go | 147 ++ .../hashicorp/go-getter/get_hg_test.go | 143 ++ .../hashicorp/go-getter/get_http.go | 622 +++++++++ .../hashicorp/go-getter/get_http_test.go | 1111 +++++++++++++++ .../hashicorp/go-getter/get_mock.go | 54 + .../github.com/hashicorp/go-getter/get_s3.go | 344 +++++ .../hashicorp/go-getter/get_s3_test.go | 269 ++++ .../hashicorp/go-getter/get_test.go | 545 ++++++++ .../github.com/hashicorp/go-getter/go.mod | 28 + .../github.com/hashicorp/go-getter/go.sum | 162 +++ .../hashicorp/go-getter/helper/url/url.go | 14 + .../go-getter/helper/url/url_test.go | 88 ++ .../go-getter/helper/url/url_unix.go | 11 + .../go-getter/helper/url/url_windows.go | 39 + .../hashicorp/go-getter/module_test.go | 89 ++ .../github.com/hashicorp/go-getter/netrc.go | 67 + .../hashicorp/go-getter/netrc_test.go | 63 + .../github.com/hashicorp/go-getter/source.go | 77 ++ .../hashicorp/go-getter/source_test.go | 106 ++ .../github.com/hashicorp/go-getter/storage.go | 13 + .../decompress-tar/permissions.tar | Bin 0 -> 3584 bytes .../decompress-zip/permissions.zip | Bin 0 -> 808 bytes .../archive-rooted-multi/archive.tar.gz | Bin 0 -> 210 bytes .../testdata/archive-rooted/archive.tar.gz | Bin 0 -> 173 bytes .../go-getter/testdata/archive.tar.gz | Bin 0 -> 141 bytes .../testdata/basic%2Ftest/foo/main.tf | 1 + .../go-getter/testdata/basic%2Ftest/main.tf | 5 + .../testdata/basic%2Ftest/subdir/sub.tf | 0 .../go-getter/testdata/basic-dot/main.tf | 5 + .../basic-file-archive/archive.tar.gz | Bin 0 -> 141 bytes .../go-getter/testdata/basic-file/foo.txt | 1 + .../testdata/basic-hg/.hg/00changelog.i | Bin 0 -> 57 bytes .../go-getter/testdata/basic-hg/.hg/branch | 1 + .../basic-hg/.hg/cache/branch2-served | 3 + .../testdata/basic-hg/.hg/cache/rbc-names-v1 | 1 + .../testdata/basic-hg/.hg/cache/rbc-revs-v1 | Bin 0 -> 8 bytes .../testdata/basic-hg/.hg/cache/tags | 2 + .../go-getter/testdata/basic-hg/.hg/dirstate | Bin 0 -> 88 bytes .../testdata/basic-hg/.hg/last-message.txt | 2 + .../go-getter/testdata/basic-hg/.hg/requires | 4 + .../testdata/basic-hg/.hg/store/00changelog.i | Bin 0 -> 528 bytes .../testdata/basic-hg/.hg/store/00manifest.i | Bin 0 -> 376 bytes .../basic-hg/.hg/store/data/foo.txt.i | Bin 0 -> 71 bytes .../basic-hg/.hg/store/data/main.tf.i | Bin 0 -> 112 bytes .../basic-hg/.hg/store/data/main__branch.tf.i | Bin 0 -> 64 bytes .../testdata/basic-hg/.hg/store/fncache | 3 + .../testdata/basic-hg/.hg/store/phaseroots | 1 + .../testdata/basic-hg/.hg/store/undo | Bin 0 -> 52 bytes .../basic-hg/.hg/store/undo.backup.fncache | 2 + .../basic-hg/.hg/store/undo.backupfiles | Bin 0 -> 33 bytes .../basic-hg/.hg/store/undo.phaseroots | 1 + .../testdata/basic-hg/.hg/undo.bookmarks | 0 .../testdata/basic-hg/.hg/undo.branch | 1 + .../go-getter/testdata/basic-hg/.hg/undo.desc | 2 + .../testdata/basic-hg/.hg/undo.dirstate | Bin 0 -> 88 bytes .../go-getter/testdata/basic-hg/foo.txt | 1 + .../go-getter/testdata/basic-hg/main.tf | 5 + .../go-getter/testdata/basic-parent/a/a.tf | 3 + .../go-getter/testdata/basic-parent/c/c.tf | 1 + .../go-getter/testdata/basic-parent/main.tf | 3 + .../testdata/basic-subdir/foo/sub/baz/main.tf | 0 .../testdata/basic-subdir/foo/sub/main.tf | 3 + .../go-getter/testdata/basic-subdir/main.tf | 3 + .../go-getter/testdata/basic-tgz/main.tf | 1 + .../go-getter/testdata/basic/foo/main.tf | 1 + .../go-getter/testdata/basic/main.tf | 5 + .../go-getter/testdata/basic/subdir/sub.tf | 0 .../testdata/checksum-file/content.txt | 1 + .../testdata/checksum-file/md5-bsd-bad.sum | 1 + .../testdata/checksum-file/md5-bsd-wrong.sum | 1 + .../testdata/checksum-file/md5-bsd.sum | 1 + .../testdata/checksum-file/md5-p.sum | 1 + .../testdata/checksum-file/sha1-p.sum | 1 + .../go-getter/testdata/checksum-file/sha1.sum | 1 + .../testdata/checksum-file/sha256-p.sum | 1 + .../testdata/checksum-file/sha512-p-EOF.sum | 1 + .../testdata/checksum-file/sha512-p.sum | 1 + .../go-getter/testdata/child/foo/bar/main.tf | 2 + .../go-getter/testdata/child/foo/main.tf | 5 + .../go-getter/testdata/child/main.tf | 5 + .../testdata/decompress-bz2/single.bz2 | Bin 0 -> 40 bytes .../testdata/decompress-gz/single.gz | Bin 0 -> 29 bytes .../decompress-tar/extended_header.tar | Bin 0 -> 10240 bytes .../testdata/decompress-tar/implied_dir.tar | Bin 0 -> 2048 bytes .../testdata/decompress-tar/unix_time_0.tar | Bin 0 -> 10240 bytes .../testdata/decompress-tbz2/empty.tar.bz2 | Bin 0 -> 46 bytes .../testdata/decompress-tbz2/multiple.tar.bz2 | Bin 0 -> 166 bytes .../testdata/decompress-tbz2/ordering.tar.bz2 | Bin 0 -> 248 bytes .../testdata/decompress-tbz2/single.tar.bz2 | Bin 0 -> 135 bytes .../testdata/decompress-tgz/empty.tar.gz | Bin 0 -> 45 bytes .../testdata/decompress-tgz/multiple.tar.gz | Bin 0 -> 157 bytes .../decompress-tgz/multiple_dir.tar.gz | Bin 0 -> 194 bytes .../testdata/decompress-tgz/ordering.tar.gz | Bin 0 -> 187 bytes .../decompress-tgz/outside_parent.tar.gz | Bin 0 -> 192 bytes .../testdata/decompress-tgz/single.tar.gz | Bin 0 -> 137 bytes .../testdata/decompress-txz/empty.tar.xz | Bin 0 -> 108 bytes .../testdata/decompress-txz/multiple.tar.xz | Bin 0 -> 204 bytes .../decompress-txz/multiple_dir.tar.xz | Bin 0 -> 232 bytes .../testdata/decompress-txz/ordering.tar.xz | Bin 0 -> 220 bytes .../testdata/decompress-txz/single.tar.xz | Bin 0 -> 192 bytes .../testdata/decompress-tzst/empty.tar.zst | Bin 0 -> 22 bytes .../testdata/decompress-tzst/multiple.tar.zst | Bin 0 -> 121 bytes .../decompress-tzst/multiple_dir.tar.zst | Bin 0 -> 153 bytes .../testdata/decompress-tzst/ordering.tar.zst | Bin 0 -> 164 bytes .../decompress-tzst/outside_parent.tar.zst | Bin 0 -> 151 bytes .../testdata/decompress-tzst/single.tar.zst | Bin 0 -> 104 bytes .../testdata/decompress-xz/single.xz | Bin 0 -> 60 bytes .../testdata/decompress-zip/empty.zip | Bin 0 -> 22 bytes .../testdata/decompress-zip/multiple.zip | Bin 0 -> 306 bytes .../decompress-zip/outside_parent.zip | Bin 0 -> 237 bytes .../testdata/decompress-zip/single.zip | Bin 0 -> 162 bytes .../testdata/decompress-zip/subdir.zip | Bin 0 -> 466 bytes .../testdata/decompress-zip/subdir_empty.zip | Bin 0 -> 308 bytes .../decompress-zip/subdir_missing_dir.zip | Bin 0 -> 324 bytes .../testdata/decompress-zst/single.zst | Bin 0 -> 17 bytes .../detect-file-symlink-pwd/real/hello.txt | 0 .../go-getter/testdata/dup/foo/main.tf | 0 .../hashicorp/go-getter/testdata/dup/main.tf | 7 + .../hashicorp/go-getter/testdata/netrc/basic | 3 + .../child/main.tf | 1 + .../validate-bad-output-to-module/main.tf | 8 + .../validate-bad-output/child/main.tf | 0 .../testdata/validate-bad-output/main.tf | 7 + .../testdata/validate-bad-var/child/main.tf | 0 .../testdata/validate-bad-var/main.tf | 5 + .../testdata/validate-child-bad/child/main.tf | 3 + .../testdata/validate-child-bad/main.tf | 3 + .../validate-child-good/child/main.tf | 3 + .../testdata/validate-child-good/main.tf | 8 + .../validate-required-var/child/main.tf | 1 + .../testdata/validate-required-var/main.tf | 3 + .../testdata/validate-root-bad/main.tf | 3 + .../github.com/hashicorp/go-getter/url.go | 25 + .../hashicorp/go-getter/url_test.go | 95 ++ .../hashicorp/go-getter/util_test.go | 49 + .../github.com/hashicorp/go-safetemp/LICENSE | 362 +++++ .../hashicorp/go-safetemp/README.md | 10 + .../github.com/hashicorp/go-safetemp/go.mod | 1 + .../hashicorp/go-safetemp/safetemp.go | 40 + .../hashicorp/go-safetemp/safetemp_test.go | 46 + .../hashicorp/go-version/.circleci/config.yml | 60 + .../github.com/hashicorp/go-version/LICENSE | 354 +++++ .../github.com/hashicorp/go-version/README.md | 66 + .../hashicorp/go-version/constraint.go | 204 +++ .../hashicorp/go-version/constraint_test.go | 126 ++ .../github.com/hashicorp/go-version/go.mod | 1 + .../hashicorp/go-version/version.go | 384 ++++++ .../go-version/version_collection.go | 17 + .../go-version/version_collection_test.go | 46 + .../hashicorp/go-version/version_test.go | 624 +++++++++ .../hashicorp/hcl/.github/ISSUE_TEMPLATE.md | 21 + .../github.com/hashicorp/hcl/.gitignore | 9 + .../github.com/hashicorp/hcl/.travis.yml | 13 + .../licenses/github.com/hashicorp/hcl/LICENSE | 354 +++++ .../github.com/hashicorp/hcl/Makefile | 18 + .../github.com/hashicorp/hcl/README.md | 125 ++ .../github.com/hashicorp/hcl/appveyor.yml | 19 + .../github.com/hashicorp/hcl/decoder.go | 729 ++++++++++ .../github.com/hashicorp/hcl/decoder_test.go | 1203 +++++++++++++++++ .../licenses/github.com/hashicorp/hcl/go.mod | 3 + .../licenses/github.com/hashicorp/hcl/go.sum | 2 + .../licenses/github.com/hashicorp/hcl/hcl.go | 11 + .../github.com/hashicorp/hcl/hcl/ast/ast.go | 219 +++ .../hashicorp/hcl/hcl/ast/ast_test.go | 200 +++ .../github.com/hashicorp/hcl/hcl/ast/walk.go | 52 + .../hashicorp/hcl/hcl/fmtcmd/fmtcmd.go | 162 +++ .../hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go | 440 ++++++ .../hcl/fmtcmd/test-fixtures/.hidden.ignore | 1 + .../hcl/hcl/fmtcmd/test-fixtures/dir.ignore | 0 .../hcl/hcl/fmtcmd/test-fixtures/file.ignore | 1 + .../hcl/hcl/fmtcmd/test-fixtures/good.hcl | 0 .../hashicorp/hcl/hcl/parser/error.go | 17 + .../hashicorp/hcl/hcl/parser/error_test.go | 9 + .../hashicorp/hcl/hcl/parser/parser.go | 532 ++++++++ .../hashicorp/hcl/hcl/parser/parser_test.go | 575 ++++++++ .../parser/test-fixtures/array_comment.hcl | 4 + .../parser/test-fixtures/array_comment_2.hcl | 6 + .../hcl/parser/test-fixtures/assign_colon.hcl | 6 + .../hcl/parser/test-fixtures/assign_deep.hcl | 5 + .../hcl/hcl/parser/test-fixtures/comment.hcl | 15 + .../hcl/parser/test-fixtures/comment_crlf.hcl | 15 + .../parser/test-fixtures/comment_lastline.hcl | 1 + .../parser/test-fixtures/comment_single.hcl | 1 + .../hcl/hcl/parser/test-fixtures/complex.hcl | 42 + .../hcl/parser/test-fixtures/complex_crlf.hcl | 42 + .../hcl/parser/test-fixtures/complex_key.hcl | 1 + .../hcl/hcl/parser/test-fixtures/empty.hcl | 0 .../hcl/parser/test-fixtures/git_crypt.hcl | Bin 0 -> 10 bytes .../test-fixtures/key_without_value.hcl | 1 + .../hcl/hcl/parser/test-fixtures/list.hcl | 1 + .../hcl/parser/test-fixtures/list_comma.hcl | 1 + .../parser/test-fixtures/missing_braces.hcl | 4 + .../hcl/hcl/parser/test-fixtures/multiple.hcl | 2 + .../object_key_assign_without_value.hcl | 3 + .../object_key_assign_without_value2.hcl | 4 + .../object_key_assign_without_value3.hcl | 4 + .../object_key_without_value.hcl | 3 + .../test-fixtures/object_list_comma.hcl | 1 + .../hcl/hcl/parser/test-fixtures/old.hcl | 3 + .../hcl/parser/test-fixtures/structure.hcl | 5 + .../parser/test-fixtures/structure_basic.hcl | 5 + .../parser/test-fixtures/structure_empty.hcl | 1 + .../hcl/hcl/parser/test-fixtures/types.hcl | 7 + .../test-fixtures/unterminated_object.hcl | 2 + .../test-fixtures/unterminated_object_2.hcl | 6 + .../hashicorp/hcl/hcl/printer/nodes.go | 789 +++++++++++ .../hashicorp/hcl/hcl/printer/printer.go | 66 + .../hashicorp/hcl/hcl/printer/printer_test.go | 176 +++ .../hcl/hcl/printer/testdata/comment.golden | 39 + .../hcl/hcl/printer/testdata/comment.input | 39 + .../printer/testdata/comment_aligned.golden | 32 + .../printer/testdata/comment_aligned.input | 28 + .../hcl/printer/testdata/comment_array.golden | 13 + .../hcl/printer/testdata/comment_array.input | 13 + .../hcl/printer/testdata/comment_crlf.input | 39 + .../printer/testdata/comment_end_file.golden | 6 + .../printer/testdata/comment_end_file.input | 5 + .../testdata/comment_multiline_indent.golden | 12 + .../testdata/comment_multiline_indent.input | 13 + .../comment_multiline_no_stanza.golden | 7 + .../comment_multiline_no_stanza.input | 6 + .../testdata/comment_multiline_stanza.golden | 10 + .../testdata/comment_multiline_stanza.input | 10 + .../printer/testdata/comment_newline.golden | 3 + .../printer/testdata/comment_newline.input | 2 + .../testdata/comment_object_multi.golden | 9 + .../testdata/comment_object_multi.input | 9 + .../testdata/comment_standalone.golden | 17 + .../printer/testdata/comment_standalone.input | 16 + .../hcl/printer/testdata/complexhcl.golden | 54 + .../hcl/hcl/printer/testdata/complexhcl.input | 53 + .../hcl/printer/testdata/empty_block.golden | 12 + .../hcl/printer/testdata/empty_block.input | 14 + .../hcl/hcl/printer/testdata/list.golden | 46 + .../hcl/hcl/printer/testdata/list.input | 37 + .../hcl/printer/testdata/list_comment.golden | 13 + .../hcl/printer/testdata/list_comment.input | 9 + .../printer/testdata/list_of_objects.golden | 10 + .../printer/testdata/list_of_objects.input | 10 + .../printer/testdata/multiline_string.golden | 7 + .../printer/testdata/multiline_string.input | 7 + .../printer/testdata/object_singleline.golden | 26 + .../printer/testdata/object_singleline.input | 19 + .../testdata/object_with_heredoc.golden | 7 + .../testdata/object_with_heredoc.input | 7 + .../hashicorp/hcl/hcl/scanner/scanner.go | 652 +++++++++ .../hashicorp/hcl/hcl/scanner/scanner_test.go | 642 +++++++++ .../hashicorp/hcl/hcl/strconv/quote.go | 241 ++++ .../hashicorp/hcl/hcl/strconv/quote_test.go | 96 ++ .../hcl/hcl/test-fixtures/array_comment.hcl | 4 + .../hcl/hcl/test-fixtures/assign_colon.hcl | 6 + .../hcl/hcl/test-fixtures/comment.hcl | 15 + .../hcl/hcl/test-fixtures/comment_single.hcl | 1 + .../hcl/hcl/test-fixtures/complex.hcl | 42 + .../hcl/hcl/test-fixtures/complex_key.hcl | 1 + .../hashicorp/hcl/hcl/test-fixtures/empty.hcl | 0 .../hashicorp/hcl/hcl/test-fixtures/list.hcl | 1 + .../hcl/hcl/test-fixtures/list_comma.hcl | 1 + .../hcl/hcl/test-fixtures/multiple.hcl | 2 + .../hashicorp/hcl/hcl/test-fixtures/old.hcl | 3 + .../hcl/hcl/test-fixtures/structure.hcl | 5 + .../hcl/hcl/test-fixtures/structure_basic.hcl | 5 + .../hcl/hcl/test-fixtures/structure_empty.hcl | 1 + .../hashicorp/hcl/hcl/test-fixtures/types.hcl | 7 + .../hashicorp/hcl/hcl/token/position.go | 46 + .../hashicorp/hcl/hcl/token/token.go | 219 +++ .../hashicorp/hcl/hcl/token/token_test.go | 69 + .../github.com/hashicorp/hcl/hcl_test.go | 19 + .../hashicorp/hcl/json/parser/flatten.go | 117 ++ .../hashicorp/hcl/json/parser/parser.go | 313 +++++ .../hashicorp/hcl/json/parser/parser_test.go | 384 ++++++ .../hcl/json/parser/test-fixtures/array.json | 4 + .../parser/test-fixtures/bad_input_128.json | 1 + .../test-fixtures/bad_input_tf_8110.json | 7 + .../hcl/json/parser/test-fixtures/basic.json | 3 + .../test-fixtures/good_input_tf_8110.json | 7 + .../hcl/json/parser/test-fixtures/object.json | 5 + .../hcl/json/parser/test-fixtures/types.json | 10 + .../hashicorp/hcl/json/scanner/scanner.go | 451 ++++++ .../hcl/json/scanner/scanner_test.go | 362 +++++ .../hcl/json/test-fixtures/array.json | 4 + .../hcl/json/test-fixtures/basic.json | 3 + .../hcl/json/test-fixtures/object.json | 5 + .../hcl/json/test-fixtures/types.json | 10 + .../hashicorp/hcl/json/token/position.go | 46 + .../hashicorp/hcl/json/token/token.go | 118 ++ .../hashicorp/hcl/json/token/token_test.go | 34 + .../licenses/github.com/hashicorp/hcl/lex.go | 38 + .../github.com/hashicorp/hcl/lex_test.go | 37 + .../github.com/hashicorp/hcl/parse.go | 39 + .../hcl/test-fixtures/assign_deep.hcl | 5 + .../hashicorp/hcl/test-fixtures/basic.hcl | 2 + .../hashicorp/hcl/test-fixtures/basic.json | 4 + .../hcl/test-fixtures/basic_int_string.hcl | 1 + .../hcl/test-fixtures/basic_squish.hcl | 3 + .../hcl/test-fixtures/block_assign.hcl | 2 + .../hcl/test-fixtures/decode_policy.hcl | 15 + .../hcl/test-fixtures/decode_policy.json | 19 + .../hcl/test-fixtures/decode_tf_variable.hcl | 10 + .../hcl/test-fixtures/decode_tf_variable.json | 14 + .../hashicorp/hcl/test-fixtures/empty.hcl | 1 + .../hashicorp/hcl/test-fixtures/escape.hcl | 6 + .../hcl/test-fixtures/escape_backslash.hcl | 5 + .../hashicorp/hcl/test-fixtures/flat.hcl | 2 + .../hashicorp/hcl/test-fixtures/float.hcl | 2 + .../hashicorp/hcl/test-fixtures/float.json | 4 + .../hashicorp/hcl/test-fixtures/git_crypt.hcl | Bin 0 -> 10 bytes .../hcl/test-fixtures/interpolate.json | 3 + .../hcl/test-fixtures/list_of_lists.hcl | 2 + .../hcl/test-fixtures/list_of_maps.hcl | 4 + .../hashicorp/hcl/test-fixtures/multiline.hcl | 4 + .../hcl/test-fixtures/multiline.json | 3 + .../hcl/test-fixtures/multiline_bad.hcl | 4 + .../hcl/test-fixtures/multiline_indented.hcl | 4 + .../hcl/test-fixtures/multiline_literal.hcl | 2 + .../multiline_literal_with_hil.hcl | 2 + .../hcl/test-fixtures/multiline_no_eof.hcl | 5 + .../multiline_no_hanging_indent.hcl | 5 + .../hcl/test-fixtures/multiline_no_marker.hcl | 1 + .../test-fixtures/nested_block_comment.hcl | 5 + .../hcl/test-fixtures/nested_provider_bad.hcl | 5 + .../hcl/test-fixtures/null_strings.json | 7 + .../hcl/test-fixtures/object_list.json | 15 + .../hcl/test-fixtures/object_with_bool.hcl | 6 + .../hcl/test-fixtures/scientific.hcl | 6 + .../hcl/test-fixtures/scientific.json | 8 + .../hcl/test-fixtures/slice_expand.hcl | 7 + .../hashicorp/hcl/test-fixtures/structure.hcl | 5 + .../hcl/test-fixtures/structure.json | 8 + .../hcl/test-fixtures/structure2.hcl | 9 + .../hcl/test-fixtures/structure2.json | 10 + .../hcl/test-fixtures/structure_flat.json | 8 + .../hcl/test-fixtures/structure_flatmap.hcl | 7 + .../hcl/test-fixtures/structure_list.hcl | 6 + .../hcl/test-fixtures/structure_list.json | 7 + .../test-fixtures/structure_list_deep.json | 16 + .../test-fixtures/structure_list_empty.json | 3 + .../hcl/test-fixtures/structure_multi.hcl | 7 + .../hcl/test-fixtures/structure_multi.json | 11 + .../hcl/test-fixtures/terraform_heroku.hcl | 5 + .../hcl/test-fixtures/terraform_heroku.json | 6 + .../terraform_variable_invalid.json | 5 + .../hashicorp/hcl/test-fixtures/tfvars.hcl | 3 + .../unterminated_block_comment.hcl | 2 + .../hcl/test-fixtures/unterminated_brace.hcl | 2 + .../hashicorp/hcl/testhelper/unix2dos.go | 15 + .../github.com/hectane/go-acl/LICENSE.txt | 9 + .../github.com/huandu/xstrings/LICENSE | 22 + .../licenses/github.com/imdario/mergo/LICENSE | 28 + .../github.com/intel-go/cpuid/LICENSE | 28 + .../github.com/jmespath/go-jmespath/LICENSE | 13 + .../github.com/josharian/intern/license.md | 21 + .../github.com/json-iterator/go/LICENSE | 21 + .../licenses/github.com/juju/clock/.gitignore | 1 + .../licenses/github.com/juju/clock/LICENSE | 191 +++ .../licenses/github.com/juju/clock/Makefile | 20 + .../licenses/github.com/juju/clock/README.md | 7 + .../licenses/github.com/juju/clock/clock.go | 53 + .../licenses/github.com/juju/clock/go.mod | 23 + .../licenses/github.com/juju/clock/go.sum | 87 ++ .../juju/clock/monotonic/monotonic.go | 22 + .../juju/clock/monotonic/monotonic.s | 4 + .../juju/clock/monotonic/monotonic_test.go | 33 + .../github.com/juju/clock/testclock/clock.go | 274 ++++ .../juju/clock/testclock/clock_test.go | 325 +++++ .../juju/clock/testclock/dilated.go | 221 +++ .../juju/clock/testclock/dilated_test.go | 224 +++ .../juju/clock/testclock/interfaces.go | 17 + .../juju/clock/testclock/package_test.go | 20 + .../licenses/github.com/juju/clock/wall.go | 47 + .../github.com/juju/errors/.gitignore | 23 + .../licenses/github.com/juju/errors/LICENSE | 191 +++ .../licenses/github.com/juju/errors/Makefile | 24 + .../licenses/github.com/juju/errors/README.md | 707 ++++++++++ .../github.com/juju/errors/dependencies.tsv | 5 + .../licenses/github.com/juju/errors/doc.go | 79 ++ .../licenses/github.com/juju/errors/error.go | 176 +++ .../github.com/juju/errors/error_test.go | 178 +++ .../github.com/juju/errors/errortypes.go | 382 ++++++ .../github.com/juju/errors/errortypes_test.go | 177 +++ .../github.com/juju/errors/example_test.go | 23 + .../github.com/juju/errors/export_test.go | 12 + .../github.com/juju/errors/functions.go | 330 +++++ .../github.com/juju/errors/functions_test.go | 334 +++++ .../licenses/github.com/juju/errors/go.mod | 16 + .../licenses/github.com/juju/errors/go.sum | 76 ++ .../github.com/juju/errors/package_test.go | 95 ++ .../licenses/github.com/juju/errors/path.go | 32 + .../github.com/juju/errors/path_test.go | 38 + .../github.com/juju/fslock/.gitignore | 24 + .../licenses/github.com/juju/fslock/LICENSE | 191 +++ .../licenses/github.com/juju/fslock/README.md | 74 + .../licenses/github.com/juju/fslock/fslock.go | 32 + .../github.com/juju/fslock/fslock_nix.go | 89 ++ .../github.com/juju/fslock/fslock_test.go | 328 +++++ .../github.com/juju/fslock/fslock_windows.go | 165 +++ .../licenses/github.com/juju/mutex/LICENSE | 191 +++ .../licenses/github.com/juju/mutex/Makefile | 20 + .../licenses/github.com/juju/mutex/README.md | 147 ++ .../licenses/github.com/juju/mutex/doc.go | 16 + .../licenses/github.com/juju/mutex/errors.go | 13 + .../github.com/juju/mutex/export_test.go | 9 + .../licenses/github.com/juju/mutex/go.mod | 25 + .../licenses/github.com/juju/mutex/go.sum | 101 ++ .../licenses/github.com/juju/mutex/mutex.go | 92 ++ .../github.com/juju/mutex/mutex_flock.go | 202 +++ .../github.com/juju/mutex/mutex_mock_test.go | 58 + .../github.com/juju/mutex/mutex_test.go | 526 +++++++ .../github.com/juju/mutex/mutex_windows.go | 262 ++++ .../github.com/juju/mutex/package_test.go | 14 + .../github.com/kballard/go-shellquote/LICENSE | 19 + .../github.com/klauspost/compress/LICENSE | 304 +++++ .../compress/internal/snapref/LICENSE | 27 + .../compress/zstd/internal/xxhash/LICENSE.txt | 22 + .../github.com/klauspost/cpuid/LICENSE | 22 + .../pkg/drivers/vmware/config/LICENSE | 201 +++ .../magiconair/properties/LICENSE.md | 24 + .../github.com/mailru/easyjson/LICENSE | 7 + .../github.com/mattn/go-colorable/LICENSE | 21 + .../github.com/mattn/go-isatty/LICENSE | 9 + .../github.com/mattn/go-runewidth/LICENSE | 21 + .../github.com/mitchellh/go-homedir/LICENSE | 21 + .../github.com/mitchellh/go-ps/LICENSE.md | 21 + .../mitchellh/go-testing-interface/LICENSE | 21 + .../mitchellh/go-wordwrap/LICENSE.md | 21 + .../github.com/mitchellh/mapstructure/LICENSE | 21 + .../github.com/moby/spdystream/LICENSE | 202 +++ .../github.com/moby/spdystream/NOTICE | 5 + .../github.com/moby/sys/mount/LICENSE | 202 +++ .../github.com/moby/sys/mountinfo/LICENSE | 202 +++ .../licenses/github.com/moby/term/LICENSE | 191 +++ .../github.com/modern-go/concurrent/LICENSE | 201 +++ .../github.com/modern-go/reflect2/LICENSE | 201 +++ .../licenses/github.com/muesli/reflow/LICENSE | 21 + .../github.com/munnerz/goautoneg/LICENSE | 31 + .../olekukonko/tablewriter/LICENSE.md | 19 + .../opencontainers/go-digest/LICENSE | 192 +++ .../image-spec/specs-go/LICENSE | 191 +++ .../opencontainers/runc/libcontainer/LICENSE | 191 +++ .../opencontainers/runc/libcontainer/NOTICE | 17 + .../runtime-spec/specs-go/LICENSE | 191 +++ .../licenses/github.com/otiai10/copy/LICENSE | 21 + .../github.com/pelletier/go-toml/v2/LICENSE | 21 + .../github.com/phayes/freeport/LICENSE.md | 15 + .../licenses/github.com/pkg/browser/LICENSE | 23 + .../licenses/github.com/pkg/errors/LICENSE | 23 + .../licenses/github.com/pkg/profile/LICENSE | 24 + .../github.com/rivo/uniseg/LICENSE.txt | 21 + .../russross/blackfriday/LICENSE.txt | 28 + .../github.com/samalba/dockerclient/LICENSE | 202 +++ .../github.com/shirou/gopsutil/v3/LICENSE | 61 + .../github.com/sirupsen/logrus/LICENSE | 21 + .../github.com/spf13/afero/LICENSE.txt | 174 +++ .../licenses/github.com/spf13/cast/LICENSE | 21 + .../github.com/spf13/cobra/LICENSE.txt | 174 +++ .../spf13/jwalterweatherman/LICENSE | 21 + .../licenses/github.com/spf13/pflag/LICENSE | 28 + .../licenses/github.com/spf13/viper/LICENSE | 21 + .../github.com/subosito/gotenv/LICENSE | 21 + .../github.com/tklauser/go-sysconf/LICENSE | 29 + .../github.com/tklauser/numcpus/LICENSE | 202 +++ .../licenses/github.com/ulikunitz/xz/LICENSE | 26 + .../vbatts/tar-split/archive/tar/LICENSE | 28 + .../licenses/github.com/xo/terminfo/LICENSE | 21 + .../licenses/go.opencensus.io/LICENSE | 202 +++ .../licenses/go.opentelemetry.io/otel/LICENSE | 201 +++ .../go.opentelemetry.io/otel/sdk/LICENSE | 201 +++ .../go.opentelemetry.io/otel/trace/LICENSE | 201 +++ .../licenses/go.uber.org/atomic/LICENSE.txt | 19 + .../licenses/go.uber.org/multierr/LICENSE.txt | 19 + .../licenses/go.uber.org/zap/LICENSE.txt | 19 + .../licenses/golang.org/x/crypto/LICENSE | 27 + .../licenses/golang.org/x/exp/ebnf/LICENSE | 27 + .../licenses/golang.org/x/mod/semver/LICENSE | 27 + .../licenses/golang.org/x/net/LICENSE | 27 + .../licenses/golang.org/x/oauth2/LICENSE | 27 + .../licenses/golang.org/x/sync/LICENSE | 27 + .../licenses/golang.org/x/sys/LICENSE | 27 + .../licenses/golang.org/x/term/LICENSE | 27 + .../licenses/golang.org/x/text/LICENSE | 27 + .../licenses/golang.org/x/time/rate/LICENSE | 27 + .../licenses/golang.org/x/xerrors/LICENSE | 27 + .../licenses/google.golang.org/api/LICENSE | 27 + .../internal/third_party/uritemplates/LICENSE | 27 + .../google.golang.org/genproto/LICENSE | 202 +++ .../licenses/google.golang.org/grpc/LICENSE | 202 +++ .../google.golang.org/grpc/NOTICE.txt | 13 + .../google.golang.org/protobuf/LICENSE | 27 + .../licenses/gopkg.in/inf.v0/LICENSE | 28 + .../licenses/gopkg.in/ini.v1/LICENSE | 191 +++ .../licenses/gopkg.in/yaml.v2/LICENSE | 201 +++ .../licenses/gopkg.in/yaml.v2/NOTICE | 13 + .../licenses/gopkg.in/yaml.v3/LICENSE | 50 + .../licenses/gopkg.in/yaml.v3/NOTICE | 13 + test/integration/licenses/k8s.io/api/LICENSE | 202 +++ .../licenses/k8s.io/apimachinery/pkg/LICENSE | 202 +++ .../third_party/forked/golang/LICENSE | 27 + .../licenses/k8s.io/client-go/LICENSE | 202 +++ .../cluster-bootstrap/token/api/LICENSE | 202 +++ .../k8s.io/component-base/featuregate/LICENSE | 202 +++ .../licenses/k8s.io/klog/v2/LICENSE | 191 +++ .../licenses/k8s.io/kube-openapi/pkg/LICENSE | 202 +++ .../kube-openapi/pkg/validation/spec/LICENSE | 202 +++ .../licenses/k8s.io/kubectl/pkg/util/LICENSE | 201 +++ .../licenses/k8s.io/minikube/LICENSE | 202 +++ .../minikube/cmd/minikube/cmd/license.go | 42 + .../pkg/minikube/download/licenses.go | 50 + .../third_party/go-dockerclient/LICENSE | 23 + .../k8s.io/minikube/third_party/go9p/LICENSE | 27 + .../integration/licenses/k8s.io/utils/LICENSE | 202 +++ .../third_party/forked/golang/net/LICENSE | 27 + .../licenses/sigs.k8s.io/json/LICENSE | 238 ++++ .../structured-merge-diff/v4/LICENSE | 201 +++ .../licenses/sigs.k8s.io/yaml/LICENSE | 50 + test/integration/net_test.go | 29 +- test/integration/testdata/kube-flannel.yaml | 23 +- 680 files changed, 51154 insertions(+), 1460 deletions(-) create mode 100644 pkg/minikube/cni/cilium.yaml create mode 100644 pkg/minikube/cni/flannel.yaml delete mode 100644 site/content/en/docs/tutorials/includes/kube-flannel.yaml create mode 100644 test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE create mode 100644 test/integration/licenses/cloud.google.com/go/iam/LICENSE create mode 100644 test/integration/licenses/cloud.google.com/go/internal/LICENSE create mode 100644 test/integration/licenses/cloud.google.com/go/storage/LICENSE create mode 100644 test/integration/licenses/cloud.google.com/go/trace/LICENSE create mode 100644 test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE create mode 100644 test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE create mode 100644 test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE create mode 100644 test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE create mode 100644 test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE create mode 100644 test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE create mode 100644 test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE create mode 100644 test/integration/licenses/github.com/VividCortex/ewma/LICENSE create mode 100644 test/integration/licenses/github.com/VividCortex/godaemon/LICENSE create mode 100644 test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE create mode 100644 test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt create mode 100644 test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt create mode 100644 test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE create mode 100644 test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE create mode 100644 test/integration/licenses/github.com/blang/semver/LICENSE create mode 100644 test/integration/licenses/github.com/blang/semver/v4/LICENSE create mode 100644 test/integration/licenses/github.com/briandowns/spinner/LICENSE create mode 100644 test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE create mode 100644 test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE create mode 100644 test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE create mode 100644 test/integration/licenses/github.com/containerd/containerd/LICENSE create mode 100644 test/integration/licenses/github.com/containerd/containerd/NOTICE create mode 100644 test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE create mode 100644 test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE create mode 100644 test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE create mode 100644 test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE create mode 100644 test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE create mode 100644 test/integration/licenses/github.com/docker/cli/cli/config/LICENSE create mode 100644 test/integration/licenses/github.com/docker/cli/cli/config/NOTICE create mode 100644 test/integration/licenses/github.com/docker/distribution/LICENSE create mode 100644 test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE create mode 100644 test/integration/licenses/github.com/docker/docker/LICENSE create mode 100644 test/integration/licenses/github.com/docker/docker/NOTICE create mode 100644 test/integration/licenses/github.com/docker/go-connections/LICENSE create mode 100644 test/integration/licenses/github.com/docker/go-units/LICENSE create mode 100644 test/integration/licenses/github.com/docker/machine/LICENSE create mode 100644 test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE create mode 100644 test/integration/licenses/github.com/fatih/color/LICENSE.md create mode 100644 test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE create mode 100644 test/integration/licenses/github.com/go-logr/logr/LICENSE create mode 100644 test/integration/licenses/github.com/go-logr/stdr/LICENSE create mode 100644 test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE create mode 100644 test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE create mode 100644 test/integration/licenses/github.com/go-openapi/swag/LICENSE create mode 100644 test/integration/licenses/github.com/godbus/dbus/v5/LICENSE create mode 100644 test/integration/licenses/github.com/gogo/protobuf/LICENSE create mode 100644 test/integration/licenses/github.com/golang/groupcache/lru/LICENSE create mode 100644 test/integration/licenses/github.com/golang/protobuf/LICENSE create mode 100644 test/integration/licenses/github.com/google/gnostic/LICENSE create mode 100644 test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE create mode 100644 test/integration/licenses/github.com/google/go-containerregistry/LICENSE create mode 100644 test/integration/licenses/github.com/google/go-github/v43/github/LICENSE create mode 100644 test/integration/licenses/github.com/google/go-querystring/query/LICENSE create mode 100644 test/integration/licenses/github.com/google/gofuzz/LICENSE create mode 100644 test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE create mode 100644 test/integration/licenses/github.com/google/uuid/LICENSE create mode 100644 test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE create mode 100644 test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE create mode 100644 test/integration/licenses/github.com/gookit/color/LICENSE create mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE create mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md create mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod create mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.gitignore create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/LICENSE create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/README.md create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/checksum.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/common.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_base.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_git.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_http.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/go.mod create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/go.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/module_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/netrc.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/source.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/source_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/storage.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-tar/permissions.tar create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/permissions.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted-multi/archive.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted/archive.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic%2Ftest/foo/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic%2Ftest/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic%2Ftest/subdir/sub.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-dot/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-file-archive/archive.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-file/foo.txt create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/00changelog.i create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/branch create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/branch2-served create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/rbc-names-v1 create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/rbc-revs-v1 create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/tags create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/dirstate create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00changelog.i create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00manifest.i create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/foo.txt.i create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main.tf.i create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main__branch.tf.i create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo.backup.fncache create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo.backupfiles create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo.phaseroots create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.bookmarks create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.branch create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.desc create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.dirstate create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/baz/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/subdir/sub.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-bz2/single.bz2 create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-gz/single.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/extended_header.tar create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/implied_dir.tar create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/unix_time_0.tar create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/empty.tar.bz2 create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/multiple.tar.bz2 create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/ordering.tar.bz2 create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/single.tar.bz2 create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/empty.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple_dir.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/ordering.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/outside_parent.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/single.tar.gz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/empty.tar.xz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple.tar.xz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple_dir.tar.xz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/ordering.tar.xz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/single.tar.xz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/empty.tar.zst create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/multiple.tar.zst create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/multiple_dir.tar.zst create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/ordering.tar.zst create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/outside_parent.tar.zst create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/single.tar.zst create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-xz/single.xz create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/empty.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/multiple.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/outside_parent.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/single.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_empty.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_missing_dir.zip create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zst/single.zst create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/detect-file-symlink-pwd/real/hello.txt create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/foo/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/child/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/child/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/url.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/url_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/util_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE create mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/README.md create mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod create mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/LICENSE create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/README.md create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/constraint.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/go.mod create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version_collection.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/.gitignore create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/.travis.yml create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/LICENSE create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/Makefile create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/README.md create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/appveyor.yml create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/decoder.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/go.mod create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/go.sum create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment_2.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_colon.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_deep.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_crlf.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_lastline.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_single.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_crlf.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_key.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/empty.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/git_crypt.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/key_without_value.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list_comma.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/missing_braces.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/multiple.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value2.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value3.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_without_value.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_list_comma.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/old.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_basic.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_empty.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/types.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/unterminated_object.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/unterminated_object_2.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/nodes.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.golden create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.input create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/flatten.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/lex.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/lex_test.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/parse.go create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_bad.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_indented.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_literal.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_literal_with_hil.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_no_eof.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_no_hanging_indent.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_no_marker.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/nested_block_comment.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/nested_provider_bad.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/null_strings.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/object_list.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/object_with_bool.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/scientific.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/scientific.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/slice_expand.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure2.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure2.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_flat.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_flatmap.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list_deep.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list_empty.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_multi.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_multi.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/terraform_variable_invalid.json create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/tfvars.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/unterminated_block_comment.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/unterminated_brace.hcl create mode 100644 test/integration/licenses/github.com/hashicorp/hcl/testhelper/unix2dos.go create mode 100644 test/integration/licenses/github.com/hectane/go-acl/LICENSE.txt create mode 100644 test/integration/licenses/github.com/huandu/xstrings/LICENSE create mode 100644 test/integration/licenses/github.com/imdario/mergo/LICENSE create mode 100644 test/integration/licenses/github.com/intel-go/cpuid/LICENSE create mode 100644 test/integration/licenses/github.com/jmespath/go-jmespath/LICENSE create mode 100644 test/integration/licenses/github.com/josharian/intern/license.md create mode 100644 test/integration/licenses/github.com/json-iterator/go/LICENSE create mode 100644 test/integration/licenses/github.com/juju/clock/.gitignore create mode 100644 test/integration/licenses/github.com/juju/clock/LICENSE create mode 100644 test/integration/licenses/github.com/juju/clock/Makefile create mode 100644 test/integration/licenses/github.com/juju/clock/README.md create mode 100644 test/integration/licenses/github.com/juju/clock/clock.go create mode 100644 test/integration/licenses/github.com/juju/clock/go.mod create mode 100644 test/integration/licenses/github.com/juju/clock/go.sum create mode 100644 test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go create mode 100644 test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s create mode 100644 test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go create mode 100644 test/integration/licenses/github.com/juju/clock/testclock/clock.go create mode 100644 test/integration/licenses/github.com/juju/clock/testclock/clock_test.go create mode 100644 test/integration/licenses/github.com/juju/clock/testclock/dilated.go create mode 100644 test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go create mode 100644 test/integration/licenses/github.com/juju/clock/testclock/interfaces.go create mode 100644 test/integration/licenses/github.com/juju/clock/testclock/package_test.go create mode 100644 test/integration/licenses/github.com/juju/clock/wall.go create mode 100644 test/integration/licenses/github.com/juju/errors/.gitignore create mode 100644 test/integration/licenses/github.com/juju/errors/LICENSE create mode 100644 test/integration/licenses/github.com/juju/errors/Makefile create mode 100644 test/integration/licenses/github.com/juju/errors/README.md create mode 100644 test/integration/licenses/github.com/juju/errors/dependencies.tsv create mode 100644 test/integration/licenses/github.com/juju/errors/doc.go create mode 100644 test/integration/licenses/github.com/juju/errors/error.go create mode 100644 test/integration/licenses/github.com/juju/errors/error_test.go create mode 100644 test/integration/licenses/github.com/juju/errors/errortypes.go create mode 100644 test/integration/licenses/github.com/juju/errors/errortypes_test.go create mode 100644 test/integration/licenses/github.com/juju/errors/example_test.go create mode 100644 test/integration/licenses/github.com/juju/errors/export_test.go create mode 100644 test/integration/licenses/github.com/juju/errors/functions.go create mode 100644 test/integration/licenses/github.com/juju/errors/functions_test.go create mode 100644 test/integration/licenses/github.com/juju/errors/go.mod create mode 100644 test/integration/licenses/github.com/juju/errors/go.sum create mode 100644 test/integration/licenses/github.com/juju/errors/package_test.go create mode 100644 test/integration/licenses/github.com/juju/errors/path.go create mode 100644 test/integration/licenses/github.com/juju/errors/path_test.go create mode 100644 test/integration/licenses/github.com/juju/fslock/.gitignore create mode 100644 test/integration/licenses/github.com/juju/fslock/LICENSE create mode 100644 test/integration/licenses/github.com/juju/fslock/README.md create mode 100644 test/integration/licenses/github.com/juju/fslock/fslock.go create mode 100644 test/integration/licenses/github.com/juju/fslock/fslock_nix.go create mode 100644 test/integration/licenses/github.com/juju/fslock/fslock_test.go create mode 100644 test/integration/licenses/github.com/juju/fslock/fslock_windows.go create mode 100644 test/integration/licenses/github.com/juju/mutex/LICENSE create mode 100644 test/integration/licenses/github.com/juju/mutex/Makefile create mode 100644 test/integration/licenses/github.com/juju/mutex/README.md create mode 100644 test/integration/licenses/github.com/juju/mutex/doc.go create mode 100644 test/integration/licenses/github.com/juju/mutex/errors.go create mode 100644 test/integration/licenses/github.com/juju/mutex/export_test.go create mode 100644 test/integration/licenses/github.com/juju/mutex/go.mod create mode 100644 test/integration/licenses/github.com/juju/mutex/go.sum create mode 100644 test/integration/licenses/github.com/juju/mutex/mutex.go create mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_flock.go create mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go create mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_test.go create mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_windows.go create mode 100644 test/integration/licenses/github.com/juju/mutex/package_test.go create mode 100644 test/integration/licenses/github.com/kballard/go-shellquote/LICENSE create mode 100644 test/integration/licenses/github.com/klauspost/compress/LICENSE create mode 100644 test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE create mode 100644 test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt create mode 100644 test/integration/licenses/github.com/klauspost/cpuid/LICENSE create mode 100644 test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE create mode 100644 test/integration/licenses/github.com/magiconair/properties/LICENSE.md create mode 100644 test/integration/licenses/github.com/mailru/easyjson/LICENSE create mode 100644 test/integration/licenses/github.com/mattn/go-colorable/LICENSE create mode 100644 test/integration/licenses/github.com/mattn/go-isatty/LICENSE create mode 100644 test/integration/licenses/github.com/mattn/go-runewidth/LICENSE create mode 100644 test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE create mode 100644 test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md create mode 100644 test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE create mode 100644 test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md create mode 100644 test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE create mode 100644 test/integration/licenses/github.com/moby/spdystream/LICENSE create mode 100644 test/integration/licenses/github.com/moby/spdystream/NOTICE create mode 100644 test/integration/licenses/github.com/moby/sys/mount/LICENSE create mode 100644 test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE create mode 100644 test/integration/licenses/github.com/moby/term/LICENSE create mode 100644 test/integration/licenses/github.com/modern-go/concurrent/LICENSE create mode 100644 test/integration/licenses/github.com/modern-go/reflect2/LICENSE create mode 100644 test/integration/licenses/github.com/muesli/reflow/LICENSE create mode 100644 test/integration/licenses/github.com/munnerz/goautoneg/LICENSE create mode 100644 test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md create mode 100644 test/integration/licenses/github.com/opencontainers/go-digest/LICENSE create mode 100644 test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE create mode 100644 test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE create mode 100644 test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE create mode 100644 test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE create mode 100644 test/integration/licenses/github.com/otiai10/copy/LICENSE create mode 100644 test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE create mode 100644 test/integration/licenses/github.com/phayes/freeport/LICENSE.md create mode 100644 test/integration/licenses/github.com/pkg/browser/LICENSE create mode 100644 test/integration/licenses/github.com/pkg/errors/LICENSE create mode 100644 test/integration/licenses/github.com/pkg/profile/LICENSE create mode 100644 test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt create mode 100644 test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt create mode 100644 test/integration/licenses/github.com/samalba/dockerclient/LICENSE create mode 100644 test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE create mode 100644 test/integration/licenses/github.com/sirupsen/logrus/LICENSE create mode 100644 test/integration/licenses/github.com/spf13/afero/LICENSE.txt create mode 100644 test/integration/licenses/github.com/spf13/cast/LICENSE create mode 100644 test/integration/licenses/github.com/spf13/cobra/LICENSE.txt create mode 100644 test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE create mode 100644 test/integration/licenses/github.com/spf13/pflag/LICENSE create mode 100644 test/integration/licenses/github.com/spf13/viper/LICENSE create mode 100644 test/integration/licenses/github.com/subosito/gotenv/LICENSE create mode 100644 test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE create mode 100644 test/integration/licenses/github.com/tklauser/numcpus/LICENSE create mode 100644 test/integration/licenses/github.com/ulikunitz/xz/LICENSE create mode 100644 test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE create mode 100644 test/integration/licenses/github.com/xo/terminfo/LICENSE create mode 100644 test/integration/licenses/go.opencensus.io/LICENSE create mode 100644 test/integration/licenses/go.opentelemetry.io/otel/LICENSE create mode 100644 test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE create mode 100644 test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE create mode 100644 test/integration/licenses/go.uber.org/atomic/LICENSE.txt create mode 100644 test/integration/licenses/go.uber.org/multierr/LICENSE.txt create mode 100644 test/integration/licenses/go.uber.org/zap/LICENSE.txt create mode 100644 test/integration/licenses/golang.org/x/crypto/LICENSE create mode 100644 test/integration/licenses/golang.org/x/exp/ebnf/LICENSE create mode 100644 test/integration/licenses/golang.org/x/mod/semver/LICENSE create mode 100644 test/integration/licenses/golang.org/x/net/LICENSE create mode 100644 test/integration/licenses/golang.org/x/oauth2/LICENSE create mode 100644 test/integration/licenses/golang.org/x/sync/LICENSE create mode 100644 test/integration/licenses/golang.org/x/sys/LICENSE create mode 100644 test/integration/licenses/golang.org/x/term/LICENSE create mode 100644 test/integration/licenses/golang.org/x/text/LICENSE create mode 100644 test/integration/licenses/golang.org/x/time/rate/LICENSE create mode 100644 test/integration/licenses/golang.org/x/xerrors/LICENSE create mode 100644 test/integration/licenses/google.golang.org/api/LICENSE create mode 100644 test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE create mode 100644 test/integration/licenses/google.golang.org/genproto/LICENSE create mode 100644 test/integration/licenses/google.golang.org/grpc/LICENSE create mode 100644 test/integration/licenses/google.golang.org/grpc/NOTICE.txt create mode 100644 test/integration/licenses/google.golang.org/protobuf/LICENSE create mode 100644 test/integration/licenses/gopkg.in/inf.v0/LICENSE create mode 100644 test/integration/licenses/gopkg.in/ini.v1/LICENSE create mode 100644 test/integration/licenses/gopkg.in/yaml.v2/LICENSE create mode 100644 test/integration/licenses/gopkg.in/yaml.v2/NOTICE create mode 100644 test/integration/licenses/gopkg.in/yaml.v3/LICENSE create mode 100644 test/integration/licenses/gopkg.in/yaml.v3/NOTICE create mode 100644 test/integration/licenses/k8s.io/api/LICENSE create mode 100644 test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE create mode 100644 test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE create mode 100644 test/integration/licenses/k8s.io/client-go/LICENSE create mode 100644 test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE create mode 100644 test/integration/licenses/k8s.io/component-base/featuregate/LICENSE create mode 100644 test/integration/licenses/k8s.io/klog/v2/LICENSE create mode 100644 test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE create mode 100644 test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE create mode 100644 test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE create mode 100644 test/integration/licenses/k8s.io/minikube/LICENSE create mode 100644 test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go create mode 100644 test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go create mode 100644 test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE create mode 100644 test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE create mode 100644 test/integration/licenses/k8s.io/utils/LICENSE create mode 100644 test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE create mode 100644 test/integration/licenses/sigs.k8s.io/json/LICENSE create mode 100644 test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE create mode 100644 test/integration/licenses/sigs.k8s.io/yaml/LICENSE diff --git a/go.mod b/go.mod index c60166774f..bd9168af8b 100644 --- a/go.mod +++ b/go.mod @@ -33,15 +33,6 @@ require ( github.com/hooklift/iso9660 v0.0.0-20170318115843-1cf07e5970d8 github.com/intel-go/cpuid v0.0.0-20181003105527-1a4a6f06a1c6 // indirect github.com/johanneswuerbach/nfsexports v0.0.0-20200318065542-c48c3734757f - github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c - github.com/juju/errors v0.0.0-20190806202954-0232dcc7464d // indirect - github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b - github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect - github.com/juju/mutex v0.0.0-20180619145857-d21b13acf4bf - github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect - github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2 // indirect - github.com/juju/utils v0.0.0-20180820210520-bf9cc5bdd62d // indirect - github.com/juju/version v0.0.0-20180108022336-b64dbd566305 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/klauspost/cpuid v1.2.0 github.com/machine-drivers/docker-machine-driver-vmware v0.1.5 @@ -81,7 +72,6 @@ require ( golang.org/x/text v0.5.0 gonum.org/v1/plot v0.12.0 google.golang.org/api v0.103.0 - gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.25.4 k8s.io/apimachinery v0.25.4 @@ -100,8 +90,12 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/docker/go-connections v0.4.0 github.com/google/go-github/v43 v43.0.0 + github.com/juju/clock v1.0.2 + github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b + github.com/juju/mutex/v2 v2.0.0 github.com/opencontainers/runc v1.1.4 github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c ) require ( @@ -169,7 +163,10 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 // indirect github.com/klauspost/compress v1.15.11 // indirect + github.com/kr/pretty v0.3.0 // indirect + github.com/kr/text v0.2.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.6 // indirect @@ -199,6 +196,7 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/prometheus v2.5.0+incompatible // indirect github.com/rivo/uniseg v0.2.0 // indirect + github.com/rogpeppe/go-internal v1.6.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.2 // indirect diff --git a/go.sum b/go.sum index ad93c7bd0d..8f2451ea74 100644 --- a/go.sum +++ b/go.sum @@ -683,24 +683,21 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c h1:3UvYABOQRhJAApj9MdCN+Ydv841ETSoy6xLzdmmr/9A= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= -github.com/juju/errors v0.0.0-20190806202954-0232dcc7464d h1:hJXjZMxj0SWlMoQkzeZDLi2cmeiWKa7y1B8Rg+qaoEc= -github.com/juju/errors v0.0.0-20190806202954-0232dcc7464d/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/clock v1.0.2 h1:dJFdUGjtR/76l6U5WLVVI/B3i6+u3Nb9F9s1m+xxrxo= +github.com/juju/clock v1.0.2/go.mod h1:HIBvJ8kiV/n7UHwKuCkdYL4l/MDECztHR2sAvWDxxf0= +github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 h1:4R626WTwa7pRYQFiIRLVPepMhm05eZMEx+wIurRnMLc= +github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 h1:EJHbsNpQyupmMeWTq7inn+5L/WZ7JfzCVPJ+DP9McCQ= +github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9/go.mod h1:TRm7EVGA3mQOqSVcBySRY7a9Y1/gyVhh/WTCnc5sD4U= github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b h1:FQ7+9fxhyp82ks9vAuyPzG0/vVbWwMwLJ+P6yJI5FN8= github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b/go.mod h1:HMcgvsgd0Fjj4XXDkbjdmlbI505rUPBs6WBMYg2pXks= -github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI= -github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/mutex v0.0.0-20180619145857-d21b13acf4bf h1:2d3cilQly1OpAfZcn4QRuwDOdVoHsM4cDTkcKbmO760= -github.com/juju/mutex v0.0.0-20180619145857-d21b13acf4bf/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= +github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 h1:NO5tuyw++EGLnz56Q8KMyDZRwJwWO8jQnj285J3FOmY= +github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= +github.com/juju/mutex/v2 v2.0.0 h1:rVmJdOaXGWF8rjcFHBNd4x57/1tks5CgXHx55O55SB0= +github.com/juju/mutex/v2 v2.0.0/go.mod h1:jwCfBs/smYDaeZLqeaCi8CB8M+tOes4yf827HoOEoqk= github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2 h1:Pp8RxiF4rSoXP9SED26WCfNB28/dwTDpPXS8XMJR8rc= -github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/utils v0.0.0-20180820210520-bf9cc5bdd62d h1:irPlN9z5VCe6BTsqVsxheCZH99OFSmqSVyTigW4mEoY= -github.com/juju/utils v0.0.0-20180820210520-bf9cc5bdd62d/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/version v0.0.0-20180108022336-b64dbd566305 h1:lQxPJ1URr2fjsKnJRt/BxiIxjLt9IKGvS+0injMHbag= -github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 h1:XEDzpuZb8Ma7vLja3+5hzUqVTvAqm5Y+ygvnDs5iTMM= +github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a h1:5ZWDCeCF0RaITrZGemzmDFIhjR/MVSvBUqgSyaeTMbE= +github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 h1:wtEPbidt1VyHlb8RSztU6ySQj29FLsOQiI9XiJhXDM4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= @@ -726,6 +723,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= @@ -962,6 +960,7 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= 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= @@ -1679,8 +1678,6 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= diff --git a/pkg/kapi/kapi.go b/pkg/kapi/kapi.go index 2925751c62..63f653543d 100644 --- a/pkg/kapi/kapi.go +++ b/pkg/kapi/kapi.go @@ -223,8 +223,12 @@ func ScaleDeployment(kcontext, namespace, deploymentName string, replicas int) e err = wait.PollImmediate(kconst.APICallRetryInterval, ReasonableMutateTime, func() (bool, error) { scale, err := client.AppsV1().Deployments(namespace).GetScale(context.Background(), deploymentName, meta.GetOptions{}) if err != nil { - klog.Warningf("failed getting deployment scale, will retry: %v", err) - return false, nil + if IsRetryableAPIError(err) { + klog.Warningf("failed getting %q deployment scale, will retry: %v", deploymentName, err) + return false, nil + } + klog.Info("non-retryable failure while getting %q deployment scale: %v", deploymentName, err) + return false, err } if scale.Spec.Replicas != int32(replicas) { scale.Spec.Replicas = int32(replicas) @@ -238,7 +242,7 @@ func ScaleDeployment(kcontext, namespace, deploymentName string, replicas int) e return true, nil }) if err != nil { - klog.Infof("timed out trying to rescale deployment %q in namespace %q and context %q to %d: %v", deploymentName, namespace, kcontext, replicas, err) + klog.Infof("failed to rescale deployment %q in namespace %q and context %q to %d: %v", deploymentName, namespace, kcontext, replicas, err) return err } klog.Infof("deployment %q in namespace %q and context %q rescaled to %d", deploymentName, namespace, kcontext, replicas) diff --git a/pkg/minikube/bootstrapper/certs.go b/pkg/minikube/bootstrapper/certs.go index e86641ee04..8b4b11b763 100644 --- a/pkg/minikube/bootstrapper/certs.go +++ b/pkg/minikube/bootstrapper/certs.go @@ -30,6 +30,7 @@ import ( "strings" "time" + "github.com/juju/mutex/v2" "github.com/otiai10/copy" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" @@ -46,6 +47,7 @@ import ( "k8s.io/minikube/pkg/minikube/out" "k8s.io/minikube/pkg/minikube/vmpath" "k8s.io/minikube/pkg/util" + "k8s.io/minikube/pkg/util/lock" ) // SetupCerts gets the generated credentials required to talk to the APIServer. @@ -177,6 +179,17 @@ func generateSharedCACerts() (CACerts, bool, error) { }, } + // create a lock for "ca-certs" to avoid race condition over multiple minikube instances rewriting shared ca certs + hold := filepath.Join(globalPath, "ca-certs") + spec := lock.PathMutexSpec(hold) + spec.Timeout = 1 * time.Minute + klog.Infof("acquiring lock for shared ca certs: %+v", spec) + releaser, err := mutex.Acquire(spec) + if err != nil { + return cc, false, errors.Wrapf(err, "unable to acquire lock for shared ca certs %+v", spec) + } + defer releaser.Release() + for _, ca := range caCertSpecs { if isValid(ca.certPath, ca.keyPath) { klog.Infof("skipping %s CA generation: %s", ca.subject, ca.keyPath) diff --git a/pkg/minikube/bootstrapper/images/images.go b/pkg/minikube/bootstrapper/images/images.go index 4237d4cac3..72299e80df 100644 --- a/pkg/minikube/bootstrapper/images/images.go +++ b/pkg/minikube/bootstrapper/images/images.go @@ -174,7 +174,7 @@ func KindNet(repo string) string { } // all calico images are from https://docs.projectcalico.org/manifests/calico.yaml -const calicoVersion = "v3.20.0" +const calicoVersion = "v3.24.5" const calicoRepo = "docker.io/calico" // CalicoDaemonSet returns the image used for calicoDaemonSet @@ -188,11 +188,6 @@ func CalicoDeployment(repo string) string { return calicoCommon(repo, "kube-controllers") } -// CalicoFelixDriver returns image used for felix driver -func CalicoFelixDriver(repo string) string { - return calicoCommon(repo, "pod2daemon-flexvol") -} - // CalicoBin returns image used for calico binary image func CalicoBin(repo string) string { return calicoCommon(repo, "cni") diff --git a/pkg/minikube/cni/calico.go b/pkg/minikube/cni/calico.go index 9db610400b..01ec3cb74d 100644 --- a/pkg/minikube/cni/calico.go +++ b/pkg/minikube/cni/calico.go @@ -48,7 +48,6 @@ type Calico struct { type calicoTmplStruct struct { DeploymentImageName string DaemonSetImageName string - FelixDriverImageName string BinaryImageName string LegacyPodDisruptionBudget bool } @@ -68,7 +67,6 @@ func (c Calico) manifest() (assets.CopyableFile, error) { input := &calicoTmplStruct{ DeploymentImageName: images.CalicoDeployment(c.cc.KubernetesConfig.ImageRepository), DaemonSetImageName: images.CalicoDaemonSet(c.cc.KubernetesConfig.ImageRepository), - FelixDriverImageName: images.CalicoFelixDriver(c.cc.KubernetesConfig.ImageRepository), BinaryImageName: images.CalicoBin(c.cc.KubernetesConfig.ImageRepository), LegacyPodDisruptionBudget: k8sVersion.LT(semver.Version{Major: 1, Minor: 25}), } diff --git a/pkg/minikube/cni/calico.yaml b/pkg/minikube/cni/calico.yaml index c357997113..9b3c99dd5e 100644 --- a/pkg/minikube/cni/calico.yaml +++ b/pkg/minikube/cni/calico.yaml @@ -1,4 +1,34 @@ --- +# Source: calico/templates/calico-kube-controllers.yaml +# This manifest creates a Pod Disruption Budget for Controller to allow K8s Cluster Autoscaler to evict + +apiVersion: policy/v1{{if .LegacyPodDisruptionBudget}}beta1{{end}} +kind: PodDisruptionBudget +metadata: + name: calico-kube-controllers + namespace: kube-system + labels: + k8s-app: calico-kube-controllers +spec: + maxUnavailable: 1 + selector: + matchLabels: + k8s-app: calico-kube-controllers +--- +# Source: calico/templates/calico-kube-controllers.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: calico-kube-controllers + namespace: kube-system +--- +# Source: calico/templates/calico-node.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: calico-node + namespace: kube-system +--- # Source: calico/templates/calico-config.yaml # This ConfigMap is used to configure a self-hosted Calico installation. kind: ConfigMap @@ -52,10 +82,8 @@ data: } ] } - --- # Source: calico/templates/kdd-crds.yaml - apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -67,6 +95,7 @@ spec: listKind: BGPConfigurationList plural: bgpconfigurations singular: bgpconfiguration + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -94,6 +123,12 @@ spec: 64512]' format: int32 type: integer + bindMode: + description: BindMode indicates whether to listen for BGP connections + on all addresses (None) or only on the node's canonical IP address + Node.Spec.BGP.IPvXAddress (NodeIP). Default behaviour is to listen + for BGP connections on all addresses. + type: string communities: description: Communities is a list of BGP community values and their arbitrary names for tagging routes. @@ -124,6 +159,37 @@ spec: description: 'LogSeverityScreen is the log severity above which logs are sent to the stdout. [Default: INFO]' type: string + nodeMeshMaxRestartTime: + description: Time to allow for software restart for node-to-mesh peerings. When + specified, this is configured as the graceful restart timeout. When + not specified, the BIRD default of 120s is used. This field can + only be set on the default BGPConfiguration instance and requires + that NodeMesh is enabled + type: string + nodeMeshPassword: + description: Optional BGP password for full node-to-mesh peerings. + This field can only be set on the default BGPConfiguration instance + and requires that NodeMesh is enabled + properties: + secretKeyRef: + description: Selects a key of a secret in the node pod's namespace. + properties: + key: + description: The key of the secret to select from. Must be + a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be + defined + type: boolean + required: + - key + type: object + type: object nodeToNodeMeshEnabled: description: 'NodeToNodeMeshEnabled sets whether full node to node BGP mesh is enabled. [Default: true]' @@ -197,8 +263,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -210,6 +276,7 @@ spec: listKind: BGPPeerList plural: bgppeers singular: bgppeer + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -242,8 +309,8 @@ spec: in the specific branch of the Node on "bird.cfg". type: boolean maxRestartTime: - description: Time to allow for software restart. When specified, this - is configured as the graceful restart timeout. When not specified, + description: Time to allow for software restart. When specified, + this is configured as the graceful restart timeout. When not specified, the BIRD default of 120s is used. type: string node: @@ -255,6 +322,12 @@ spec: description: Selector for the nodes that should have this peering. When this is set, the Node field must be empty. type: string + numAllowedLocalASNumbers: + description: Maximum number of local AS numbers that are allowed in + the AS path for received routes. This removes BGP loop prevention + and should only be used if absolutely necesssary. + format: int32 + type: integer password: description: Optional BGP password for the peerings generated by this BGPPeer resource. @@ -310,8 +383,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -323,6 +396,7 @@ spec: listKind: BlockAffinityList plural: blockaffinities singular: blockaffinity + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -371,8 +445,272 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: (devel) + creationTimestamp: null + name: caliconodestatuses.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: CalicoNodeStatus + listKind: CalicoNodeStatusList + plural: caliconodestatuses + singular: caliconodestatus + preserveUnknownFields: false + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: CalicoNodeStatusSpec contains the specification for a CalicoNodeStatus + resource. + properties: + classes: + description: Classes declares the types of information to monitor + for this calico/node, and allows for selective status reporting + about certain subsets of information. + items: + type: string + type: array + node: + description: The node name identifies the Calico node instance for + node status. + type: string + updatePeriodSeconds: + description: UpdatePeriodSeconds is the period at which CalicoNodeStatus + should be updated. Set to 0 to disable CalicoNodeStatus refresh. + Maximum update period is one day. + format: int32 + type: integer + type: object + status: + description: CalicoNodeStatusStatus defines the observed state of CalicoNodeStatus. + No validation needed for status since it is updated by Calico. + properties: + agent: + description: Agent holds agent status on the node. + properties: + birdV4: + description: BIRDV4 represents the latest observed status of bird4. + properties: + lastBootTime: + description: LastBootTime holds the value of lastBootTime + from bird.ctl output. + type: string + lastReconfigurationTime: + description: LastReconfigurationTime holds the value of lastReconfigTime + from bird.ctl output. + type: string + routerID: + description: Router ID used by bird. + type: string + state: + description: The state of the BGP Daemon. + type: string + version: + description: Version of the BGP daemon + type: string + type: object + birdV6: + description: BIRDV6 represents the latest observed status of bird6. + properties: + lastBootTime: + description: LastBootTime holds the value of lastBootTime + from bird.ctl output. + type: string + lastReconfigurationTime: + description: LastReconfigurationTime holds the value of lastReconfigTime + from bird.ctl output. + type: string + routerID: + description: Router ID used by bird. + type: string + state: + description: The state of the BGP Daemon. + type: string + version: + description: Version of the BGP daemon + type: string + type: object + type: object + bgp: + description: BGP holds node BGP status. + properties: + numberEstablishedV4: + description: The total number of IPv4 established bgp sessions. + type: integer + numberEstablishedV6: + description: The total number of IPv6 established bgp sessions. + type: integer + numberNotEstablishedV4: + description: The total number of IPv4 non-established bgp sessions. + type: integer + numberNotEstablishedV6: + description: The total number of IPv6 non-established bgp sessions. + type: integer + peersV4: + description: PeersV4 represents IPv4 BGP peers status on the node. + items: + description: CalicoNodePeer contains the status of BGP peers + on the node. + properties: + peerIP: + description: IP address of the peer whose condition we are + reporting. + type: string + since: + description: Since the state or reason last changed. + type: string + state: + description: State is the BGP session state. + type: string + type: + description: Type indicates whether this peer is configured + via the node-to-node mesh, or via en explicit global or + per-node BGPPeer object. + type: string + type: object + type: array + peersV6: + description: PeersV6 represents IPv6 BGP peers status on the node. + items: + description: CalicoNodePeer contains the status of BGP peers + on the node. + properties: + peerIP: + description: IP address of the peer whose condition we are + reporting. + type: string + since: + description: Since the state or reason last changed. + type: string + state: + description: State is the BGP session state. + type: string + type: + description: Type indicates whether this peer is configured + via the node-to-node mesh, or via en explicit global or + per-node BGPPeer object. + type: string + type: object + type: array + required: + - numberEstablishedV4 + - numberEstablishedV6 + - numberNotEstablishedV4 + - numberNotEstablishedV6 + type: object + lastUpdated: + description: LastUpdated is a timestamp representing the server time + when CalicoNodeStatus object last updated. It is represented in + RFC3339 form and is in UTC. + format: date-time + nullable: true + type: string + routes: + description: Routes reports routes known to the Calico BGP daemon + on the node. + properties: + routesV4: + description: RoutesV4 represents IPv4 routes on the node. + items: + description: CalicoNodeRoute contains the status of BGP routes + on the node. + properties: + destination: + description: Destination of the route. + type: string + gateway: + description: Gateway for the destination. + type: string + interface: + description: Interface for the destination + type: string + learnedFrom: + description: LearnedFrom contains information regarding + where this route originated. + properties: + peerIP: + description: If sourceType is NodeMesh or BGPPeer, IP + address of the router that sent us this route. + type: string + sourceType: + description: Type of the source where a route is learned + from. + type: string + type: object + type: + description: Type indicates if the route is being used for + forwarding or not. + type: string + type: object + type: array + routesV6: + description: RoutesV6 represents IPv6 routes on the node. + items: + description: CalicoNodeRoute contains the status of BGP routes + on the node. + properties: + destination: + description: Destination of the route. + type: string + gateway: + description: Gateway for the destination. + type: string + interface: + description: Interface for the destination + type: string + learnedFrom: + description: LearnedFrom contains information regarding + where this route originated. + properties: + peerIP: + description: If sourceType is NodeMesh or BGPPeer, IP + address of the router that sent us this route. + type: string + sourceType: + description: Type of the source where a route is learned + from. + type: string + type: object + type: + description: Type indicates if the route is being used for + forwarding or not. + type: string + type: object + type: array + type: object + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -384,6 +722,7 @@ spec: listKind: ClusterInformationList plural: clusterinformations singular: clusterinformation + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -435,8 +774,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -448,6 +787,7 @@ spec: listKind: FelixConfigurationList plural: felixconfigurations singular: felixconfiguration + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -482,7 +822,7 @@ spec: type: boolean awsSrcDstCheck: description: 'Set source-destination-check on AWS EC2 instances. Accepted - value must be one of "DoNothing", "Enabled" or "Disabled". [Default: + value must be one of "DoNothing", "Enable" or "Disable". [Default: DoNothing]' enum: - DoNothing @@ -516,6 +856,18 @@ spec: description: 'BPFEnabled, if enabled Felix will use the BPF dataplane. [Default: false]' type: boolean + bpfEnforceRPF: + description: 'BPFEnforceRPF enforce strict RPF on all interfaces with + BPF programs regardless of what is the per-interfaces or global + setting. Possible values are Disabled or Strict. [Default: Strict]' + type: string + bpfExtToServiceConnmark: + description: 'BPFExtToServiceConnmark in BPF mode, control a 32bit + mark that is set on connections from an external client to a local + service. This mark allows us to control how packets of that connection + are routed within the host and how is routing interpreted by RPF + check. [Default: 0]' + type: integer bpfExternalServiceMode: description: 'BPFExternalServiceMode in BPF mode, controls how connections from outside the cluster to services (node ports and cluster IPs) @@ -526,14 +878,11 @@ spec: node appears to use the IP of the ingress node; this requires a permissive L2 network. [Default: Tunnel]' type: string - bpfExtToServiceConnmark: - description: 'BPFExtToServiceConnmark in BPF mode, controls a - 32bit mark that is set on connections from an external client to - a local service. This mark allows us to control how packets of - that connection are routed within the host and how is routing - interpreted by RPF check. [Default: 0]' - type: integer - + bpfHostConntrackBypass: + description: 'BPFHostConntrackBypass Controls whether to bypass Linux + conntrack in BPF mode for workloads and services. [Default: true + - bypass Linux conntrack]' + type: boolean bpfKubeProxyEndpointSlicesEnabled: description: BPFKubeProxyEndpointSlicesEnabled in BPF mode, controls whether Felix's embedded kube-proxy accepts EndpointSlices or not. @@ -556,6 +905,61 @@ spec: logs are emitted to the BPF trace pipe, accessible with the command `tc exec bpf debug`. [Default: Off].' type: string + bpfMapSizeConntrack: + description: 'BPFMapSizeConntrack sets the size for the conntrack + map. This map must be large enough to hold an entry for each active + connection. Warning: changing the size of the conntrack map can + cause disruption.' + type: integer + bpfMapSizeIPSets: + description: BPFMapSizeIPSets sets the size for ipsets map. The IP + sets map must be large enough to hold an entry for each endpoint + matched by every selector in the source/destination matches in network + policy. Selectors such as "all()" can result in large numbers of + entries (one entry per endpoint in that case). + type: integer + bpfMapSizeIfState: + description: BPFMapSizeIfState sets the size for ifstate map. The + ifstate map must be large enough to hold an entry for each device + (host + workloads) on a host. + type: integer + bpfMapSizeNATAffinity: + type: integer + bpfMapSizeNATBackend: + description: BPFMapSizeNATBackend sets the size for nat back end map. + This is the total number of endpoints. This is mostly more than + the size of the number of services. + type: integer + bpfMapSizeNATFrontend: + description: BPFMapSizeNATFrontend sets the size for nat front end + map. FrontendMap should be large enough to hold an entry for each + nodeport, external IP and each port in each service. + type: integer + bpfMapSizeRoute: + description: BPFMapSizeRoute sets the size for the routes map. The + routes map should be large enough to hold one entry per workload + and a handful of entries per host (enough to cover its own IPs and + tunnel IPs). + type: integer + bpfPSNATPorts: + anyOf: + - type: integer + - type: string + description: 'BPFPSNATPorts sets the range from which we randomly + pick a port if there is a source port collision. This should be + within the ephemeral range as defined by RFC 6056 (1024–65535) and + preferably outside the ephemeral ranges used by common operating + systems. Linux uses 32768–60999, while others mostly use the IANA + defined range 49152–65535. It is not necessarily a problem if this + range overlaps with the operating systems. Both ends of the range + are inclusive. [Default: 20000:29999]' + pattern: ^.* + x-kubernetes-int-or-string: true + bpfPolicyDebugEnabled: + description: BPFPolicyDebugEnabled when true, Felix records detailed + information about the BPF policy programs, which can be examined + with the calico-bpf command-line tool. + type: boolean chainInsertMode: description: 'ChainInsertMode controls whether Felix hooks the kernel''s top-level iptables chains by inserting a rule at the top of the @@ -566,6 +970,15 @@ spec: Calico policy will be bypassed. [Default: insert]' type: string dataplaneDriver: + description: DataplaneDriver filename of the external dataplane driver + to use. Only used if UseInternalDataplaneDriver is set to false. + type: string + dataplaneWatchdogTimeout: + description: 'DataplaneWatchdogTimeout is the readiness/liveness timeout + used for Felix''s (internal) dataplane driver. Increase this value + if you experience spurious non-ready or non-live events when Felix + is under heavy load. Decrease the value to get felix to report non-live + or non-ready more quickly. [Default: 90s]' type: string debugDisableLogDropping: type: boolean @@ -594,9 +1007,14 @@ spec: routes, by default this will be RTPROT_BOOT when left blank. type: integer deviceRouteSourceAddress: - description: This is the source address to use on programmed device - routes. By default the source address is left blank, leaving the - kernel to choose the source address used. + description: This is the IPv4 source address to use on programmed + device routes. By default the source address is left blank, leaving + the kernel to choose the source address used. + type: string + deviceRouteSourceAddressIPv6: + description: This is the IPv6 source address to use on programmed + device routes. By default the source address is left blank, leaving + the kernel to choose the source address used. type: string disableConntrackInvalidCheck: type: boolean @@ -670,6 +1088,13 @@ spec: "true" or "false" will force the feature, empty or omitted values are auto-detected. type: string + floatingIPs: + description: FloatingIPs configures whether or not Felix will program + floating IP addresses. + enum: + - Enabled + - Disabled + type: string genericXDPEnabled: description: 'GenericXDPEnabled enables Generic XDP so network cards that don''t support XDP offload or driver modes can use XDP. This @@ -707,6 +1132,9 @@ spec: disabled by setting the interval to 0. type: string ipipEnabled: + description: 'IPIPEnabled overrides whether Felix should configure + an IPIP interface on the host. Optional as Felix determines this + based on the existing IP pools. [Default: nil (unset)]' type: boolean ipipMTU: description: 'IPIPMTU is the MTU to set on the tunnel device. See @@ -773,6 +1201,8 @@ spec: usage. [Default: 10s]' type: string ipv6Support: + description: IPv6Support controls whether Felix enables support for + IPv6 (if supported by the in-use dataplane). type: boolean kubeNodePortRanges: description: 'KubeNodePortRanges holds list of port ranges used for @@ -786,6 +1216,12 @@ spec: pattern: ^.* x-kubernetes-int-or-string: true type: array + logDebugFilenameRegex: + description: LogDebugFilenameRegex controls which source code files + have their Debug log output included in the logs. Only logs from + files with names that match the given regular expression are included. The + filter only applies to Debug level logs. + type: string logFilePath: description: 'LogFilePath is the full path to the Felix log. Set to none to disable file logging. [Default: /var/log/calico/felix.log]' @@ -882,6 +1318,12 @@ spec: to false. This reduces the number of metrics reported, reducing Prometheus load. [Default: true]' type: boolean + prometheusWireGuardMetricsEnabled: + description: 'PrometheusWireGuardMetricsEnabled disables wireguard + metrics collection, which the Prometheus client does by default, + when set to false. This reduces the number of metrics reported, + reducing Prometheus load. [Default: true]' + type: boolean removeExternalRoutes: description: Whether or not to remove device routes that have not been programmed by Felix. Disabling this will allow external applications @@ -908,10 +1350,14 @@ spec: information. - WorkloadIPs: use workload endpoints to construct routes. - CalicoIPAM: the default - use IPAM data to construct routes.' type: string + routeSyncDisabled: + description: RouteSyncDisabled will disable all operations performed + on the route table. Set to true to run in network-policy mode only. + type: boolean routeTableRange: - description: Calico programs additional Linux route tables for various - purposes. RouteTableRange specifies the indices of the route tables - that Calico should use. + description: Deprecated in favor of RouteTableRanges. Calico programs + additional Linux route tables for various purposes. RouteTableRange + specifies the indices of the route tables that Calico should use. properties: max: type: integer @@ -921,6 +1367,21 @@ spec: - max - min type: object + routeTableRanges: + description: Calico programs additional Linux route tables for various + purposes. RouteTableRanges specifies a set of table index ranges + that Calico should use. Deprecates`RouteTableRange`, overrides `RouteTableRange`. + items: + properties: + max: + type: integer + min: + type: integer + required: + - max + - min + type: object + type: array serviceLoopPrevention: description: 'When service IP advertisement is enabled, prevent routing loops to service IPs that are not in use, by dropping or rejecting @@ -948,37 +1409,79 @@ spec: Felix makes reports. [Default: 86400s]' type: string useInternalDataplaneDriver: + description: UseInternalDataplaneDriver, if true, Felix will use its + internal dataplane programming logic. If false, it will launch + an external dataplane driver and communicate with it over protobuf. type: boolean vxlanEnabled: + description: 'VXLANEnabled overrides whether Felix should create the + VXLAN tunnel device for IPv4 VXLAN networking. Optional as Felix + determines this based on the existing IP pools. [Default: nil (unset)]' type: boolean vxlanMTU: - description: 'VXLANMTU is the MTU to set on the tunnel device. See - Configuring MTU [Default: 1440]' + description: 'VXLANMTU is the MTU to set on the IPv4 VXLAN tunnel + device. See Configuring MTU [Default: 1410]' + type: integer + vxlanMTUV6: + description: 'VXLANMTUV6 is the MTU to set on the IPv6 VXLAN tunnel + device. See Configuring MTU [Default: 1390]' type: integer vxlanPort: type: integer vxlanVNI: type: integer wireguardEnabled: - description: 'WireguardEnabled controls whether Wireguard is enabled. + description: 'WireguardEnabled controls whether Wireguard is enabled + for IPv4 (encapsulating IPv4 traffic over an IPv4 underlay network). [Default: false]' type: boolean + wireguardEnabledV6: + description: 'WireguardEnabledV6 controls whether Wireguard is enabled + for IPv6 (encapsulating IPv6 traffic over an IPv6 underlay network). + [Default: false]' + type: boolean + wireguardHostEncryptionEnabled: + description: 'WireguardHostEncryptionEnabled controls whether Wireguard + host-to-host encryption is enabled. [Default: false]' + type: boolean wireguardInterfaceName: description: 'WireguardInterfaceName specifies the name to use for - the Wireguard interface. [Default: wg.calico]' + the IPv4 Wireguard interface. [Default: wireguard.cali]' + type: string + wireguardInterfaceNameV6: + description: 'WireguardInterfaceNameV6 specifies the name to use for + the IPv6 Wireguard interface. [Default: wg-v6.cali]' + type: string + wireguardKeepAlive: + description: 'WireguardKeepAlive controls Wireguard PersistentKeepalive + option. Set 0 to disable. [Default: 0]' type: string wireguardListeningPort: description: 'WireguardListeningPort controls the listening port used - by Wireguard. [Default: 51820]' + by IPv4 Wireguard. [Default: 51820]' + type: integer + wireguardListeningPortV6: + description: 'WireguardListeningPortV6 controls the listening port + used by IPv6 Wireguard. [Default: 51821]' type: integer wireguardMTU: - description: 'WireguardMTU controls the MTU on the Wireguard interface. - See Configuring MTU [Default: 1420]' + description: 'WireguardMTU controls the MTU on the IPv4 Wireguard + interface. See Configuring MTU [Default: 1440]' + type: integer + wireguardMTUV6: + description: 'WireguardMTUV6 controls the MTU on the IPv6 Wireguard + interface. See Configuring MTU [Default: 1420]' type: integer wireguardRoutingRulePriority: description: 'WireguardRoutingRulePriority controls the priority value to use for the Wireguard routing rule. [Default: 99]' type: integer + workloadSourceSpoofing: + description: WorkloadSourceSpoofing controls whether pods can use + the allowedSourcePrefixes annotation to send traffic with a source + IP address that is not theirs. This is disabled by default. When + set to "Any", pods can request any prefix. + type: string xdpEnabled: description: 'XDPEnabled enables XDP acceleration for suitable untracked incoming deny rules. [Default: true]' @@ -999,8 +1502,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -1012,6 +1515,7 @@ spec: listKind: GlobalNetworkPolicyList plural: globalnetworkpolicies singular: globalnetworkpolicy + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -1172,8 +1676,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -1398,8 +1902,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -1545,8 +2049,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -1771,8 +2275,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -1854,8 +2358,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -1867,6 +2371,7 @@ spec: listKind: GlobalNetworkSetList plural: globalnetworksets singular: globalnetworkset + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -1907,8 +2412,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -1920,6 +2425,7 @@ spec: listKind: HostEndpointList plural: hostendpoints singular: hostendpoint + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -2015,8 +2521,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -2028,6 +2534,7 @@ spec: listKind: IPAMBlockList plural: ipamblocks singular: ipamblock + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -2051,8 +2558,16 @@ spec: resource. properties: affinity: + description: Affinity of the block, if this block has one. If set, + it will be of the form "host:". If not set, this block + is not affine to a host. type: string allocations: + description: Array of allocations in-use within this block. nil entries + mean the allocation is free. For non-nil entries at index i, the + index is the ordinal of the allocation within this block and the + value is the index of the associated attributes in the Attributes + array. items: type: integer # TODO: This nullable is manually added in. We should update controller-gen @@ -2060,6 +2575,10 @@ spec: nullable: true type: array attributes: + description: Attributes is an array of arbitrary metadata associated + with allocations in the block. To find attributes for a given allocation, + use the value of the allocation's entry in the Allocations array + as the index of the element in this array. items: properties: handle_id: @@ -2071,12 +2590,38 @@ spec: type: object type: array cidr: + description: The block's CIDR. type: string deleted: + description: Deleted is an internal boolean used to workaround a limitation + in the Kubernetes API whereby deletion will not return a conflict + error if the block has been updated. It should not be set manually. type: boolean + sequenceNumber: + default: 0 + description: We store a sequence number that is updated each time + the block is written. Each allocation will also store the sequence + number of the block at the time of its creation. When releasing + an IP, passing the sequence number associated with the allocation + allows us to protect against a race condition and ensure the IP + hasn't been released and re-allocated since the release request. + format: int64 + type: integer + sequenceNumberForAllocation: + additionalProperties: + format: int64 + type: integer + description: Map of allocated ordinal within the block to sequence + number of the block at the time of allocation. Kubernetes does not + allow numerical keys for maps, so the key is cast to a string. + type: object strictAffinity: + description: StrictAffinity on the IPAMBlock is deprecated and no + longer used by the code. Use IPAMConfig StrictAffinity instead. type: boolean unallocated: + description: Unallocated is an ordered list of allocations which are + free in the block. items: type: integer type: array @@ -2096,8 +2641,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -2109,6 +2654,7 @@ spec: listKind: IPAMConfigList plural: ipamconfigs singular: ipamconfig + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -2136,6 +2682,8 @@ spec: maxBlocksPerHost: description: MaxBlocksPerHost, if non-zero, is the max number of blocks that can be affine to each host. + maximum: 2147483647 + minimum: 0 type: integer strictAffinity: type: boolean @@ -2152,8 +2700,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -2165,6 +2713,7 @@ spec: listKind: IPAMHandleList plural: ipamhandles singular: ipamhandle + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -2208,8 +2757,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -2221,6 +2770,7 @@ spec: listKind: IPPoolList plural: ippools singular: ippool + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -2242,13 +2792,23 @@ spec: spec: description: IPPoolSpec contains the specification for an IPPool resource. properties: + allowedUses: + description: AllowedUse controls what the IP pool will be used for. If + not specified or empty, defaults to ["Tunnel", "Workload"] for back-compatibility + items: + type: string + type: array blockSize: description: The block size to use for IP address assignments from - this pool. Defaults to 26 for IPv4 and 112 for IPv6. + this pool. Defaults to 26 for IPv4 and 122 for IPv6. type: integer cidr: description: The pool CIDR. type: string + disableBGPExport: + description: 'Disable exporting routes from this IP Pool''s CIDR over + BGP. [Default: false]' + type: boolean disabled: description: When disabled is true, Calico IPAM will not assign addresses from this pool. @@ -2282,7 +2842,7 @@ spec: for internal use only.' type: boolean natOutgoing: - description: When nat-outgoing is true, packets sent from Calico networked + description: When natOutgoing is true, packets sent from Calico networked containers in this pool to destinations outside of this pool will be masqueraded. type: boolean @@ -2307,8 +2867,63 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: (devel) + creationTimestamp: null + name: ipreservations.crd.projectcalico.org +spec: + group: crd.projectcalico.org + names: + kind: IPReservation + listKind: IPReservationList + plural: ipreservations + singular: ipreservation + preserveUnknownFields: false + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: IPReservationSpec contains the specification for an IPReservation + resource. + properties: + reservedCIDRs: + description: ReservedCIDRs is a list of CIDRs and/or IP addresses + that Calico IPAM will exclude from new allocations. + items: + type: string + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -2320,6 +2935,7 @@ spec: listKind: KubeControllersConfigurationList plural: kubecontrollersconfigurations singular: kubecontrollersconfiguration + preserveUnknownFields: false scope: Cluster versions: - name: v1 @@ -2410,6 +3026,11 @@ spec: type: string type: object type: object + debugProfilePort: + description: DebugProfilePort configures the port to serve memory + and cpu profiles on. If not specified, profiling is disabled. + format: int32 + type: integer etcdV3CompactionPeriod: description: 'EtcdV3CompactionPeriod is the period between etcdv3 compaction requests. Set to 0 to disable. [Default: 10m]' @@ -2520,6 +3141,11 @@ spec: type: string type: object type: object + debugProfilePort: + description: DebugProfilePort configures the port to serve memory + and cpu profiles on. If not specified, profiling is disabled. + format: int32 + type: integer etcdV3CompactionPeriod: description: 'EtcdV3CompactionPeriod is the period between etcdv3 compaction requests. Set to 0 to disable. [Default: 10m]' @@ -2550,8 +3176,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -2563,6 +3189,7 @@ spec: listKind: NetworkPolicyList plural: networkpolicies singular: networkpolicy + preserveUnknownFields: false scope: Namespaced versions: - name: v1 @@ -2712,8 +3339,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -2938,8 +3565,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -3085,8 +3712,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -3311,8 +3938,8 @@ spec: within the selected service(s) will be matched, and only to/from each endpoint's port. \n Services cannot be specified on the same rule as Selector, NotSelector, NamespaceSelector, - Ports, NotPorts, Nets, NotNets or ServiceAccounts. \n - Only valid on egress rules." + Nets, NotNets or ServiceAccounts. \n Ports and NotPorts + can only be specified with Services on ingress rules." properties: name: description: Name specifies the name of a Kubernetes @@ -3386,8 +4013,8 @@ status: plural: "" conditions: [] storedVersions: [] - --- +# Source: calico/templates/kdd-crds.yaml apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: @@ -3399,6 +4026,7 @@ spec: listKind: NetworkSetList plural: networksets singular: networkset + preserveUnknownFields: false scope: Namespaced versions: - name: v1 @@ -3437,11 +4065,8 @@ status: plural: "" conditions: [] storedVersions: [] - ---- --- # Source: calico/templates/calico-kube-controllers-rbac.yaml - # Include a clusterrole for the kube-controllers component, # and bind it to the calico-kube-controllers serviceaccount. kind: ClusterRole @@ -3465,10 +4090,10 @@ rules: - get - list - watch - # IPAM resources are manipulated when nodes are deleted. + # IPAM resources are manipulated in response to node and block updates, as well as periodic triggers. - apiGroups: ["crd.projectcalico.org"] resources: - - ippools + - ipreservations verbs: - list - apiGroups: ["crd.projectcalico.org"] @@ -3483,6 +4108,13 @@ rules: - update - delete - watch + # Pools are watched to maintain a mapping of blocks to IP pools. + - apiGroups: ["crd.projectcalico.org"] + resources: + - ippools + verbs: + - list + - watch # kube-controllers manages hostendpoints. - apiGroups: ["crd.projectcalico.org"] resources: @@ -3499,8 +4131,10 @@ rules: - clusterinformations verbs: - get + - list - create - update + - watch # KubeControllersConfiguration is where it gets its config - apiGroups: ["crd.projectcalico.org"] resources: @@ -3514,21 +4148,6 @@ rules: - update # watch for changes - watch ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: calico-kube-controllers -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: calico-kube-controllers -subjects: -- kind: ServiceAccount - name: calico-kube-controllers - namespace: kube-system ---- - --- # Source: calico/templates/calico-node-rbac.yaml # Include a clusterrole for the calico-node DaemonSet, @@ -3538,6 +4157,14 @@ apiVersion: rbac.authorization.k8s.io/v1 metadata: name: calico-node rules: + # Used for creating service account tokens to be used by the CNI plugin + - apiGroups: [""] + resources: + - serviceaccounts/token + resourceNames: + - calico-node + verbs: + - create # The CNI plugin needs to get pods, nodes, and namespaces. - apiGroups: [""] resources: @@ -3609,6 +4236,7 @@ rules: - globalbgpconfigs - bgpconfigurations - ippools + - ipreservations - ipamblocks - globalnetworkpolicies - globalnetworksets @@ -3617,6 +4245,7 @@ rules: - clusterinformations - hostendpoints - blockaffinities + - caliconodestatuses verbs: - get - list @@ -3630,6 +4259,12 @@ rules: verbs: - create - update + # Calico must update some CRDs. + - apiGroups: [ "crd.projectcalico.org" ] + resources: + - caliconodestatuses + verbs: + - update # Calico stores some configuration information on the node. - apiGroups: [""] resources: @@ -3659,11 +4294,14 @@ rules: - create - update - delete + # The CNI plugin and calico/node need to be able to create a default + # IPAMConfiguration - apiGroups: ["crd.projectcalico.org"] resources: - ipamconfigs verbs: - get + - create # Block affinities must also be watchable by confd for route aggregation. - apiGroups: ["crd.projectcalico.org"] resources: @@ -3677,8 +4315,22 @@ rules: - daemonsets verbs: - get - --- +# Source: calico/templates/calico-kube-controllers-rbac.yaml +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: calico-kube-controllers +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: calico-kube-controllers +subjects: +- kind: ServiceAccount + name: calico-kube-controllers + namespace: kube-system +--- +# Source: calico/templates/calico-node-rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -3691,7 +4343,6 @@ subjects: - kind: ServiceAccount name: calico-node namespace: kube-system - --- # Source: calico/templates/calico-node.yaml # This manifest installs the calico-node container, as well @@ -3740,6 +4391,7 @@ spec: # upgraded to use calico-ipam. - name: upgrade-ipam image: {{ .BinaryImageName }} + imagePullPolicy: IfNotPresent command: ["/opt/cni/bin/calico-ipam", "-upgrade"] envFrom: - configMapRef: @@ -3767,6 +4419,7 @@ spec: # and CNI network config file on each node. - name: install-cni image: {{ .BinaryImageName }} + imagePullPolicy: IfNotPresent command: ["/opt/cni/bin/install"] envFrom: - configMapRef: @@ -3804,13 +4457,29 @@ spec: name: cni-net-dir securityContext: privileged: true - # Adds a Flex Volume Driver that creates a per-pod Unix Domain Socket to allow Dikastes - # to communicate with Felix over the Policy Sync API. - - name: flexvol-driver - image: {{ .FelixDriverImageName }} + # This init container mounts the necessary filesystems needed by the BPF data plane + # i.e. bpf at /sys/fs/bpf and cgroup2 at /run/calico/cgroup. Calico-node initialisation is executed + # in best effort fashion, i.e. no failure for errors, to not disrupt pod creation in iptable mode. + - name: "mount-bpffs" + image: {{ .DaemonSetImageName }} + imagePullPolicy: IfNotPresent + command: ["calico-node", "-init", "-best-effort"] volumeMounts: - - name: flexvol-driver-host - mountPath: /host/driver + - mountPath: /sys/fs + name: sys-fs + # Bidirectional is required to ensure that the new mount we make at /sys/fs/bpf propagates to the host + # so that it outlives the init container. + mountPropagation: Bidirectional + - mountPath: /var/run/calico + name: var-run-calico + # Bidirectional is required to ensure that the new mount we make at /run/calico/cgroup propagates to the host + # so that it outlives the init container. + mountPropagation: Bidirectional + # Mount /proc/ from host which usually is an init program at /nodeproc. It's needed by mountns binary, + # executed by calico-node, to mount root cgroup2 fs at /run/calico/cgroup to attach CTLB programs correctly. + - mountPath: /nodeproc + name: nodeproc + readOnly: true securityContext: privileged: true containers: @@ -3819,6 +4488,7 @@ spec: # host. - name: calico-node image: {{ .DaemonSetImageName }} + imagePullPolicy: IfNotPresent envFrom: - configMapRef: # Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode. @@ -3854,6 +4524,9 @@ spec: # Enable or Disable VXLAN on the default IP pool. - name: CALICO_IPV4POOL_VXLAN value: "Never" + # Enable or Disable VXLAN on the default IPv6 IP pool. + - name: CALICO_IPV6POOL_VXLAN + value: "Never" # Set MTU for tunnel device used if ipip is enabled - name: FELIX_IPINIPMTU valueFrom: @@ -3893,6 +4566,12 @@ spec: resources: requests: cpu: 250m + lifecycle: + preStop: + exec: + command: + - /bin/calico-node + - -shutdown livenessProbe: exec: command: @@ -3932,11 +4611,8 @@ spec: mountPath: /var/run/nodeagent # For eBPF mode, we need to be able to mount the BPF filesystem at /sys/fs/bpf so we mount in the # parent directory. - - name: sysfs - mountPath: /sys/fs/ - # Bidirectional means that, if we mount the BPF filesystem at /sys/fs/bpf it will propagate to the host. - # If the host is known to mount that filesystem already then Bidirectional can be omitted. - mountPropagation: Bidirectional + - name: bpffs + mountPath: /sys/fs/bpf - name: cni-log-dir mountPath: /var/log/calico/cni readOnly: true @@ -3955,10 +4631,18 @@ spec: hostPath: path: /run/xtables.lock type: FileOrCreate - - name: sysfs + - name: sys-fs hostPath: path: /sys/fs/ type: DirectoryOrCreate + - name: bpffs + hostPath: + path: /sys/fs/bpf + type: Directory + # mount /proc at /nodeproc to be used by mount-bpffs initContainer to mount root cgroup2 fs. + - name: nodeproc + hostPath: + path: /proc # Used to install CNI. - name: cni-bin-dir hostPath: @@ -3981,19 +4665,6 @@ spec: hostPath: type: DirectoryOrCreate path: /var/run/nodeagent - # Used to install Flex Volume Driver - - name: flexvol-driver-host - hostPath: - type: DirectoryOrCreate - path: /usr/libexec/kubernetes/kubelet-plugins/volume/exec/nodeagent~uds ---- - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: calico-node - namespace: kube-system - --- # Source: calico/templates/calico-kube-controllers.yaml # See https://github.com/projectcalico/kube-controllers @@ -4027,11 +4698,14 @@ spec: operator: Exists - key: node-role.kubernetes.io/master effect: NoSchedule + - key: node-role.kubernetes.io/control-plane + effect: NoSchedule serviceAccountName: calico-kube-controllers priorityClassName: system-cluster-critical containers: - name: calico-kube-controllers image: {{ .DeploymentImageName }} + imagePullPolicy: IfNotPresent env: # Choose which controllers to run. - name: ENABLED_CONTROLLERS @@ -4053,38 +4727,3 @@ spec: - /usr/bin/check-status - -r periodSeconds: 10 - ---- - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: calico-kube-controllers - namespace: kube-system - ---- - -# This manifest creates a Pod Disruption Budget for Controller to allow K8s Cluster Autoscaler to evict - -apiVersion: policy/v1{{if .LegacyPodDisruptionBudget}}beta1{{end}} -kind: PodDisruptionBudget -metadata: - name: calico-kube-controllers - namespace: kube-system - labels: - k8s-app: calico-kube-controllers -spec: - maxUnavailable: 1 - selector: - matchLabels: - k8s-app: calico-kube-controllers - ---- -# Source: calico/templates/calico-etcd-secrets.yaml - ---- -# Source: calico/templates/calico-typha.yaml - ---- -# Source: calico/templates/configure-canal.yaml - diff --git a/pkg/minikube/cni/cilium.yaml b/pkg/minikube/cni/cilium.yaml new file mode 100644 index 0000000000..d9a4442c2c --- /dev/null +++ b/pkg/minikube/cni/cilium.yaml @@ -0,0 +1,778 @@ +--- +# Source: cilium/templates/cilium-agent-serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: cilium + namespace: kube-system +--- +# Source: cilium/templates/cilium-operator-serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: cilium-operator + namespace: kube-system +--- +# Source: cilium/templates/cilium-configmap.yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: cilium-config + namespace: kube-system +data: + + # Identity allocation mode selects how identities are shared between cilium + # nodes by setting how they are stored. The options are "crd" or "kvstore". + # - "crd" stores identities in kubernetes as CRDs (custom resource definition). + # These can be queried with: + # kubectl get ciliumid + # - "kvstore" stores identities in a kvstore, etcd or consul, that is + # configured below. Cilium versions before 1.6 supported only the kvstore + # backend. Upgrades from these older cilium versions should continue using + # the kvstore by commenting out the identity-allocation-mode below, or + # setting it to "kvstore". + identity-allocation-mode: crd + cilium-endpoint-gc-interval: "5m0s" + + # If you want to run cilium in debug mode change this value to true + debug: "false" + # The agent can be put into the following three policy enforcement modes + # default, always and never. + # https://docs.cilium.io/en/latest/policy/intro/#policy-enforcement-modes + enable-policy: "default" + + # Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4 + # address. + enable-ipv4: "true" + + # Enable IPv6 addressing. If enabled, all endpoints are allocated an IPv6 + # address. + enable-ipv6: "false" + # Users who wish to specify their own custom CNI configuration file must set + # custom-cni-conf to "true", otherwise Cilium may overwrite the configuration. + custom-cni-conf: "false" + enable-bpf-clock-probe: "true" + # If you want cilium monitor to aggregate tracing for packets, set this level + # to "low", "medium", or "maximum". The higher the level, the less packets + # that will be seen in monitor output. + monitor-aggregation: medium + + # The monitor aggregation interval governs the typical time between monitor + # notification events for each allowed connection. + # + # Only effective when monitor aggregation is set to "medium" or higher. + monitor-aggregation-interval: 5s + + # The monitor aggregation flags determine which TCP flags which, upon the + # first observation, cause monitor notifications to be generated. + # + # Only effective when monitor aggregation is set to "medium" or higher. + monitor-aggregation-flags: all + # Specifies the ratio (0.0-1.0) of total system memory to use for dynamic + # sizing of the TCP CT, non-TCP CT, NAT and policy BPF maps. + bpf-map-dynamic-size-ratio: "0.0025" + # bpf-policy-map-max specifies the maximum number of entries in endpoint + # policy map (per endpoint) + bpf-policy-map-max: "16384" + # bpf-lb-map-max specifies the maximum number of entries in bpf lb service, + # backend and affinity maps. + bpf-lb-map-max: "65536" + # Pre-allocation of map entries allows per-packet latency to be reduced, at + # the expense of up-front memory allocation for the entries in the maps. The + # default value below will minimize memory usage in the default installation; + # users who are sensitive to latency may consider setting this to "true". + # + # This option was introduced in Cilium 1.4. Cilium 1.3 and earlier ignore + # this option and behave as though it is set to "true". + # + # If this value is modified, then during the next Cilium startup the restore + # of existing endpoints and tracking of ongoing connections may be disrupted. + # As a result, reply packets may be dropped and the load-balancing decisions + # for established connections may change. + # + # If this option is set to "false" during an upgrade from 1.3 or earlier to + # 1.4 or later, then it may cause one-time disruptions during the upgrade. + preallocate-bpf-maps: "false" + + # Regular expression matching compatible Istio sidecar istio-proxy + # container image names + sidecar-istio-proxy-image: "cilium/istio_proxy" + + # Name of the cluster. Only relevant when building a mesh of clusters. + cluster-name: cluster + # Unique ID of the cluster. Must be unique across all conneted clusters and + # in the range of 1 and 255. Only relevant when building a mesh of clusters. + cluster-id: "1" + + # Encapsulation mode for communication between nodes + # Possible values: + # - disabled + # - vxlan (default) + # - geneve + tunnel: vxlan + # Enables L7 proxy for L7 policy enforcement and visibility + enable-l7-proxy: "true" + + # wait-bpf-mount makes init container wait until bpf filesystem is mounted + wait-bpf-mount: "false" + + masquerade: "true" + enable-bpf-masquerade: "true" + + enable-xt-socket-fallback: "true" + install-iptables-rules: "true" + + auto-direct-node-routes: "false" + enable-bandwidth-manager: "false" + enable-local-redirect-policy: "false" + kube-proxy-replacement: "probe" + kube-proxy-replacement-healthz-bind-address: "" + enable-health-check-nodeport: "true" + node-port-bind-protection: "true" + enable-auto-protect-node-port-range: "true" + enable-session-affinity: "true" + k8s-require-ipv4-pod-cidr: "true" + k8s-require-ipv6-pod-cidr: "false" + enable-endpoint-health-checking: "true" + enable-health-checking: "true" + enable-well-known-identities: "false" + enable-remote-node-identity: "true" + operator-api-serve-addr: "127.0.0.1:9234" + # Enable Hubble gRPC service. + enable-hubble: "true" + # UNIX domain socket for Hubble server to listen to. + hubble-socket-path: "/var/run/cilium/hubble.sock" + # An additional address for Hubble server to listen to (e.g. ":4244"). + hubble-listen-address: ":4244" + hubble-disable-tls: "false" + hubble-tls-cert-file: /var/lib/cilium/tls/hubble/server.crt + hubble-tls-key-file: /var/lib/cilium/tls/hubble/server.key + hubble-tls-client-ca-files: /var/lib/cilium/tls/hubble/client-ca.crt + ipam: "cluster-pool" + cluster-pool-ipv4-cidr: "{{.PodSubnet }}" + cluster-pool-ipv4-mask-size: "24" + disable-cnp-status-updates: "true" + cgroup-root: "/run/cilium/cgroupv2" +--- +# Source: cilium/templates/cilium-agent-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: cilium +rules: +- apiGroups: + - networking.k8s.io + resources: + - networkpolicies + verbs: + - get + - list + - watch +- apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - namespaces + - services + - nodes + - endpoints + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - pods + - pods/finalizers + verbs: + - get + - list + - watch + - update + - delete +- apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - watch + - update +- apiGroups: + - "" + resources: + - nodes + - nodes/status + verbs: + - patch +- apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + # Deprecated for removal in v1.10 + - create + - list + - watch + - update + + # This is used when validating policies in preflight. This will need to stay + # until we figure out how to avoid "get" inside the preflight, and then + # should be removed ideally. + - get +- apiGroups: + - cilium.io + resources: + - ciliumnetworkpolicies + - ciliumnetworkpolicies/status + - ciliumnetworkpolicies/finalizers + - ciliumclusterwidenetworkpolicies + - ciliumclusterwidenetworkpolicies/status + - ciliumclusterwidenetworkpolicies/finalizers + - ciliumendpoints + - ciliumendpoints/status + - ciliumendpoints/finalizers + - ciliumnodes + - ciliumnodes/status + - ciliumnodes/finalizers + - ciliumidentities + - ciliumidentities/finalizers + - ciliumlocalredirectpolicies + - ciliumlocalredirectpolicies/status + - ciliumlocalredirectpolicies/finalizers + verbs: + - '*' +--- +# Source: cilium/templates/cilium-operator-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: cilium-operator +rules: +- apiGroups: + - "" + resources: + # to automatically delete [core|kube]dns pods so that are starting to being + # managed by Cilium + - pods + verbs: + - get + - list + - watch + - delete + - apiGroups: + - "" + resources: + - nodes + verbs: + - list + - watch +- apiGroups: + - "" + resources: + # To remove node taints + - nodes + # To set NetworkUnavailable false on startup + - nodes/status + verbs: + - patch +- apiGroups: + - discovery.k8s.io + resources: + - endpointslices + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + # to perform the translation of a CNP that contains 'ToGroup' to its endpoints + - services + - endpoints + # to check apiserver connectivity + - namespaces + verbs: + - get + - list + - watch +- apiGroups: + - cilium.io + resources: + - ciliumnetworkpolicies + - ciliumnetworkpolicies/status + - ciliumnetworkpolicies/finalizers + - ciliumclusterwidenetworkpolicies + - ciliumclusterwidenetworkpolicies/status + - ciliumclusterwidenetworkpolicies/finalizers + - ciliumendpoints + - ciliumendpoints/status + - ciliumendpoints/finalizers + - ciliumnodes + - ciliumnodes/status + - ciliumnodes/finalizers + - ciliumidentities + - ciliumidentities/status + - ciliumidentities/finalizers + - ciliumlocalredirectpolicies + - ciliumlocalredirectpolicies/status + - ciliumlocalredirectpolicies/finalizers + verbs: + - '*' +- apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - create + - get + - list + - update + - watch +# For cilium-operator running in HA mode. +# +# Cilium operator running in HA mode requires the use of ResourceLock for Leader Election +# between multiple running instances. +# The preferred way of doing this is to use LeasesResourceLock as edits to Leases are less +# common and fewer objects in the cluster watch "all Leases". +# The support for leases was introduced in coordination.k8s.io/v1 during Kubernetes 1.14 release. +# In Cilium we currently don't support HA mode for K8s version < 1.14. This condition make sure +# that we only authorize access to leases resources in supported K8s versions. +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create + - get + - update +--- +# Source: cilium/templates/cilium-agent-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: cilium +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cilium +subjects: +- kind: ServiceAccount + name: cilium + namespace: kube-system +--- +# Source: cilium/templates/cilium-operator-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: cilium-operator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: cilium-operator +subjects: +- kind: ServiceAccount + name: cilium-operator + namespace: kube-system +--- +# Source: cilium/templates/cilium-agent-daemonset.yaml +apiVersion: apps/v1 +kind: DaemonSet +metadata: + labels: + k8s-app: cilium + name: cilium + namespace: kube-system +spec: + selector: + matchLabels: + k8s-app: cilium + updateStrategy: + rollingUpdate: + maxUnavailable: 2 + type: RollingUpdate + template: + metadata: + annotations: + # This annotation plus the CriticalAddonsOnly toleration makes + # cilium to be a critical pod in the cluster, which ensures cilium + # gets priority scheduling. + # https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/ + scheduler.alpha.kubernetes.io/critical-pod: "" + labels: + k8s-app: cilium + spec: + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: k8s-app + operator: In + values: + - cilium + topologyKey: kubernetes.io/hostname + containers: + - args: + - --config-dir=/tmp/cilium/config-map + command: + - cilium-agent + livenessProbe: + httpGet: + host: '127.0.0.1' + path: /healthz + port: 9879 + scheme: HTTP + httpHeaders: + - name: "brief" + value: "true" + failureThreshold: 10 + # The initial delay for the liveness probe is intentionally large to + # avoid an endless kill & restart cycle if in the event that the initial + # bootstrapping takes longer than expected. + initialDelaySeconds: 120 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 5 + readinessProbe: + httpGet: + host: '127.0.0.1' + path: /healthz + port: 9879 + scheme: HTTP + httpHeaders: + - name: "brief" + value: "true" + failureThreshold: 3 + initialDelaySeconds: 5 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 5 + env: + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: CILIUM_K8S_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: CILIUM_FLANNEL_MASTER_DEVICE + valueFrom: + configMapKeyRef: + key: flannel-master-device + name: cilium-config + optional: true + - name: CILIUM_FLANNEL_UNINSTALL_ON_EXIT + valueFrom: + configMapKeyRef: + key: flannel-uninstall-on-exit + name: cilium-config + optional: true + - name: CILIUM_CLUSTERMESH_CONFIG + value: /var/lib/cilium/clustermesh/ + - name: CILIUM_CNI_CHAINING_MODE + valueFrom: + configMapKeyRef: + key: cni-chaining-mode + name: cilium-config + optional: true + - name: CILIUM_CUSTOM_CNI_CONF + valueFrom: + configMapKeyRef: + key: custom-cni-conf + name: cilium-config + optional: true + image: "quay.io/cilium/cilium:v1.12.3@sha256:30de50c4dc0a1e1077e9e7917a54d5cab253058b3f779822aec00f5c817ca826" + imagePullPolicy: IfNotPresent + lifecycle: + postStart: + exec: + command: + - "/cni-install.sh" + - "--enable-debug=false" + preStop: + exec: + command: + - /cni-uninstall.sh + name: cilium-agent + securityContext: + capabilities: + add: + - NET_ADMIN + - SYS_MODULE + privileged: true + volumeMounts: + - mountPath: /sys/fs/bpf + name: bpf-maps + - mountPath: /var/run/cilium + name: cilium-run + - mountPath: /host/opt/cni/bin + name: cni-path + - mountPath: /host/etc/cni/net.d + name: etc-cni-netd + - mountPath: /var/lib/cilium/clustermesh + name: clustermesh-secrets + readOnly: true + - mountPath: /tmp/cilium/config-map + name: cilium-config-path + readOnly: true + # Needed to be able to load kernel modules + - mountPath: /lib/modules + name: lib-modules + readOnly: true + - mountPath: /run/xtables.lock + name: xtables-lock + - mountPath: /var/lib/cilium/tls/hubble + name: hubble-tls + readOnly: true + hostNetwork: true + initContainers: + # Required to mount cgroup2 filesystem on the underlying Kubernetes node. + # We use nsenter command with host's cgroup and mount namespaces enabled. + - name: mount-cgroup + env: + - name: CGROUP_ROOT + value: /run/cilium/cgroupv2 + - name: BIN_PATH + value: /opt/cni/bin + command: + - sh + - -c + # The statically linked Go program binary is invoked to avoid any + # dependency on utilities like sh and mount that can be missing on certain + # distros installed on the underlying host. Copy the binary to the + # same directory where we install cilium cni plugin so that exec permissions + # are available. + - 'cp /usr/bin/cilium-mount /hostbin/cilium-mount && nsenter --cgroup=/hostproc/1/ns/cgroup --mount=/hostproc/1/ns/mnt "${BIN_PATH}/cilium-mount" $CGROUP_ROOT; rm /hostbin/cilium-mount' + image: "quay.io/cilium/cilium:v1.12.3@sha256:30de50c4dc0a1e1077e9e7917a54d5cab253058b3f779822aec00f5c817ca826" + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /hostproc + name: hostproc + - mountPath: /hostbin + name: cni-path + securityContext: + privileged: true + - command: + - /init-container.sh + env: + - name: CILIUM_ALL_STATE + valueFrom: + configMapKeyRef: + key: clean-cilium-state + name: cilium-config + optional: true + - name: CILIUM_BPF_STATE + valueFrom: + configMapKeyRef: + key: clean-cilium-bpf-state + name: cilium-config + optional: true + - name: CILIUM_WAIT_BPF_MOUNT + valueFrom: + configMapKeyRef: + key: wait-bpf-mount + name: cilium-config + optional: true + image: "quay.io/cilium/cilium:v1.12.3@sha256:30de50c4dc0a1e1077e9e7917a54d5cab253058b3f779822aec00f5c817ca826" + imagePullPolicy: IfNotPresent + name: clean-cilium-state + securityContext: + capabilities: + add: + - NET_ADMIN + privileged: true + volumeMounts: + - mountPath: /sys/fs/bpf + name: bpf-maps + mountPropagation: HostToContainer + # Required to mount cgroup filesystem from the host to cilium agent pod + - mountPath: /run/cilium/cgroupv2 + name: cilium-cgroup + mountPropagation: HostToContainer + - mountPath: /var/run/cilium + name: cilium-run + resources: + requests: + cpu: 100m + memory: 100Mi + restartPolicy: Always + priorityClassName: system-node-critical + serviceAccount: cilium + serviceAccountName: cilium + terminationGracePeriodSeconds: 1 + tolerations: + - operator: Exists + volumes: + # To keep state between restarts / upgrades + - hostPath: + path: /var/run/cilium + type: DirectoryOrCreate + name: cilium-run + # To keep state between restarts / upgrades for bpf maps + - hostPath: + path: /sys/fs/bpf + type: DirectoryOrCreate + name: bpf-maps + # To mount cgroup2 filesystem on the host + - hostPath: + path: /proc + type: Directory + name: hostproc + # To keep state between restarts / upgrades for cgroup2 filesystem + - hostPath: + path: /run/cilium/cgroupv2 + type: DirectoryOrCreate + name: cilium-cgroup + # To install cilium cni plugin in the host + - hostPath: + path: /opt/cni/bin + type: DirectoryOrCreate + name: cni-path + # To install cilium cni configuration in the host + - hostPath: + path: /etc/cni/net.d + type: DirectoryOrCreate + name: etc-cni-netd + # To be able to load kernel modules + - hostPath: + path: /lib/modules + name: lib-modules + # To access iptables concurrently with other processes (e.g. kube-proxy) + - hostPath: + path: /run/xtables.lock + type: FileOrCreate + name: xtables-lock + # To read the clustermesh configuration + - name: clustermesh-secrets + secret: + defaultMode: 420 + optional: true + secretName: cilium-clustermesh + # To read the configuration from the config map + - configMap: + name: cilium-config + name: cilium-config-path + - name: hubble-tls + projected: + sources: + - secret: + name: hubble-server-certs + items: + - key: tls.crt + path: server.crt + - key: tls.key + path: server.key + optional: true + - configMap: + name: hubble-ca-cert + items: + - key: ca.crt + path: client-ca.crt + optional: true +--- +# Source: cilium/templates/cilium-operator-deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + io.cilium/app: operator + name: cilium-operator + name: cilium-operator + namespace: kube-system +spec: + # We support HA mode only for Kubernetes version > 1.14 + # See docs on ServerCapabilities.LeasesResourceLock in file pkg/k8s/version/version.go + # for more details. + replicas: 1 + selector: + matchLabels: + io.cilium/app: operator + name: cilium-operator + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + annotations: + labels: + io.cilium/app: operator + name: cilium-operator + spec: + # In HA mode, cilium-operator pods must not be scheduled on the same + # node as they will clash with each other. + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: io.cilium/app + operator: In + values: + - operator + topologyKey: kubernetes.io/hostname + containers: + - args: + - --config-dir=/tmp/cilium/config-map + - --debug=$(CILIUM_DEBUG) + command: + - cilium-operator-generic + env: + - name: K8S_NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: CILIUM_K8S_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: CILIUM_DEBUG + valueFrom: + configMapKeyRef: + key: debug + name: cilium-config + optional: true + image: "quay.io/cilium/operator-generic:v1.12.3@sha256:816ec1da586139b595eeb31932c61a7c13b07fb4a0255341c0e0f18608e84eff" + imagePullPolicy: IfNotPresent + name: cilium-operator + livenessProbe: + httpGet: + host: '127.0.0.1' + path: /healthz + port: 9234 + scheme: HTTP + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 3 + volumeMounts: + - mountPath: /tmp/cilium/config-map + name: cilium-config-path + readOnly: true + hostNetwork: true + restartPolicy: Always + priorityClassName: system-cluster-critical + serviceAccount: cilium-operator + serviceAccountName: cilium-operator + tolerations: + - operator: Exists + volumes: + # To read the configuration from the config map + - configMap: + name: cilium-config + name: cilium-config-path diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index ca0d767081..efdbab60a2 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -22,6 +22,7 @@ import ( "fmt" "os/exec" "path" + "path/filepath" "time" "github.com/blang/semver/v4" @@ -182,6 +183,17 @@ func manifestAsset(b []byte) assets.CopyableFile { // applyManifest applies a CNI manifest func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) error { + if err := NameLoopback(r); err != nil { + klog.Warningf("unable to name loopback interface in applyManifest: %v", err) + } + + if driver.IsKIC(cc.Driver) { + klog.Info("disabling CRIO bridge for Docker driver ...") + if err := disableCrioBridge(r); err != nil { + klog.Warningf("disabling CRIO bridge for Docker driver: %v", err) + } + } + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() @@ -238,3 +250,33 @@ func configureCNI(cc *config.ClusterConfig, cnm Manager) error { } return nil } + +// NameLoopback ensures loopback has a name in its config file in /etc/cni/net.d +// cri-o is leaving it out atm (https://github.com/cri-o/cri-o/pull/6273) +// avoid errors like: +// Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "..." network for pod "...": networkPlugin cni failed to set up pod "..." network: missing network name:, +// failed to clean up sandbox container "..." network for pod "...": networkPlugin cni failed to teardown pod "..." network: missing network name] +func NameLoopback(r Runner) error { + loopback := "/etc/cni/net.d/*loopback.conf" // usually: 200-loopback.conf + // turn { "cniVersion": "0.3.1", "type": "loopback" } + // into { "cniVersion": "0.3.1", "name": "loopback", "type": "loopback" } + if _, err := r.RunCmd(exec.Command("stat", loopback)); err != nil { + klog.Warningf("%q not found, skipping patching loopback config step: %v", loopback, err) + } else if _, err := r.RunCmd(exec.Command( + "sudo", "find", filepath.Dir(loopback), "-name", filepath.Base(loopback), "-type", "f", "-exec", "sh", "-c", + `grep -q loopback {} && ( grep -q name {} || sed -i '/"type": "loopback"/i \ \ \ \ "name": "loopback",' {} )`, ";")); err != nil { + return fmt.Errorf("unable to patch loopback config %q: %v", loopback, err) + } + return nil +} + +// disableCrioBridge disables cri-o bridge by prefixing its config file in /etc/cni/net.d with "DISABLED" (effectively deprioritising its lexicographical order placement) +func disableCrioBridge(r Runner) error { + conflict := "/etc/cni/net.d/100-crio-bridge.conf" + if _, err := r.RunCmd(exec.Command("stat", conflict)); err != nil { + klog.Warningf("%q not found, skipping disabling cri-o bridge config step: %v", conflict, err) + } else if _, err = r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict)))); err != nil { + return fmt.Errorf("unable to disable cri-o bridge config %q: %v", conflict, err) + } + return nil +} diff --git a/pkg/minikube/cni/flannel.go b/pkg/minikube/cni/flannel.go index b368b1fa8a..c906dafd46 100644 --- a/pkg/minikube/cni/flannel.go +++ b/pkg/minikube/cni/flannel.go @@ -18,634 +18,25 @@ package cni import ( "bytes" - "fmt" + _ "embed" "os/exec" - "path/filepath" "text/template" - "github.com/blang/semver/v4" "github.com/pkg/errors" - "k8s.io/klog/v2" + "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/config" - "k8s.io/minikube/pkg/minikube/driver" - "k8s.io/minikube/pkg/util" ) -// From https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml -var flannelYaml = `---{{if .LegacyPodSecurityPolicy}} -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: psp.flannel.unprivileged - annotations: - seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default - seccomp.security.alpha.kubernetes.io/defaultProfileName: docker/default - apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default - apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default -spec: - privileged: false - volumes: - - configMap - - secret - - emptyDir - - hostPath - allowedHostPaths: - - pathPrefix: "/etc/cni/net.d" - - pathPrefix: "/etc/kube-flannel" - - pathPrefix: "/run/flannel" - readOnlyRootFilesystem: false - # Users and groups - runAsUser: - rule: RunAsAny - supplementalGroups: - rule: RunAsAny - fsGroup: - rule: RunAsAny - # Privilege Escalation - allowPrivilegeEscalation: false - defaultAllowPrivilegeEscalation: false - # Capabilities - allowedCapabilities: ['NET_ADMIN'] - defaultAddCapabilities: [] - requiredDropCapabilities: [] - # Host namespaces - hostPID: false - hostIPC: false - hostNetwork: true - hostPorts: - - min: 0 - max: 65535 - # SELinux - seLinux: - # SELinux is unused in CaaSP - rule: 'RunAsAny'{{else}} -kind: Namespace -apiVersion: v1 -metadata: - name: kube-system - labels: - pod-security.kubernetes.io/enforce: privileged{{end}} ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: flannel -rules:{{if .LegacyPodSecurityPolicy}} - - apiGroups: ['extensions'] - resources: ['podsecuritypolicies'] - verbs: ['use'] - resourceNames: ['psp.flannel.unprivileged']{{end}} - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - apiGroups: - - "" - resources: - - nodes - verbs: - - list - - watch - - apiGroups: - - "" - resources: - - nodes/status - verbs: - - patch ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: flannel -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: flannel -subjects: -- kind: ServiceAccount - name: flannel - namespace: kube-system ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: flannel - namespace: kube-system ---- -kind: ConfigMap -apiVersion: v1 -metadata: - name: kube-flannel-cfg - namespace: kube-system - labels: - tier: node - app: flannel -data: - cni-conf.json: | - { - "name": "cbr0", - "cniVersion": "0.3.1", - "plugins": [ - { - "type": "flannel", - "delegate": { - "hairpinMode": true, - "isDefaultGateway": true - } - }, - { - "type": "portmap", - "capabilities": { - "portMappings": true - } - } - ] - } - net-conf.json: | - { - "Network": "10.244.0.0/16", - "Backend": { - "Type": "vxlan" - } - } ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-amd64 - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - amd64 - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.12.0-amd64 - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.12.0-amd64 - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-arm64 - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - arm64 - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.12.0-arm64 - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.12.0-arm64 - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-arm - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - arm - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.12.0-arm - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.12.0-arm - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-ppc64le - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - ppc64le - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.12.0-ppc64le - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.12.0-ppc64le - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-s390x - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - s390x - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.12.0-s390x - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.12.0-s390x - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg -` +// ref: https://github.com/flannel-io/flannel#deploying-flannel-manually: "For Kubernetes v1.17+"; multi-arch support +//go:embed flannel.yaml +var flannelYaml string + +// https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml var flannelTmpl = template.Must(template.New("flannel").Parse(flannelYaml)) type flannelTmplStruct struct { - LegacyPodSecurityPolicy bool + PodCIDR string } // Flannel is the Flannel CNI manager @@ -666,36 +57,23 @@ func (c Flannel) Apply(r Runner) error { return errors.Wrap(err, "required 'portmap' CNI plug-in not found") } - if driver.IsKIC(c.cc.Driver) { - conflict := "/etc/cni/net.d/100-crio-bridge.conf" - - _, err := r.RunCmd(exec.Command("stat", conflict)) - if err != nil { - klog.Warningf("%s not found, skipping disable step: %v", conflict, err) - return nil - } - - _, err = r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict)))) - if err != nil { - klog.Errorf("unable to disable %s: %v", conflict, err) - } - } - - k8sVersion, err := util.ParseKubernetesVersion(c.cc.KubernetesConfig.KubernetesVersion) + m, err := c.manifest() if err != nil { - return fmt.Errorf("failed to parse Kubernetes version: %v", err) + return errors.Wrap(err, "manifest") } + return applyManifest(c.cc, r, m) +} +// manifest returns a Kubernetes manifest for a CNI +func (c Flannel) manifest() (assets.CopyableFile, error) { input := &flannelTmplStruct{ - LegacyPodSecurityPolicy: k8sVersion.LT(semver.Version{Major: 1, Minor: 25}), + PodCIDR: DefaultPodCIDR, } - b := bytes.Buffer{} if err := flannelTmpl.Execute(&b, input); err != nil { - return err + return nil, err } - - return applyManifest(c.cc, r, manifestAsset(b.Bytes())) + return manifestAsset(b.Bytes()), nil } // CIDR returns the default CIDR used by this CNI diff --git a/pkg/minikube/cni/flannel.yaml b/pkg/minikube/cni/flannel.yaml new file mode 100644 index 0000000000..8b2d071697 --- /dev/null +++ b/pkg/minikube/cni/flannel.yaml @@ -0,0 +1,205 @@ +--- +kind: Namespace +apiVersion: v1 +metadata: + name: kube-flannel + labels: + pod-security.kubernetes.io/enforce: privileged +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: flannel +rules: +- apiGroups: + - "" + resources: + - pods + verbs: + - get +- apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - nodes/status + verbs: + - patch +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: flannel +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: flannel +subjects: +- kind: ServiceAccount + name: flannel + namespace: kube-flannel +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: flannel + namespace: kube-flannel +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: kube-flannel-cfg + namespace: kube-flannel + labels: + tier: node + app: flannel +data: + cni-conf.json: | + { + "name": "cbr0", + "cniVersion": "0.3.1", + "plugins": [ + { + "type": "flannel", + "delegate": { + "hairpinMode": true, + "isDefaultGateway": true + } + }, + { + "type": "portmap", + "capabilities": { + "portMappings": true + } + } + ] + } + net-conf.json: | + { + "Network": "{{ .PodCIDR }}", + "Backend": { + "Type": "vxlan" + } + } +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: kube-flannel-ds + namespace: kube-flannel + labels: + tier: node + app: flannel +spec: + selector: + matchLabels: + app: flannel + template: + metadata: + labels: + tier: node + app: flannel + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + hostNetwork: true + priorityClassName: system-node-critical + tolerations: + - operator: Exists + effect: NoSchedule + serviceAccountName: flannel + initContainers: + - name: install-cni-plugin + #image: flannelcni/flannel-cni-plugin:v1.1.0 for ppc64le and mips64le (dockerhub limitations may apply) + image: docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0 + command: + - cp + args: + - -f + - /flannel + - /opt/cni/bin/flannel + volumeMounts: + - name: cni-plugin + mountPath: /opt/cni/bin + - name: install-cni + #image: flannelcni/flannel:v0.20.2 for ppc64le and mips64le (dockerhub limitations may apply) + image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2 + command: + - cp + args: + - -f + - /etc/kube-flannel/cni-conf.json + - /etc/cni/net.d/10-flannel.conflist + volumeMounts: + - name: cni + mountPath: /etc/cni/net.d + - name: flannel-cfg + mountPath: /etc/kube-flannel/ + containers: + - name: kube-flannel + #image: flannelcni/flannel:v0.20.2 for ppc64le and mips64le (dockerhub limitations may apply) + image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2 + command: + - /opt/bin/flanneld + args: + - --ip-masq + - --kube-subnet-mgr + resources: + requests: + cpu: "100m" + memory: "50Mi" + limits: + cpu: "100m" + memory: "50Mi" + securityContext: + privileged: false + capabilities: + add: ["NET_ADMIN", "NET_RAW"] + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: EVENT_QUEUE_DEPTH + value: "5000" + volumeMounts: + - name: run + mountPath: /run/flannel + - name: flannel-cfg + mountPath: /etc/kube-flannel/ + - name: xtables-lock + mountPath: /run/xtables.lock + volumes: + - name: run + hostPath: + path: /run/flannel + - name: cni-plugin + hostPath: + path: /opt/cni/bin + - name: cni + hostPath: + path: /etc/cni/net.d + - name: flannel-cfg + configMap: + name: kube-flannel-cfg + - name: xtables-lock + hostPath: + path: /run/xtables.lock + type: FileOrCreate diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 0fe4e3f955..a22b865437 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -678,14 +678,15 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri return nil } - args := "" - if networkPlugin == "cni" { - args += " --cni-bin-dir=" + CNIBinDir - args += " --cni-cache-dir=" + CNICacheDir - args += " --cni-conf-dir=" + cni.ConfDir - args += " --hairpin-mode=promiscuous-bridge" + if err := cni.NameLoopback(r.Runner); err != nil { + klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) } + args := " --cni-bin-dir=" + CNIBinDir + args += " --cni-cache-dir=" + CNICacheDir + args += " --cni-conf-dir=" + cni.ConfDir + args += " --hairpin-mode=promiscuous-bridge" + opts := struct { NetworkPlugin string ExtraArguments string diff --git a/pkg/minikube/download/download.go b/pkg/minikube/download/download.go index 83c2c3c862..c726905383 100644 --- a/pkg/minikube/download/download.go +++ b/pkg/minikube/download/download.go @@ -25,7 +25,7 @@ import ( "time" "github.com/hashicorp/go-getter" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" "github.com/pkg/errors" "k8s.io/klog/v2" "k8s.io/minikube/pkg/minikube/detect" @@ -125,6 +125,7 @@ func lockDownload(file string) (mutex.Releaser, error) { go func() { spec := lock.PathMutexSpec(file) + spec.Timeout = 5 * time.Minute releaser, err := mutex.Acquire(spec) if err != nil { lockChannel <- retPair{nil, errors.Wrapf(err, "failed to acquire lock \"%s\": %+v", file, spec)} diff --git a/pkg/minikube/download/iso.go b/pkg/minikube/download/iso.go index fe69ffdf13..626fb206ce 100644 --- a/pkg/minikube/download/iso.go +++ b/pkg/minikube/download/iso.go @@ -26,7 +26,7 @@ import ( "strings" "time" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" "github.com/pkg/errors" "k8s.io/klog/v2" "k8s.io/minikube/pkg/minikube/detect" diff --git a/pkg/minikube/driver/auxdriver/install.go b/pkg/minikube/driver/auxdriver/install.go index 76d1192155..854e9a48b5 100644 --- a/pkg/minikube/driver/auxdriver/install.go +++ b/pkg/minikube/driver/auxdriver/install.go @@ -26,7 +26,7 @@ import ( "time" "github.com/blang/semver/v4" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" "github.com/pkg/errors" "k8s.io/klog/v2" diff --git a/pkg/minikube/image/cache.go b/pkg/minikube/image/cache.go index bf9d72d8eb..58cdc9b78a 100644 --- a/pkg/minikube/image/cache.go +++ b/pkg/minikube/image/cache.go @@ -24,7 +24,7 @@ import ( "github.com/google/go-containerregistry/pkg/name" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1/tarball" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" "github.com/pkg/errors" "golang.org/x/sync/errgroup" "k8s.io/klog/v2" diff --git a/pkg/minikube/kubeconfig/settings.go b/pkg/minikube/kubeconfig/settings.go index da4077e028..f6b4c00ed4 100644 --- a/pkg/minikube/kubeconfig/settings.go +++ b/pkg/minikube/kubeconfig/settings.go @@ -21,7 +21,7 @@ import ( "path/filepath" "sync/atomic" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/clientcmd/api" diff --git a/pkg/minikube/machine/start.go b/pkg/minikube/machine/start.go index 80210f8426..1afad1f1ce 100644 --- a/pkg/minikube/machine/start.go +++ b/pkg/minikube/machine/start.go @@ -33,7 +33,7 @@ import ( "github.com/docker/machine/libmachine/drivers" "github.com/docker/machine/libmachine/engine" "github.com/docker/machine/libmachine/host" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" "github.com/pkg/errors" "github.com/spf13/viper" "k8s.io/klog/v2" diff --git a/pkg/util/lock/lock.go b/pkg/util/lock/lock.go index 84158a2289..efb8dc01b4 100644 --- a/pkg/util/lock/lock.go +++ b/pkg/util/lock/lock.go @@ -23,7 +23,7 @@ import ( "time" "github.com/juju/clock" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" "github.com/pkg/errors" "k8s.io/klog/v2" diff --git a/pkg/util/lock/lock_test.go b/pkg/util/lock/lock_test.go index 8ec94e5f24..e41976b5c2 100644 --- a/pkg/util/lock/lock_test.go +++ b/pkg/util/lock/lock_test.go @@ -19,7 +19,7 @@ package lock import ( "testing" - "github.com/juju/mutex" + "github.com/juju/mutex/v2" ) func TestUserMutexSpec(t *testing.T) { diff --git a/site/content/en/docs/tutorials/includes/kube-flannel.yaml b/site/content/en/docs/tutorials/includes/kube-flannel.yaml deleted file mode 100644 index 9cf5e369fe..0000000000 --- a/site/content/en/docs/tutorials/includes/kube-flannel.yaml +++ /dev/null @@ -1,602 +0,0 @@ ---- -apiVersion: policy/v1beta1 -kind: PodSecurityPolicy -metadata: - name: psp.flannel.unprivileged - annotations: - seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default - seccomp.security.alpha.kubernetes.io/defaultProfileName: docker/default - apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default - apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default -spec: - privileged: false - volumes: - - configMap - - secret - - emptyDir - - hostPath - allowedHostPaths: - - pathPrefix: "/etc/cni/net.d" - - pathPrefix: "/etc/kube-flannel" - - pathPrefix: "/run/flannel" - readOnlyRootFilesystem: false - # Users and groups - runAsUser: - rule: RunAsAny - supplementalGroups: - rule: RunAsAny - fsGroup: - rule: RunAsAny - # Privilege Escalation - allowPrivilegeEscalation: false - defaultAllowPrivilegeEscalation: false - # Capabilities - allowedCapabilities: ['NET_ADMIN'] - defaultAddCapabilities: [] - requiredDropCapabilities: [] - # Host namespaces - hostPID: false - hostIPC: false - hostNetwork: true - hostPorts: - - min: 0 - max: 65535 - # SELinux - seLinux: - # SELinux is unused in CaaSP - rule: 'RunAsAny' ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: flannel -rules: - - apiGroups: ['extensions'] - resources: ['podsecuritypolicies'] - verbs: ['use'] - resourceNames: ['psp.flannel.unprivileged'] - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - apiGroups: - - "" - resources: - - nodes - verbs: - - list - - watch - - apiGroups: - - "" - resources: - - nodes/status - verbs: - - patch ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: flannel -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: flannel -subjects: -- kind: ServiceAccount - name: flannel - namespace: kube-system ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: flannel - namespace: kube-system ---- -kind: ConfigMap -apiVersion: v1 -metadata: - name: kube-flannel-cfg - namespace: kube-system - labels: - tier: node - app: flannel -data: - cni-conf.json: | - { - "name": "cbr0", - "cniVersion": "0.3.1", - "plugins": [ - { - "type": "flannel", - "delegate": { - "hairpinMode": true, - "isDefaultGateway": true - } - }, - { - "type": "portmap", - "capabilities": { - "portMappings": true - } - } - ] - } - net-conf.json: | - { - "Network": "10.244.0.0/16", - "Backend": { - "Type": "vxlan" - } - } ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-amd64 - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - amd64 - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.11.0-amd64 - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.11.0-amd64 - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-arm64 - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - arm64 - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.11.0-arm64 - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.11.0-arm64 - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-arm - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - arm - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.11.0-arm - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.11.0-arm - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-ppc64le - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - ppc64le - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.11.0-ppc64le - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.11.0-ppc64le - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: kube-flannel-ds-s390x - namespace: kube-system - labels: - tier: node - app: flannel -spec: - selector: - matchLabels: - app: flannel - template: - metadata: - labels: - tier: node - app: flannel - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux - - key: kubernetes.io/arch - operator: In - values: - - s390x - hostNetwork: true - tolerations: - - operator: Exists - effect: NoSchedule - serviceAccountName: flannel - initContainers: - - name: install-cni - image: quay.io/coreos/flannel:v0.11.0-s390x - command: - - cp - args: - - -f - - /etc/kube-flannel/cni-conf.json - - /etc/cni/net.d/10-flannel.conflist - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - containers: - - name: kube-flannel - image: quay.io/coreos/flannel:v0.11.0-s390x - command: - - /opt/bin/flanneld - args: - - --ip-masq - - --kube-subnet-mgr - resources: - requests: - cpu: "100m" - memory: "50Mi" - limits: - cpu: "100m" - memory: "50Mi" - securityContext: - privileged: false - capabilities: - add: ["NET_ADMIN"] - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - volumeMounts: - - name: run - mountPath: /run/flannel - - name: flannel-cfg - mountPath: /etc/kube-flannel/ - volumes: - - name: run - hostPath: - path: /run/flannel - - name: cni - hostPath: - path: /etc/cni/net.d - - name: flannel-cfg - configMap: - name: kube-flannel-cfg diff --git a/test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE b/test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/cloud.google.com/go/iam/LICENSE b/test/integration/licenses/cloud.google.com/go/iam/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/cloud.google.com/go/iam/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/cloud.google.com/go/internal/LICENSE b/test/integration/licenses/cloud.google.com/go/internal/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/cloud.google.com/go/internal/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/cloud.google.com/go/storage/LICENSE b/test/integration/licenses/cloud.google.com/go/storage/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/cloud.google.com/go/storage/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/cloud.google.com/go/trace/LICENSE b/test/integration/licenses/cloud.google.com/go/trace/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/cloud.google.com/go/trace/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE b/test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE new file mode 100644 index 0000000000..b0c9bf2b25 --- /dev/null +++ b/test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Swastik Baranwal + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE b/test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE b/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE b/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE b/test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE new file mode 100644 index 0000000000..6d0eb9d5d6 --- /dev/null +++ b/test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2019 TSUYUSATO Kitsune + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE b/test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE new file mode 100644 index 0000000000..4b9986dea7 --- /dev/null +++ b/test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE @@ -0,0 +1,12 @@ +Copyright (c) 2012, Martin Angers +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE b/test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE new file mode 100644 index 0000000000..7448756763 --- /dev/null +++ b/test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/VividCortex/ewma/LICENSE b/test/integration/licenses/github.com/VividCortex/ewma/LICENSE new file mode 100644 index 0000000000..a78d643ed8 --- /dev/null +++ b/test/integration/licenses/github.com/VividCortex/ewma/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2013 VividCortex + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/VividCortex/godaemon/LICENSE b/test/integration/licenses/github.com/VividCortex/godaemon/LICENSE new file mode 100644 index 0000000000..63d89b52d8 --- /dev/null +++ b/test/integration/licenses/github.com/VividCortex/godaemon/LICENSE @@ -0,0 +1,19 @@ + Copyright (c) 2013 VividCortex + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE b/test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt b/test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt b/test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt new file mode 100644 index 0000000000..899129ecc4 --- /dev/null +++ b/test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt @@ -0,0 +1,3 @@ +AWS SDK for Go +Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2014-2015 Stripe, Inc. diff --git a/test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE b/test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE b/test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE new file mode 100644 index 0000000000..aade9a58b1 --- /dev/null +++ b/test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE @@ -0,0 +1,20 @@ +Original version Copyright © 2010 Fazlul Shahriar . Newer +portions Copyright © 2014 Blake Gentry . + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/blang/semver/LICENSE b/test/integration/licenses/github.com/blang/semver/LICENSE new file mode 100644 index 0000000000..5ba5c86fcb --- /dev/null +++ b/test/integration/licenses/github.com/blang/semver/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2014 Benedikt Lang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/test/integration/licenses/github.com/blang/semver/v4/LICENSE b/test/integration/licenses/github.com/blang/semver/v4/LICENSE new file mode 100644 index 0000000000..5ba5c86fcb --- /dev/null +++ b/test/integration/licenses/github.com/blang/semver/v4/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2014 Benedikt Lang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/test/integration/licenses/github.com/briandowns/spinner/LICENSE b/test/integration/licenses/github.com/briandowns/spinner/LICENSE new file mode 100644 index 0000000000..dd5b3a58aa --- /dev/null +++ b/test/integration/licenses/github.com/briandowns/spinner/LICENSE @@ -0,0 +1,174 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE b/test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE new file mode 100644 index 0000000000..89b8179965 --- /dev/null +++ b/test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Cenk Altı + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE b/test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE new file mode 100644 index 0000000000..5119703339 --- /dev/null +++ b/test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE @@ -0,0 +1,12 @@ +Copyright (c) 2012-2015, Sergey Cherepanov +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE b/test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/containerd/containerd/LICENSE b/test/integration/licenses/github.com/containerd/containerd/LICENSE new file mode 100644 index 0000000000..584149b6ee --- /dev/null +++ b/test/integration/licenses/github.com/containerd/containerd/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright The containerd 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 + + https://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. diff --git a/test/integration/licenses/github.com/containerd/containerd/NOTICE b/test/integration/licenses/github.com/containerd/containerd/NOTICE new file mode 100644 index 0000000000..8915f02773 --- /dev/null +++ b/test/integration/licenses/github.com/containerd/containerd/NOTICE @@ -0,0 +1,16 @@ +Docker +Copyright 2012-2015 Docker, Inc. + +This product includes software developed at Docker, Inc. (https://www.docker.com). + +The following is courtesy of our legal counsel: + + +Use and transfer of Docker may be subject to certain restrictions by the +United States and other governments. +It is your responsibility to ensure that your use and/or transfer does not +violate applicable laws. + +For more information, please see https://www.bis.doc.gov + +See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE b/test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE b/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE new file mode 100644 index 0000000000..37ec93a14f --- /dev/null +++ b/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE b/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE new file mode 100644 index 0000000000..23a0ada2fb --- /dev/null +++ b/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE @@ -0,0 +1,5 @@ +CoreOS Project +Copyright 2018 CoreOS, Inc + +This product includes software developed at CoreOS, Inc. +(http://www.coreos.com/). diff --git a/test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE b/test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE new file mode 100644 index 0000000000..bec842f294 --- /dev/null +++ b/test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE @@ -0,0 +1,28 @@ +Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. +Copyright (C) 2017 SUSE LLC. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE b/test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE new file mode 100644 index 0000000000..bc52e96f2b --- /dev/null +++ b/test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2012-2016 Dave Collins + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/test/integration/licenses/github.com/docker/cli/cli/config/LICENSE b/test/integration/licenses/github.com/docker/cli/cli/config/LICENSE new file mode 100644 index 0000000000..9c8e20ab85 --- /dev/null +++ b/test/integration/licenses/github.com/docker/cli/cli/config/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2013-2017 Docker, Inc. + + 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 + + https://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. diff --git a/test/integration/licenses/github.com/docker/cli/cli/config/NOTICE b/test/integration/licenses/github.com/docker/cli/cli/config/NOTICE new file mode 100644 index 0000000000..58b19b6d15 --- /dev/null +++ b/test/integration/licenses/github.com/docker/cli/cli/config/NOTICE @@ -0,0 +1,19 @@ +Docker +Copyright 2012-2017 Docker, Inc. + +This product includes software developed at Docker, Inc. (https://www.docker.com). + +This product contains software (https://github.com/creack/pty) developed +by Keith Rarick, licensed under the MIT License. + +The following is courtesy of our legal counsel: + + +Use and transfer of Docker may be subject to certain restrictions by the +United States and other governments. +It is your responsibility to ensure that your use and/or transfer does not +violate applicable laws. + +For more information, please see https://www.bis.doc.gov + +See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/docker/distribution/LICENSE b/test/integration/licenses/github.com/docker/distribution/LICENSE new file mode 100644 index 0000000000..e06d208186 --- /dev/null +++ b/test/integration/licenses/github.com/docker/distribution/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. + diff --git a/test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE b/test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE new file mode 100644 index 0000000000..1ea555e2af --- /dev/null +++ b/test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2016 David Calavera + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/docker/docker/LICENSE b/test/integration/licenses/github.com/docker/docker/LICENSE new file mode 100644 index 0000000000..6d8d58fb67 --- /dev/null +++ b/test/integration/licenses/github.com/docker/docker/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2013-2018 Docker, Inc. + + 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 + + https://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. diff --git a/test/integration/licenses/github.com/docker/docker/NOTICE b/test/integration/licenses/github.com/docker/docker/NOTICE new file mode 100644 index 0000000000..58b19b6d15 --- /dev/null +++ b/test/integration/licenses/github.com/docker/docker/NOTICE @@ -0,0 +1,19 @@ +Docker +Copyright 2012-2017 Docker, Inc. + +This product includes software developed at Docker, Inc. (https://www.docker.com). + +This product contains software (https://github.com/creack/pty) developed +by Keith Rarick, licensed under the MIT License. + +The following is courtesy of our legal counsel: + + +Use and transfer of Docker may be subject to certain restrictions by the +United States and other governments. +It is your responsibility to ensure that your use and/or transfer does not +violate applicable laws. + +For more information, please see https://www.bis.doc.gov + +See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/docker/go-connections/LICENSE b/test/integration/licenses/github.com/docker/go-connections/LICENSE new file mode 100644 index 0000000000..b55b37bc31 --- /dev/null +++ b/test/integration/licenses/github.com/docker/go-connections/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2015 Docker, Inc. + + 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 + + https://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. diff --git a/test/integration/licenses/github.com/docker/go-units/LICENSE b/test/integration/licenses/github.com/docker/go-units/LICENSE new file mode 100644 index 0000000000..b55b37bc31 --- /dev/null +++ b/test/integration/licenses/github.com/docker/go-units/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2015 Docker, Inc. + + 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 + + https://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. diff --git a/test/integration/licenses/github.com/docker/machine/LICENSE b/test/integration/licenses/github.com/docker/machine/LICENSE new file mode 100644 index 0000000000..27448585ad --- /dev/null +++ b/test/integration/licenses/github.com/docker/machine/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2014 Docker, Inc. + + 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. diff --git a/test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE b/test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE new file mode 100644 index 0000000000..ece7ec61ef --- /dev/null +++ b/test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012,2013 Ernest Micklei + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/fatih/color/LICENSE.md b/test/integration/licenses/github.com/fatih/color/LICENSE.md new file mode 100644 index 0000000000..25fdaf639d --- /dev/null +++ b/test/integration/licenses/github.com/fatih/color/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Fatih Arslan + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE b/test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE new file mode 100644 index 0000000000..e180c8fb05 --- /dev/null +++ b/test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2012-2019 fsnotify Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/go-logr/logr/LICENSE b/test/integration/licenses/github.com/go-logr/logr/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/test/integration/licenses/github.com/go-logr/logr/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff --git a/test/integration/licenses/github.com/go-logr/stdr/LICENSE b/test/integration/licenses/github.com/go-logr/stdr/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/go-logr/stdr/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE b/test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE b/test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/go-openapi/swag/LICENSE b/test/integration/licenses/github.com/go-openapi/swag/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/go-openapi/swag/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/godbus/dbus/v5/LICENSE b/test/integration/licenses/github.com/godbus/dbus/v5/LICENSE new file mode 100644 index 0000000000..670d88fcaa --- /dev/null +++ b/test/integration/licenses/github.com/godbus/dbus/v5/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2013, Georg Reinke (), Google +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/gogo/protobuf/LICENSE b/test/integration/licenses/github.com/gogo/protobuf/LICENSE new file mode 100644 index 0000000000..f57de90da8 --- /dev/null +++ b/test/integration/licenses/github.com/gogo/protobuf/LICENSE @@ -0,0 +1,35 @@ +Copyright (c) 2013, The GoGo Authors. All rights reserved. + +Protocol Buffers for Go with Gadgets + +Go support for Protocol Buffers - Google's data interchange format + +Copyright 2010 The Go Authors. All rights reserved. +https://github.com/golang/protobuf + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/test/integration/licenses/github.com/golang/groupcache/lru/LICENSE b/test/integration/licenses/github.com/golang/groupcache/lru/LICENSE new file mode 100644 index 0000000000..37ec93a14f --- /dev/null +++ b/test/integration/licenses/github.com/golang/groupcache/lru/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/golang/protobuf/LICENSE b/test/integration/licenses/github.com/golang/protobuf/LICENSE new file mode 100644 index 0000000000..0f646931a4 --- /dev/null +++ b/test/integration/licenses/github.com/golang/protobuf/LICENSE @@ -0,0 +1,28 @@ +Copyright 2010 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/test/integration/licenses/github.com/google/gnostic/LICENSE b/test/integration/licenses/github.com/google/gnostic/LICENSE new file mode 100644 index 0000000000..6b0b1270ff --- /dev/null +++ b/test/integration/licenses/github.com/google/gnostic/LICENSE @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + diff --git a/test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE b/test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE new file mode 100644 index 0000000000..32017f8fa1 --- /dev/null +++ b/test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2017 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/google/go-containerregistry/LICENSE b/test/integration/licenses/github.com/google/go-containerregistry/LICENSE new file mode 100644 index 0000000000..7a4a3ea242 --- /dev/null +++ b/test/integration/licenses/github.com/google/go-containerregistry/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. \ No newline at end of file diff --git a/test/integration/licenses/github.com/google/go-github/v43/github/LICENSE b/test/integration/licenses/github.com/google/go-github/v43/github/LICENSE new file mode 100644 index 0000000000..28b6486f0b --- /dev/null +++ b/test/integration/licenses/github.com/google/go-github/v43/github/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013 The go-github AUTHORS. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/google/go-querystring/query/LICENSE b/test/integration/licenses/github.com/google/go-querystring/query/LICENSE new file mode 100644 index 0000000000..ae121a1e46 --- /dev/null +++ b/test/integration/licenses/github.com/google/go-querystring/query/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013 Google. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/google/gofuzz/LICENSE b/test/integration/licenses/github.com/google/gofuzz/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/google/gofuzz/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE b/test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/google/uuid/LICENSE b/test/integration/licenses/github.com/google/uuid/LICENSE new file mode 100644 index 0000000000..5dc68268d9 --- /dev/null +++ b/test/integration/licenses/github.com/google/uuid/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009,2014 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE b/test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE b/test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE new file mode 100644 index 0000000000..6d16b6578a --- /dev/null +++ b/test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE @@ -0,0 +1,27 @@ +Copyright 2016, Google Inc. +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/gookit/color/LICENSE b/test/integration/licenses/github.com/gookit/color/LICENSE new file mode 100644 index 0000000000..d839cdc1ad --- /dev/null +++ b/test/integration/licenses/github.com/gookit/color/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2016 inhere + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE new file mode 100644 index 0000000000..e87a115e46 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE @@ -0,0 +1,363 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the terms of + a Secondary License. + +1.6. "Executable Form" + + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a + separate file or files, that is not Covered Software. + +1.8. "License" + + means this document. + +1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether + at the time of the initial grant or subsequently, any and all of the + rights conveyed by this License. + +1.10. "Modifications" + + means any of the following: + + a. any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the License, + by the making, using, selling, offering for sale, having made, import, + or transfer of either its Contributions or its Contributor Version. + +1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution + become effective for each Contribution on the date the Contributor first + distributes such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under + this License. No additional rights or licenses will be implied from the + distribution or licensing of Covered Software under this License. + Notwithstanding Section 2.1(b) above, no patent license is granted by a + Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of + its Contributions. + + This License does not grant any rights in the trademarks, service marks, + or logos of any Contributor (except as may be necessary to comply with + the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this + License (see Section 10.2) or under the terms of a Secondary License (if + permitted under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its + Contributions are its original creation(s) or it has sufficient rights to + grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under + applicable copyright doctrines of fair use, fair dealing, or other + equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under + the terms of this License. You must inform recipients that the Source + Code Form of the Covered Software is governed by the terms of this + License, and how they can obtain a copy of this License. You may not + attempt to alter or restrict the recipients' rights in the Source Code + Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter the + recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for + the Covered Software. If the Larger Work is a combination of Covered + Software with a work governed by one or more Secondary Licenses, and the + Covered Software is not Incompatible With Secondary Licenses, this + License permits You to additionally distribute such Covered Software + under the terms of such Secondary License(s), so that the recipient of + the Larger Work may, at their option, further distribute the Covered + Software under the terms of either this License or such Secondary + License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices + (including copyright notices, patent notices, disclaimers of warranty, or + limitations of liability) contained within the Source Code Form of the + Covered Software, except that You may alter any license notices to the + extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on + behalf of any Contributor. You must make it absolutely clear that any + such warranty, support, indemnity, or liability obligation is offered by + You alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, + judicial order, or regulation then You must: (a) comply with the terms of + this License to the maximum extent possible; and (b) describe the + limitations and the code they affect. Such description must be placed in a + text file included with all distributions of the Covered Software under + this License. Except to the extent prohibited by statute or regulation, + such description must be sufficiently detailed for a recipient of ordinary + skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing + basis, if such Contributor fails to notify You of the non-compliance by + some reasonable means prior to 60 days after You have come back into + compliance. Moreover, Your grants from a particular Contributor are + reinstated on an ongoing basis if such Contributor notifies You of the + non-compliance by some reasonable means, this is the first time You have + received notice of non-compliance with this License from such + Contributor, and You become compliant prior to 30 days after Your receipt + of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, + counter-claims, and cross-claims) alleging that a Contributor Version + directly or indirectly infringes any patent, then the rights granted to + You by any and all Contributors for the Covered Software under Section + 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, + without warranty of any kind, either expressed, implied, or statutory, + including, without limitation, warranties that the Covered Software is free + of defects, merchantable, fit for a particular purpose or non-infringing. + The entire risk as to the quality and performance of the Covered Software + is with You. Should any Covered Software prove defective in any respect, + You (not any Contributor) assume the cost of any necessary servicing, + repair, or correction. This disclaimer of warranty constitutes an essential + part of this License. No use of any Covered Software is authorized under + this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from + such party's negligence to the extent applicable law prohibits such + limitation. Some jurisdictions do not allow the exclusion or limitation of + incidental or consequential damages, so this exclusion and limitation may + not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts + of a jurisdiction where the defendant maintains its principal place of + business and such litigation shall be governed by laws of that + jurisdiction, without reference to its conflict-of-law provisions. Nothing + in this Section shall prevent a party's ability to bring cross-claims or + counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. Any law or regulation which provides that + the language of a contract shall be construed against the drafter shall not + be used to construe this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version + of the License under which You originally received the Covered Software, + or under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a + modified version of this License if you rename the license and remove + any references to the name of the license steward (except to note that + such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses If You choose to distribute Source Code Form that is + Incompatible With Secondary Licenses under the terms of this version of + the License, the notice described in Exhibit B of this License must be + attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, +then You may include the notice in a location (such as a LICENSE file in a +relevant directory) where a recipient would be likely to look for such a +notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible + With Secondary Licenses", as defined by + the Mozilla Public License, v. 2.0. + diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md new file mode 100644 index 0000000000..036e5313fc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md @@ -0,0 +1,30 @@ +# cleanhttp + +Functions for accessing "clean" Go http.Client values + +------------- + +The Go standard library contains a default `http.Client` called +`http.DefaultClient`. It is a common idiom in Go code to start with +`http.DefaultClient` and tweak it as necessary, and in fact, this is +encouraged; from the `http` package documentation: + +> The Client's Transport typically has internal state (cached TCP connections), +so Clients should be reused instead of created as needed. Clients are safe for +concurrent use by multiple goroutines. + +Unfortunately, this is a shared value, and it is not uncommon for libraries to +assume that they are free to modify it at will. With enough dependencies, it +can be very easy to encounter strange problems and race conditions due to +manipulation of this shared value across libraries and goroutines (clients are +safe for concurrent use, but writing values to the client struct itself is not +protected). + +Making things worse is the fact that a bare `http.Client` will use a default +`http.Transport` called `http.DefaultTransport`, which is another global value +that behaves the same way. So it is not simply enough to replace +`http.DefaultClient` with `&http.Client{}`. + +This repository provides some simple functions to get a "clean" `http.Client` +-- one that uses the same default values as the Go standard library, but +returns a client that does not share any state with other clients. diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go new file mode 100644 index 0000000000..fe28d15b6f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go @@ -0,0 +1,58 @@ +package cleanhttp + +import ( + "net" + "net/http" + "runtime" + "time" +) + +// DefaultTransport returns a new http.Transport with similar default values to +// http.DefaultTransport, but with idle connections and keepalives disabled. +func DefaultTransport() *http.Transport { + transport := DefaultPooledTransport() + transport.DisableKeepAlives = true + transport.MaxIdleConnsPerHost = -1 + return transport +} + +// DefaultPooledTransport returns a new http.Transport with similar default +// values to http.DefaultTransport. Do not use this for transient transports as +// it can leak file descriptors over time. Only use this for transports that +// will be re-used for the same host(s). +func DefaultPooledTransport() *http.Transport { + transport := &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + ForceAttemptHTTP2: true, + MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1, + } + return transport +} + +// DefaultClient returns a new http.Client with similar default values to +// http.Client, but with a non-shared Transport, idle connections disabled, and +// keepalives disabled. +func DefaultClient() *http.Client { + return &http.Client{ + Transport: DefaultTransport(), + } +} + +// DefaultPooledClient returns a new http.Client with similar default values to +// http.Client, but with a shared Transport. Do not use this function for +// transient clients as it can leak file descriptors over time. Only use this +// for clients that will be re-used for the same host(s). +func DefaultPooledClient() *http.Client { + return &http.Client{ + Transport: DefaultPooledTransport(), + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go new file mode 100644 index 0000000000..05841092a7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go @@ -0,0 +1,20 @@ +// Package cleanhttp offers convenience utilities for acquiring "clean" +// http.Transport and http.Client structs. +// +// Values set on http.DefaultClient and http.DefaultTransport affect all +// callers. This can have detrimental effects, esepcially in TLS contexts, +// where client or root certificates set to talk to multiple endpoints can end +// up displacing each other, leading to hard-to-debug issues. This package +// provides non-shared http.Client and http.Transport structs to ensure that +// the configuration will not be overwritten by other parts of the application +// or dependencies. +// +// The DefaultClient and DefaultTransport functions disable idle connections +// and keepalives. Without ensuring that idle connections are closed before +// garbage collection, short-term clients/transports can leak file descriptors, +// eventually leading to "too many open files" errors. If you will be +// connecting to the same hosts repeatedly from the same client, you can use +// DefaultPooledClient to receive a client that has connection pooling +// semantics similar to http.DefaultClient. +// +package cleanhttp diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod new file mode 100644 index 0000000000..005ccdef9c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod @@ -0,0 +1,3 @@ +module github.com/hashicorp/go-cleanhttp + +go 1.13 diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go new file mode 100644 index 0000000000..3c845dc0dc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go @@ -0,0 +1,48 @@ +package cleanhttp + +import ( + "net/http" + "strings" + "unicode" +) + +// HandlerInput provides input options to cleanhttp's handlers +type HandlerInput struct { + ErrStatus int +} + +// PrintablePathCheckHandler is a middleware that ensures the request path +// contains only printable runes. +func PrintablePathCheckHandler(next http.Handler, input *HandlerInput) http.Handler { + // Nil-check on input to make it optional + if input == nil { + input = &HandlerInput{ + ErrStatus: http.StatusBadRequest, + } + } + + // Default to http.StatusBadRequest on error + if input.ErrStatus == 0 { + input.ErrStatus = http.StatusBadRequest + } + + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r != nil { + // Check URL path for non-printable characters + idx := strings.IndexFunc(r.URL.Path, func(c rune) bool { + return !unicode.IsPrint(c) + }) + + if idx != -1 { + w.WriteHeader(input.ErrStatus) + return + } + + if next != nil { + next.ServeHTTP(w, r) + } + } + + return + }) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go new file mode 100644 index 0000000000..a22e84a4a7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go @@ -0,0 +1,72 @@ +package cleanhttp + +import ( + "fmt" + "net/http" + "net/http/httptest" + "testing" +) + +func TestPrintablePathCheckHandler(t *testing.T) { + getTestHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, "Hello, client") + }) + + cases := map[string]struct { + path string + expectCode int + input *HandlerInput + }{ + "valid nil input": { + path: "/valid", + expectCode: http.StatusOK, + input: nil, + }, + + "valid empty error status": { + path: "/valid", + expectCode: http.StatusOK, + input: &HandlerInput{}, + }, + + "invalid newline": { + path: "/invalid%0A", + expectCode: http.StatusBadRequest, + }, + + "invalid carriage return": { + path: "/invalid%0D", + expectCode: http.StatusBadRequest, + }, + + "invalid null": { + path: "/invalid%00", + expectCode: http.StatusBadRequest, + }, + + "invalid alternate status": { + path: "/invalid%0A", + expectCode: http.StatusInternalServerError, + input: &HandlerInput{ + ErrStatus: http.StatusInternalServerError, + }, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + // Create test HTTP server + ts := httptest.NewServer(PrintablePathCheckHandler(getTestHandler, tc.input)) + defer ts.Close() + + res, err := http.Get(ts.URL + tc.path) + if err != nil { + t.Fatal(err) + } + + if tc.expectCode != res.StatusCode { + t.Fatalf("expected %d, got :%d", tc.expectCode, res.StatusCode) + } + }) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml new file mode 100644 index 0000000000..fa84635452 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml @@ -0,0 +1,176 @@ +version: 2.1 + +orbs: + win: circleci/windows@2.2.0 + +references: + environment: &ENVIRONMENT + TEST_RESULTS_PATH: &TEST_RESULTS_PATH /tmp/test-results + WIN_TEST_RESULTS: &WIN_TEST_RESULTS c:\Users\circleci\AppData\Local\Temp\test-results + +commands: + run-gotests: + parameters: + cmd: + type: string + platform: + type: string + govet: + type: string + default: "" + steps: + - run: + name: "Run go tests" + command: | + PACKAGE_NAMES=$(go list ./... | circleci tests split --split-by=timings --timings-type=classname) + echo "Running $(echo $PACKAGE_NAMES | wc -w) packages" + echo $PACKAGE_NAMES + << parameters.cmd >> --format=short-verbose --junitfile $TEST_RESULTS_PATH/go-getter/gotestsum-report.xml -- -p 2 -cover -race -vet=<< parameters.govet >> -coverprofile=<< parameters.platform >>_cov_$CIRCLE_NODE_INDEX.part $PACKAGE_NAMES + +jobs: + linux-tests: + docker: + - image: docker.mirror.hashicorp.services/circleci/golang:<< parameters.go-version >> + parameters: + go-version: + type: string + environment: + <<: *ENVIRONMENT + parallelism: 4 + steps: + - run: go version + - checkout + - attach_workspace: + at: . + - run: mkdir -p $TEST_RESULTS_PATH/go-getter + + # Restore go module cache if there is one + - restore_cache: + keys: + - linux-gomod-cache-v1-{{ checksum "go.mod" }} + + - run: go mod download + + # Save go module cache if the go.mod file has changed + - save_cache: + key: linux-gomod-cache-v1-{{ checksum "go.mod" }} + paths: + - "/go/pkg/mod" + + # Check go fmt output because it does not report non-zero when there are fmt changes + - run: + name: check go fmt + command: | + files=$(go fmt ./...) + if [ -n "$files" ]; then + echo "The following file(s) do not conform to go fmt:" + echo "$files" + exit 1 + fi + + # Run go tests with gotestsum + - run-gotests: + cmd: "gotestsum" + platform: "linux" + + # Save coverage report parts + - persist_to_workspace: + root: . + paths: + - linux_cov_*.part + + - store_test_results: + path: *TEST_RESULTS_PATH + - store_artifacts: + path: *TEST_RESULTS_PATH + + windows-tests: + executor: + name: win/default + shell: bash --login -eo pipefail + environment: + <<: *ENVIRONMENT + working_directory: c:\gopath\src\github.com\hashicorp\go-getter + parameters: + go-version: + type: string + gotestsum-version: + type: string + steps: + - run: git config --global core.autocrlf false + - checkout + - attach_workspace: + at: . + - run: + name: Setup (remove pre-installed go) + command: | + rm -rf "c:\Go" + mkdir -p $TEST_RESULTS_PATH/go-getter + + - restore_cache: + keys: + - win-golang-<< parameters.go-version >>-cache-v1 + - win-gomod-cache-{{ checksum "go.mod" }}-v1 + + - run: + name: Install go version << parameters.go-version >> + command: | + if [ ! -d "c:\go" ]; then + echo "Cache not found, installing new version of go" + curl --fail --location https://dl.google.com/go/go<< parameters.go-version >>.windows-amd64.zip --output go.zip + unzip go.zip -d "/c" + fi + + - run: + command: go mod download + + - save_cache: + key: win-golang-<< parameters.go-version >>-cache-v1 + paths: + - /go + + - save_cache: + key: win-gomod-cache-{{ checksum "go.mod" }}-v1 + paths: + - c:\Windows\system32\config\systemprofile\go\pkg\mod + + - run: + name: Install gotestsum + command: | + curl --fail --location https://github.com/gotestyourself/gotestsum/releases/download/v<< parameters.gotestsum-version >>/gotestsum_<< parameters.gotestsum-version >>_windows_amd64.tar.gz --output gotestsum.tar.gz + tar -xvzf gotestsum.tar.gz + + - run-gotests: + cmd: "./gotestsum.exe" + platform: "win" + # Otherwise gcc is required for race detector + # See https://github.com/golang/go/issues/27089 + govet: "off" + + # Save coverage report parts + - persist_to_workspace: + root: . + paths: + - win_cov_*.part + + - store_test_results: + path: *WIN_TEST_RESULTS + - store_artifacts: + path: *WIN_TEST_RESULTS + +workflows: + go-getter: + jobs: + - linux-tests: + context: go-getter + matrix: + parameters: + go-version: ["1.15.13", "1.14.15"] + name: linux-test-go-<< matrix.go-version >> + - windows-tests: + context: go-getter + matrix: + parameters: + go-version: ["1.15.13", "1.14.15"] + gotestsum-version: ["0.4.1"] + name: win-test-go-<< matrix.go-version >> diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..dfe6e4fd91 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml @@ -0,0 +1,50 @@ +name: "Code scanning - scheduled (weekly) or on-demand" + +on: + schedule: + - cron: '0 15 * * 0' + workflow_dispatch: + +jobs: + CodeQL-Build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + with: + languages: go + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + # - name: Autobuild + # uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml new file mode 100644 index 0000000000..295c9196de --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml @@ -0,0 +1,78 @@ +### This builds, packages, signs, performs AV and malware scanning, and +### creates a new GitHub release for the newest version of go-getter. +### The GitHub release step performs the actions outlined in +### release.goreleaser.yml. A release is triggered when a new tag +### is pushed in the format vX.X.X + +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup go + uses: actions/setup-go@v2 + with: + go-version: '^1.15' + - name: Setup signore + uses: hashicorp/setup-signore@v1 + with: + github-token: ${{secrets.SIGNORE_TOKEN}} + - name: Install hc-codesign + id: codesign + run: | + docker login docker.pkg.github.com -u docker -p $GITHUB_TOKEN && \ + docker pull docker.pkg.github.com/hashicorp/hc-codesign/hc-codesign:$VERSION && \ + echo "::set-output name=image::docker.pkg.github.com/hashicorp/hc-codesign/hc-codesign:$VERSION" + env: + VERSION: v0 + GITHUB_TOKEN: ${{ secrets.CODESIGN_GITHUB_TOKEN }} + - name: Install wget & clamAV antivirus scanner + run : | + sudo apt-get update + sudo apt-get -qq install -y ca-certificates wget clamav + wget --version + - name: Install maldet malware scanner + run: | + wget --no-verbose -O maldet-$VERSION.tar.gz https://github.com/rfxn/linux-malware-detect/archive/$VERSION.tar.gz + sha256sum -c - <<< "$SHA256SUM maldet-$VERSION.tar.gz" + sudo mkdir -p maldet-$VERSION + sudo tar -xzf maldet-$VERSION.tar.gz --strip-components=1 -C maldet-$VERSION + cd maldet-$VERSION + sudo ./install.sh + sudo maldet -u + env: + VERSION: 1.6.4 + SHA256SUM: 3ad66eebd443d32dd6c811dcf2d264b78678c75ed1d40c15434180d4453e60d2 + - name: GitHub Release + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --skip-validate --timeout "60m" + env: + PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }} + CODESIGN_IMAGE: ${{ steps.codesign.outputs.image }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} + SIGNORE_SIGNER: ${{secrets.SIGNORE_SIGNER}} + SIGNORE_CLIENT_ID: ${{secrets.SIGNORE_CLIENT_ID}} + SIGNORE_CLIENT_SECRET: ${{secrets.SIGNORE_CLIENT_SECRET}} + - name: Run clamAV antivirus scanner + run: sudo clamscan /home/runner/work/$REPO/$REPO/dist/ + env: + REPO: ${{ github.event.repository.name }} + - name: Run maldet malware scanner + run: sudo maldet -a /home/runner/work/$REPO/$REPO/dist/ + env: + REPO: ${{ github.event.repository.name }} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.gitignore b/test/integration/licenses/github.com/hashicorp/go-getter/.gitignore new file mode 100644 index 0000000000..511ca2675b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/.gitignore @@ -0,0 +1 @@ +cmd/go-getter/go-getter diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml new file mode 100644 index 0000000000..975b5f697c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml @@ -0,0 +1,58 @@ +env: + - GOPRIVATE=github.com/hashicorp + +builds: + - id: signable + mod_timestamp: '{{ .CommitTimestamp }}' + targets: + - darwin_amd64 + - windows_386 + - windows_amd64 + hooks: + post: | + docker run + -e ARTIFACTORY_TOKEN={{ .Env.ARTIFACTORY_TOKEN }} + -e ARTIFACTORY_USER={{ .Env.ARTIFACTORY_USER }} + -e CIRCLE_TOKEN={{ .Env.CIRCLE_TOKEN }} + -v {{ dir .Path }}:/workdir + {{ .Env.CODESIGN_IMAGE }} + sign -product-name={{ .ProjectName }} {{ .Name }} + dir: ./cmd/go-getter/ + flags: + - -trimpath + ldflags: + - -X main.GitCommit={{ .Commit }} + - mod_timestamp: '{{ .CommitTimestamp }}' + targets: + - linux_386 + - linux_amd64 + dir: ./cmd/go-getter/ + flags: + - -trimpath + ldflags: + - -X main.GitCommit={{ .Commit }} + +archives: + - format: zip + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - none* + +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 + +signs: + - signature: ${artifact}.sig + cmd: sh + args: + - -c + - >- + signore + sign + --file ${artifact} + --out ${signature} + artifacts: checksum + +changelog: + skip: true diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/LICENSE b/test/integration/licenses/github.com/hashicorp/go-getter/LICENSE new file mode 100644 index 0000000000..c33dcc7c92 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/README.md b/test/integration/licenses/github.com/hashicorp/go-getter/README.md new file mode 100644 index 0000000000..dc9ac260e7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/README.md @@ -0,0 +1,448 @@ +# go-getter + +[![CircleCI](https://circleci.com/gh/hashicorp/go-getter/tree/main.svg?style=svg)][circleci] +[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] + +[circleci]: https://circleci.com/gh/hashicorp/go-getter/tree/main +[godocs]: http://godoc.org/github.com/hashicorp/go-getter + +go-getter is a library for Go (golang) for downloading files or directories +from various sources using a URL as the primary form of input. + +The power of this library is being flexible in being able to download +from a number of different sources (file paths, Git, HTTP, Mercurial, etc.) +using a single string as input. This removes the burden of knowing how to +download from a variety of sources from the implementer. + +The concept of a _detector_ automatically turns invalid URLs into proper +URLs. For example: "github.com/hashicorp/go-getter" would turn into a +Git URL. Or "./foo" would turn into a file URL. These are extensible. + +This library is used by [Terraform](https://terraform.io) for +downloading modules and [Nomad](https://nomadproject.io) for downloading +binaries. + +## Installation and Usage + +Package documentation can be found on +[GoDoc](http://godoc.org/github.com/hashicorp/go-getter). + +Installation can be done with a normal `go get`: + +``` +$ go get github.com/hashicorp/go-getter +``` + +go-getter also has a command you can use to test URL strings: + +``` +$ go install github.com/hashicorp/go-getter/cmd/go-getter +... + +$ go-getter github.com/foo/bar ./foo +... +``` + +The command is useful for verifying URL structures. + +## Security +Fetching resources from user-supplied URLs is an inherently dangerous operation and may +leave your application vulnerable to [server side request forgery](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery), +[path traversal](https://owasp.org/www-community/attacks/Path_Traversal), [denial of service](https://owasp.org/www-community/attacks/Denial_of_Service) +or other security flaws. + +go-getter contains mitigations for some of these security issues, but should still be used with +caution in security-critical contexts. See the available [security options](#Security-Options) that +can be configured to mitigate some of these risks. +## URL Format + +go-getter uses a single string URL as input to download from a variety of +protocols. go-getter has various "tricks" with this URL to do certain things. +This section documents the URL format. + +### Supported Protocols and Detectors + +**Protocols** are used to download files/directories using a specific +mechanism. Example protocols are Git and HTTP. + +**Detectors** are used to transform a valid or invalid URL into another +URL if it matches a certain pattern. Example: "github.com/user/repo" is +automatically transformed into a fully valid Git URL. This allows go-getter +to be very user friendly. + +go-getter out of the box supports the following protocols. Additional protocols +can be augmented at runtime by implementing the `Getter` interface. + + * Local files + * Git + * Mercurial + * HTTP + * Amazon S3 + * Google GCP + +In addition to the above protocols, go-getter has what are called "detectors." +These take a URL and attempt to automatically choose the best protocol for +it, which might involve even changing the protocol. The following detection +is built-in by default: + + * File paths such as "./foo" are automatically changed to absolute + file URLs. + * GitHub URLs, such as "github.com/mitchellh/vagrant" are automatically + changed to Git protocol over HTTP. + * GitLab URLs, such as "gitlab.com/inkscape/inkscape" are automatically + changed to Git protocol over HTTP. + * BitBucket URLs, such as "bitbucket.org/mitchellh/vagrant" are automatically + changed to a Git or mercurial protocol using the BitBucket API. + +### Forced Protocol + +In some cases, the protocol to use is ambiguous depending on the source +URL. For example, "http://github.com/mitchellh/vagrant.git" could reference +an HTTP URL or a Git URL. Forced protocol syntax is used to disambiguate this +URL. + +Forced protocol can be done by prefixing the URL with the protocol followed +by double colons. For example: `git::http://github.com/mitchellh/vagrant.git` +would download the given HTTP URL using the Git protocol. + +Forced protocols will also override any detectors. + +In the absence of a forced protocol, detectors may be run on the URL, transforming +the protocol anyways. The above example would've used the Git protocol either +way since the Git detector would've detected it was a GitHub URL. + +### Protocol-Specific Options + +Each protocol can support protocol-specific options to configure that +protocol. For example, the `git` protocol supports specifying a `ref` +query parameter that tells it what ref to checkout for that Git +repository. + +The options are specified as query parameters on the URL (or URL-like string) +given to go-getter. Using the Git example above, the URL below is a valid +input to go-getter: + + github.com/hashicorp/go-getter?ref=abcd1234 + +The protocol-specific options are documented below the URL format +section. But because they are part of the URL, we point it out here so +you know they exist. + +### Subdirectories + +If you want to download only a specific subdirectory from a downloaded +directory, you can specify a subdirectory after a double-slash `//`. +go-getter will first download the URL specified _before_ the double-slash +(as if you didn't specify a double-slash), but will then copy the +path after the double slash into the target directory. + +For example, if you're downloading this GitHub repository, but you only +want to download the `testdata` directory, you can do the following: + +``` +https://github.com/hashicorp/go-getter.git//testdata +``` + +If you downloaded this to the `/tmp` directory, then the file +`/tmp/archive.gz` would exist. Notice that this file is in the `testdata` +directory in this repository, but because we specified a subdirectory, +go-getter automatically copied only that directory contents. + +Subdirectory paths may also use filesystem glob patterns. The path must +match _exactly one_ entry or go-getter will return an error. +This is useful if you're not sure the exact directory name but it follows +a predictable naming structure. + +For example, the following URL would also work: + +``` +https://github.com/hashicorp/go-getter.git//test-* +``` + +### Checksumming + +For file downloads of any protocol, go-getter can automatically verify +a checksum for you. Note that checksumming only works for downloading files, +not directories, but checksumming will work for any protocol. + +To checksum a file, append a `checksum` query parameter to the URL. go-getter +will parse out this query parameter automatically and use it to verify the +checksum. The parameter value can be in the format of `type:value` or just +`value`, where type is "md5", "sha1", "sha256", "sha512" or "file" . The +"value" should be the actual checksum value or download URL for "file". When +`type` part is omitted, type will be guessed based on the length of the +checksum string. Examples: + +``` +./foo.txt?checksum=md5:b7d96c89d09d9e204f5fedc4d5d55b21 +``` + +``` +./foo.txt?checksum=b7d96c89d09d9e204f5fedc4d5d55b21 +``` + +``` +./foo.txt?checksum=file:./foo.txt.sha256sum +``` + +When checksumming from a file - ex: with `checksum=file:url` - go-getter will +get the file linked in the URL after `file:` using the same configuration. For +example, in `file:http://releases.ubuntu.com/cosmic/MD5SUMS` go-getter will +download a checksum file under the aforementioned url using the http protocol. +All protocols supported by go-getter can be used. The checksum file will be +downloaded in a temporary file then parsed. The destination of the temporary +file can be changed by setting system specific environment variables: `TMPDIR` +for unix; `TMP`, `TEMP` or `USERPROFILE` on windows. Read godoc of +[os.TempDir](https://golang.org/pkg/os/#TempDir) for more information on the +temporary directory selection. Content of files are expected to be BSD or GNU +style. Once go-getter is done with the checksum file; it is deleted. + +The checksum query parameter is never sent to the backend protocol +implementation. It is used at a higher level by go-getter itself. + +If the destination file exists and the checksums match: download +will be skipped. + +### Unarchiving + +go-getter will automatically unarchive files into a file or directory +based on the extension of the file being requested (over any protocol). +This works for both file and directory downloads. + +go-getter looks for an `archive` query parameter to specify the format of +the archive. If this isn't specified, go-getter will use the extension of +the path to see if it appears archived. Unarchiving can be explicitly +disabled by setting the `archive` query parameter to `false`. + +The following archive formats are supported: + + * `tar.gz` and `tgz` + * `tar.bz2` and `tbz2` + * `tar.xz` and `txz` + * `zip` + * `gz` + * `bz2` + * `xz` + +For example, an example URL is shown below: + +``` +./foo.zip +``` + +This will automatically be inferred to be a ZIP file and will be extracted. +You can also be explicit about the archive type: + +``` +./some/other/path?archive=zip +``` + +And finally, you can disable archiving completely: + +``` +./some/path?archive=false +``` + +You can combine unarchiving with the other features of go-getter such +as checksumming. The special `archive` query parameter will be removed +from the URL before going to the final protocol downloader. + +## Protocol-Specific Options + +This section documents the protocol-specific options that can be specified for +go-getter. These options should be appended to the input as normal query +parameters ([HTTP headers](#headers) are an exception to this, however). +Depending on the usage of go-getter, applications may provide alternate ways of +inputting options. For example, [Nomad](https://www.nomadproject.io) provides a +nice options block for specifying options rather than in the URL. + +## General (All Protocols) + +The options below are available to all protocols: + + * `archive` - The archive format to use to unarchive this file, or "" (empty + string) to disable unarchiving. For more details, see the complete section + on archive support above. + + * `checksum` - Checksum to verify the downloaded file or archive. See + the entire section on checksumming above for format and more details. + + * `filename` - When in file download mode, allows specifying the name of the + downloaded file on disk. Has no effect in directory mode. + +### Local Files (`file`) + +None + +### Git (`git`) + + * `ref` - The Git ref to checkout. This is a ref, so it can point to + a commit SHA, a branch name, etc. If it is a named ref such as a branch + name, go-getter will update it to the latest on each get. + + * `sshkey` - An SSH private key to use during clones. The provided key must + be a base64-encoded string. For example, to generate a suitable `sshkey` + from a private key file on disk, you would run `base64 -w0 `. + + **Note**: Git 2.3+ is required to use this feature. + + * `depth` - The Git clone depth. The provided number specifies the last `n` + revisions to clone from the repository. + + +The `git` getter accepts both URL-style SSH addresses like +`git::ssh://git@example.com/foo/bar`, and "scp-style" addresses like +`git::git@example.com/foo/bar`. In the latter case, omitting the `git::` +force prefix is allowed if the username prefix is exactly `git@`. + +The "scp-style" addresses _cannot_ be used in conjunction with the `ssh://` +scheme prefix, because in that case the colon is used to mark an optional +port number to connect on, rather than to delimit the path from the host. + +### Mercurial (`hg`) + + * `rev` - The Mercurial revision to checkout. + +### HTTP (`http`) + +#### Basic Authentication + +To use HTTP basic authentication with go-getter, simply prepend `username:password@` to the +hostname in the URL such as `https://Aladdin:OpenSesame@www.example.com/index.html`. All special +characters, including the username and password, must be URL encoded. + +#### Headers + +Optional request headers can be added by supplying them in a custom +[`HttpGetter`](https://godoc.org/github.com/hashicorp/go-getter#HttpGetter) +(_not_ as query parameters like most other options). These headers will be sent +out on every request the getter in question makes. + +### S3 (`s3`) + +S3 takes various access configurations in the URL. Note that it will also +read these from standard AWS environment variables if they're set. S3 compliant servers like Minio +are also supported. If the query parameters are present, these take priority. + + * `aws_access_key_id` - AWS access key. + * `aws_access_key_secret` - AWS access key secret. + * `aws_access_token` - AWS access token if this is being used. + * `aws_profile` - Use this profile from local ~/.aws/ config. Takes priority over the other three. + +#### Using IAM Instance Profiles with S3 + +If you use go-getter and want to use an EC2 IAM Instance Profile to avoid +using credentials, then just omit these and the profile, if available will +be used automatically. + +### Using S3 with Minio + If you use go-gitter for Minio support, you must consider the following: + + * `aws_access_key_id` (required) - Minio access key. + * `aws_access_key_secret` (required) - Minio access key secret. + * `region` (optional - defaults to us-east-1) - Region identifier to use. + * `version` (optional - defaults to Minio default) - Configuration file format. + +#### S3 Bucket Examples + +S3 has several addressing schemes used to reference your bucket. These are +listed here: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro + +Some examples for these addressing schemes: +- s3::https://s3.amazonaws.com/bucket/foo +- s3::https://s3-eu-west-1.amazonaws.com/bucket/foo +- bucket.s3.amazonaws.com/foo +- bucket.s3-eu-west-1.amazonaws.com/foo/bar +- "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=KEYID&aws_access_key_secret=SECRETKEY®ion=us-east-2" + +### GCS (`gcs`) + +#### GCS Authentication + +In order to access to GCS, authentication credentials should be provided. More information can be found [here](https://cloud.google.com/docs/authentication/getting-started) + +#### GCS Bucket Examples + +- gcs::https://www.googleapis.com/storage/v1/bucket +- gcs::https://www.googleapis.com/storage/v1/bucket/foo.zip +- www.googleapis.com/storage/v1/bucket/foo + +#### GCS Testing + +The tests for `get_gcs.go` require you to have GCP credentials set in your environment. These credentials can have any level of permissions to any project, they just need to exist. This means setting `GOOGLE_APPLICATION_CREDENTIALS="~/path/to/credentials.json"` or `GOOGLE_CREDENTIALS="{stringified-credentials-json}"`. Due to this configuration, `get_gcs_test.go` will fail for external contributors in CircleCI. + + +### Security Options + +**Disable Symlinks** + +In your getter client config, we recommend using the `DisableSymlinks` option, +which prevents writing through or copying from symlinks (which may point outside the directory). + +```go +client := getter.Client{ + // This will prevent copying or writing files through symlinks + DisableSymlinks: true, +} +``` + +**Disable or Limit `X-Terraform-Get`** + +Go-Getter supports arbitrary redirects via the `X-Terraform-Get` header. This functionality +exists to support [Terraform use cases](https://www.terraform.io/language/modules/sources#http-urls), +but is likely not needed in most applications. + +For code that uses the `HttpGetter`, add the following configuration options: + +```go +var httpGetter = &getter.HttpGetter{ + // Most clients should disable X-Terraform-Get + // See the note below + XTerraformGetDisabled: true, + // Your software probably doesn’t rely on X-Terraform-Get, but + // if it does, you should set the above field to false, plus + // set XTerraformGet Limit to prevent endless redirects + // XTerraformGetLimit: 10, +} +``` + +**Enforce Timeouts** + +The `HttpGetter` supports timeouts and other resource-constraining configuration options. The `GitGetter` and `HgGetter` +only support timeouts. + +Configuration for the `HttpGetter`: + +```go +var httpGetter = &getter.HttpGetter{ + // Disable pre-fetch HEAD requests + DoNotCheckHeadFirst: true, + + // As an alternative to the above setting, you can + // set a reasonable timeout for HEAD requests + // HeadFirstTimeout: 10 * time.Second, + + // Read timeout for HTTP operations + ReadTimeout: 30 * time.Second, + + // Set the maximum number of bytes + // that can be read by the getter + MaxBytes: 500000000, // 500 MB +} +``` + +For code that uses the `GitGetter` or `HgGetter`, set the `Timeout` option: +```go +var gitGetter = &getter.GitGetter{ + // Set a reasonable timeout for git operations + Timeout: 5 * time.Minute, +} +``` + +```go +var hgGetter = &getter.HgGetter{ + // Set a reasonable timeout for hg operations + Timeout: 5 * time.Minute, +} +``` + diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/checksum.go b/test/integration/licenses/github.com/hashicorp/go-getter/checksum.go new file mode 100644 index 0000000000..f1090839fb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/checksum.go @@ -0,0 +1,317 @@ +package getter + +import ( + "bufio" + "bytes" + "crypto/md5" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" + "encoding/hex" + "fmt" + "hash" + "io" + "net/url" + "os" + "path/filepath" + "strings" + + urlhelper "github.com/hashicorp/go-getter/helper/url" +) + +// FileChecksum helps verifying the checksum for a file. +type FileChecksum struct { + Type string + Hash hash.Hash + Value []byte + Filename string +} + +// A ChecksumError is returned when a checksum differs +type ChecksumError struct { + Hash hash.Hash + Actual []byte + Expected []byte + File string +} + +func (cerr *ChecksumError) Error() string { + if cerr == nil { + return "" + } + return fmt.Sprintf( + "Checksums did not match for %s.\nExpected: %s\nGot: %s\n%T", + cerr.File, + hex.EncodeToString(cerr.Expected), + hex.EncodeToString(cerr.Actual), + cerr.Hash, // ex: *sha256.digest + ) +} + +// checksum is a simple method to compute the checksum of a source file +// and compare it to the given expected value. +func (c *FileChecksum) checksum(source string) error { + f, err := os.Open(source) + if err != nil { + return fmt.Errorf("Failed to open file for checksum: %s", err) + } + defer f.Close() + + c.Hash.Reset() + if _, err := io.Copy(c.Hash, f); err != nil { + return fmt.Errorf("Failed to hash: %s", err) + } + + if actual := c.Hash.Sum(nil); !bytes.Equal(actual, c.Value) { + return &ChecksumError{ + Hash: c.Hash, + Actual: actual, + Expected: c.Value, + File: source, + } + } + + return nil +} + +// extractChecksum will return a FileChecksum based on the 'checksum' +// parameter of u. +// ex: +// http://hashicorp.com/terraform?checksum= +// http://hashicorp.com/terraform?checksum=: +// http://hashicorp.com/terraform?checksum=file: +// when checksumming from a file, extractChecksum will go get checksum_url +// in a temporary directory, parse the content of the file then delete it. +// Content of files are expected to be BSD style or GNU style. +// +// BSD-style checksum: +// MD5 (file1) = +// MD5 (file2) = +// +// GNU-style: +// file1 +// *file2 +// +// see parseChecksumLine for more detail on checksum file parsing +func (c *Client) extractChecksum(u *url.URL) (*FileChecksum, error) { + q := u.Query() + v := q.Get("checksum") + + if v == "" { + return nil, nil + } + + vs := strings.SplitN(v, ":", 2) + switch len(vs) { + case 2: + break // good + default: + // here, we try to guess the checksum from it's length + // if the type was not passed + return newChecksumFromValue(v, filepath.Base(u.EscapedPath())) + } + + checksumType, checksumValue := vs[0], vs[1] + + switch checksumType { + case "file": + return c.ChecksumFromFile(checksumValue, u) + default: + return newChecksumFromType(checksumType, checksumValue, filepath.Base(u.EscapedPath())) + } +} + +func newChecksum(checksumValue, filename string) (*FileChecksum, error) { + c := &FileChecksum{ + Filename: filename, + } + var err error + c.Value, err = hex.DecodeString(checksumValue) + if err != nil { + return nil, fmt.Errorf("invalid checksum: %s", err) + } + return c, nil +} + +func newChecksumFromType(checksumType, checksumValue, filename string) (*FileChecksum, error) { + c, err := newChecksum(checksumValue, filename) + if err != nil { + return nil, err + } + + c.Type = strings.ToLower(checksumType) + switch c.Type { + case "md5": + c.Hash = md5.New() + case "sha1": + c.Hash = sha1.New() + case "sha256": + c.Hash = sha256.New() + case "sha512": + c.Hash = sha512.New() + default: + return nil, fmt.Errorf( + "unsupported checksum type: %s", checksumType) + } + + return c, nil +} + +func newChecksumFromValue(checksumValue, filename string) (*FileChecksum, error) { + c, err := newChecksum(checksumValue, filename) + if err != nil { + return nil, err + } + + switch len(c.Value) { + case md5.Size: + c.Hash = md5.New() + c.Type = "md5" + case sha1.Size: + c.Hash = sha1.New() + c.Type = "sha1" + case sha256.Size: + c.Hash = sha256.New() + c.Type = "sha256" + case sha512.Size: + c.Hash = sha512.New() + c.Type = "sha512" + default: + return nil, fmt.Errorf("Unknown type for checksum %s", checksumValue) + } + + return c, nil +} + +// ChecksumFromFile will return all the FileChecksums found in file +// +// ChecksumFromFile will try to guess the hashing algorithm based on content +// of checksum file +// +// ChecksumFromFile will only return checksums for files that match file +// behind src +func (c *Client) ChecksumFromFile(checksumFile string, src *url.URL) (*FileChecksum, error) { + checksumFileURL, err := urlhelper.Parse(checksumFile) + if err != nil { + return nil, err + } + + tempfile, err := tmpFile("", filepath.Base(checksumFileURL.Path)) + if err != nil { + return nil, err + } + defer os.Remove(tempfile) + + c2 := &Client{ + Ctx: c.Ctx, + Getters: c.Getters, + Decompressors: c.Decompressors, + Detectors: c.Detectors, + Pwd: c.Pwd, + Dir: false, + Src: checksumFile, + Dst: tempfile, + ProgressListener: c.ProgressListener, + } + if err = c2.Get(); err != nil { + return nil, fmt.Errorf( + "Error downloading checksum file: %s", err) + } + + filename := filepath.Base(src.Path) + absPath, err := filepath.Abs(src.Path) + if err != nil { + return nil, err + } + checksumFileDir := filepath.Dir(checksumFileURL.Path) + relpath, err := filepath.Rel(checksumFileDir, absPath) + switch { + case err == nil || + err.Error() == "Rel: can't make "+absPath+" relative to "+checksumFileDir: + // ex: on windows C:\gopath\...\content.txt cannot be relative to \ + // which is okay, may be another expected path will work. + break + default: + return nil, err + } + + // possible file identifiers: + options := []string{ + filename, // ubuntu-14.04.1-server-amd64.iso + "*" + filename, // *ubuntu-14.04.1-server-amd64.iso Standard checksum + "?" + filename, // ?ubuntu-14.04.1-server-amd64.iso shasum -p + relpath, // dir/ubuntu-14.04.1-server-amd64.iso + "./" + relpath, // ./dir/ubuntu-14.04.1-server-amd64.iso + absPath, // fullpath; set if local + } + + f, err := os.Open(tempfile) + if err != nil { + return nil, fmt.Errorf( + "Error opening downloaded file: %s", err) + } + defer f.Close() + rd := bufio.NewReader(f) + for { + line, err := rd.ReadString('\n') + if err != nil { + if err != io.EOF { + return nil, fmt.Errorf( + "Error reading checksum file: %s", err) + } + if line == "" { + break + } + // parse the line, if we hit EOF, but the line is not empty + } + checksum, err := parseChecksumLine(line) + if err != nil || checksum == nil { + continue + } + if checksum.Filename == "" { + // filename not sure, let's try + return checksum, nil + } + // make sure the checksum is for the right file + for _, option := range options { + if option != "" && checksum.Filename == option { + // any checksum will work so we return the first one + return checksum, nil + } + } + } + return nil, fmt.Errorf("no checksum found in: %s", checksumFile) +} + +// parseChecksumLine takes a line from a checksum file and returns +// checksumType, checksumValue and filename parseChecksumLine guesses the style +// of the checksum BSD vs GNU by splitting the line and by counting the parts. +// of a line. +// for BSD type sums parseChecksumLine guesses the hashing algorithm +// by checking the length of the checksum. +func parseChecksumLine(line string) (*FileChecksum, error) { + parts := strings.Fields(line) + + switch len(parts) { + case 4: + // BSD-style checksum: + // MD5 (file1) = + // MD5 (file2) = + if len(parts[1]) <= 2 || + parts[1][0] != '(' || parts[1][len(parts[1])-1] != ')' { + return nil, fmt.Errorf( + "Unexpected BSD-style-checksum filename format: %s", line) + } + filename := parts[1][1 : len(parts[1])-1] + return newChecksumFromType(parts[0], parts[3], filename) + case 2: + // GNU-style: + // file1 + // *file2 + return newChecksumFromValue(parts[0], parts[1]) + case 0: + return nil, nil // empty line + default: + return newChecksumFromValue(parts[0], "") + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client.go b/test/integration/licenses/github.com/hashicorp/go-getter/client.go new file mode 100644 index 0000000000..05f2f5f651 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/client.go @@ -0,0 +1,347 @@ +package getter + +import ( + "context" + "errors" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + + urlhelper "github.com/hashicorp/go-getter/helper/url" + safetemp "github.com/hashicorp/go-safetemp" +) + +// ErrSymlinkCopy means that a copy of a symlink was encountered on a request with DisableSymlinks enabled. +var ErrSymlinkCopy = errors.New("copying of symlinks has been disabled") + +// Client is a client for downloading things. +// +// Top-level functions such as Get are shortcuts for interacting with a client. +// Using a client directly allows more fine-grained control over how downloading +// is done, as well as customizing the protocols supported. +type Client struct { + // Ctx for cancellation + Ctx context.Context + + // Src is the source URL to get. + // + // Dst is the path to save the downloaded thing as. If Dir is set to + // true, then this should be a directory. If the directory doesn't exist, + // it will be created for you. + // + // Pwd is the working directory for detection. If this isn't set, some + // detection may fail. Client will not default pwd to the current + // working directory for security reasons. + Src string + Dst string + Pwd string + + // Mode is the method of download the client will use. See ClientMode + // for documentation. + Mode ClientMode + + // Umask is used to mask file permissions when storing local files or decompressing + // an archive + Umask os.FileMode + + // Detectors is the list of detectors that are tried on the source. + // If this is nil, then the default Detectors will be used. + Detectors []Detector + + // Decompressors is the map of decompressors supported by this client. + // If this is nil, then the default value is the Decompressors global. + Decompressors map[string]Decompressor + + // Getters is the map of protocols supported by this client. If this + // is nil, then the default Getters variable will be used. + Getters map[string]Getter + + // Dir, if true, tells the Client it is downloading a directory (versus + // a single file). This distinction is necessary since filenames and + // directory names follow the same format so disambiguating is impossible + // without knowing ahead of time. + // + // WARNING: deprecated. If Mode is set, that will take precedence. + Dir bool + + // ProgressListener allows to track file downloads. + // By default a no op progress listener is used. + ProgressListener ProgressTracker + + // Insecure controls whether a client verifies the server's + // certificate chain and host name. If Insecure is true, crypto/tls + // accepts any certificate presented by the server and any host name in that + // certificate. In this mode, TLS is susceptible to machine-in-the-middle + // attacks unless custom verification is used. This should be used only for + // testing or in combination with VerifyConnection or VerifyPeerCertificate. + // This is identical to tls.Config.InsecureSkipVerify. + Insecure bool + + // Disable symlinks + DisableSymlinks bool + + Options []ClientOption +} + +// umask returns the effective umask for the Client, defaulting to the process umask +func (c *Client) umask() os.FileMode { + if c == nil { + return 0 + } + return c.Umask +} + +// mode returns file mode umasked by the Client umask +func (c *Client) mode(mode os.FileMode) os.FileMode { + m := mode & ^c.umask() + return m +} + +// Get downloads the configured source to the destination. +func (c *Client) Get() error { + if err := c.Configure(c.Options...); err != nil { + return err + } + + // Store this locally since there are cases we swap this + mode := c.Mode + if mode == ClientModeInvalid { + if c.Dir { + mode = ClientModeDir + } else { + mode = ClientModeFile + } + } + + src, err := Detect(c.Src, c.Pwd, c.Detectors) + if err != nil { + return err + } + + // Determine if we have a forced protocol, i.e. "git::http://..." + force, src := getForcedGetter(src) + + // If there is a subdir component, then we download the root separately + // and then copy over the proper subdir. + var realDst string + dst := c.Dst + src, subDir := SourceDirSubdir(src) + if subDir != "" { + // Check if the subdirectory is attempting to traverse updwards, outside of + // the cloned repository path. + subDir := filepath.Clean(subDir) + if containsDotDot(subDir) { + return fmt.Errorf("subdirectory component contain path traversal out of the repository") + } + // Prevent absolute paths, remove a leading path separator from the subdirectory + if subDir[0] == os.PathSeparator { + subDir = subDir[1:] + } + + td, tdcloser, err := safetemp.Dir("", "getter") + if err != nil { + return err + } + defer tdcloser.Close() + + realDst = dst + dst = td + } + + u, err := urlhelper.Parse(src) + if err != nil { + return err + } + if force == "" { + force = u.Scheme + } + + g, ok := c.Getters[force] + if !ok { + return fmt.Errorf( + "download not supported for scheme '%s'", force) + } + + // We have magic query parameters that we use to signal different features + q := u.Query() + + // Determine if we have an archive type + archiveV := q.Get("archive") + if archiveV != "" { + // Delete the paramter since it is a magic parameter we don't + // want to pass on to the Getter + q.Del("archive") + u.RawQuery = q.Encode() + + // If we can parse the value as a bool and it is false, then + // set the archive to "-" which should never map to a decompressor + if b, err := strconv.ParseBool(archiveV); err == nil && !b { + archiveV = "-" + } + } + if archiveV == "" { + // We don't appear to... but is it part of the filename? + matchingLen := 0 + for k := range c.Decompressors { + if strings.HasSuffix(u.Path, "."+k) && len(k) > matchingLen { + archiveV = k + matchingLen = len(k) + } + } + } + + // If we have a decompressor, then we need to change the destination + // to download to a temporary path. We unarchive this into the final, + // real path. + var decompressDst string + var decompressDir bool + decompressor := c.Decompressors[archiveV] + if decompressor != nil { + // Create a temporary directory to store our archive. We delete + // this at the end of everything. + td, err := ioutil.TempDir("", "getter") + if err != nil { + return fmt.Errorf( + "Error creating temporary directory for archive: %s", err) + } + defer os.RemoveAll(td) + + // Swap the download directory to be our temporary path and + // store the old values. + decompressDst = dst + decompressDir = mode != ClientModeFile + dst = filepath.Join(td, "archive") + mode = ClientModeFile + } + + // Determine checksum if we have one + checksum, err := c.extractChecksum(u) + if err != nil { + return fmt.Errorf("invalid checksum: %s", err) + } + + // Delete the query parameter if we have it. + q.Del("checksum") + u.RawQuery = q.Encode() + + if mode == ClientModeAny { + // Ask the getter which client mode to use + mode, err = g.ClientMode(u) + if err != nil { + return err + } + + // Destination is the base name of the URL path in "any" mode when + // a file source is detected. + if mode == ClientModeFile { + filename := filepath.Base(u.Path) + + // Determine if we have a custom file name + if v := q.Get("filename"); v != "" { + // Delete the query parameter if we have it. + q.Del("filename") + u.RawQuery = q.Encode() + + filename = v + } + + if containsDotDot(filename) { + return fmt.Errorf("filename query parameter contain path traversal") + } + + dst = filepath.Join(dst, filename) + } + } + + // If we're not downloading a directory, then just download the file + // and return. + if mode == ClientModeFile { + getFile := true + if checksum != nil { + if err := checksum.checksum(dst); err == nil { + // don't get the file if the checksum of dst is correct + getFile = false + } + } + if getFile { + err := g.GetFile(dst, u) + if err != nil { + return err + } + + if checksum != nil { + if err := checksum.checksum(dst); err != nil { + return err + } + } + } + + if decompressor != nil { + // We have a decompressor, so decompress the current destination + // into the final destination with the proper mode. + err := decompressor.Decompress(decompressDst, dst, decompressDir, c.umask()) + if err != nil { + return err + } + + // Swap the information back + dst = decompressDst + if decompressDir { + mode = ClientModeAny + } else { + mode = ClientModeFile + } + } + + // We check the dir value again because it can be switched back + // if we were unarchiving. If we're still only Get-ing a file, then + // we're done. + if mode == ClientModeFile { + return nil + } + } + + // If we're at this point we're either downloading a directory or we've + // downloaded and unarchived a directory and we're just checking subdir. + // In the case we have a decompressor we don't Get because it was Get + // above. + if decompressor == nil { + // If we're getting a directory, then this is an error. You cannot + // checksum a directory. TODO: test + if checksum != nil { + return fmt.Errorf( + "checksum cannot be specified for directory download") + } + + // We're downloading a directory, which might require a bit more work + // if we're specifying a subdir. + err := g.Get(dst, u) + if err != nil { + err = fmt.Errorf("error downloading '%s': %s", RedactURL(u), err) + return err + } + } + + // If we have a subdir, copy that over + if subDir != "" { + if err := os.RemoveAll(realDst); err != nil { + return err + } + if err := os.MkdirAll(realDst, c.mode(0755)); err != nil { + return err + } + + // Process any globs + subDir, err := SubdirGlob(dst, subDir) + if err != nil { + return err + } + + return copyDir(c.Ctx, realDst, subDir, false, c.DisableSymlinks, c.umask()) + } + + return nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go new file mode 100644 index 0000000000..7f02509a78 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go @@ -0,0 +1,24 @@ +package getter + +// ClientMode is the mode that the client operates in. +type ClientMode uint + +const ( + ClientModeInvalid ClientMode = iota + + // ClientModeAny downloads anything it can. In this mode, dst must + // be a directory. If src is a file, it is saved into the directory + // with the basename of the URL. If src is a directory or archive, + // it is unpacked directly into dst. + ClientModeAny + + // ClientModeFile downloads a single file. In this mode, dst must + // be a file path (doesn't have to exist). src must point to a single + // file. It is saved as dst. + ClientModeFile + + // ClientModeDir downloads a directory. In this mode, dst must be + // a directory path (doesn't have to exist). src must point to an + // archive or directory (such as in s3). + ClientModeDir +) diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option.go new file mode 100644 index 0000000000..b164137533 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/client_option.go @@ -0,0 +1,100 @@ +package getter + +import ( + "context" + "os" +) + +// ClientOption is used to configure a client. +type ClientOption func(*Client) error + +// Configure applies all of the given client options, along with any default +// behavior including context, decompressors, detectors, and getters used by +// the client. +func (c *Client) Configure(opts ...ClientOption) error { + // If the context has not been configured use the background context. + if c.Ctx == nil { + c.Ctx = context.Background() + } + + // Store the options used to configure this client. + c.Options = opts + + // Apply all of the client options. + for _, opt := range opts { + err := opt(c) + if err != nil { + return err + } + } + + // If the client was not configured with any Decompressors, Detectors, + // or Getters, use the default values for each. + if c.Decompressors == nil { + c.Decompressors = Decompressors + } + if c.Detectors == nil { + c.Detectors = Detectors + } + if c.Getters == nil { + c.Getters = Getters + } + + // Set the client for each getter, so the top-level client can know + // the getter-specific client functions or progress tracking. + for _, getter := range c.Getters { + getter.SetClient(c) + } + + return nil +} + +// WithContext allows to pass a context to operation +// in order to be able to cancel a download in progress. +func WithContext(ctx context.Context) ClientOption { + return func(c *Client) error { + c.Ctx = ctx + return nil + } +} + +// WithDecompressors specifies which Decompressor are available. +func WithDecompressors(decompressors map[string]Decompressor) ClientOption { + return func(c *Client) error { + c.Decompressors = decompressors + return nil + } +} + +// WithDecompressors specifies which compressors are available. +func WithDetectors(detectors []Detector) ClientOption { + return func(c *Client) error { + c.Detectors = detectors + return nil + } +} + +// WithGetters specifies which getters are available. +func WithGetters(getters map[string]Getter) ClientOption { + return func(c *Client) error { + c.Getters = getters + return nil + } +} + +// WithMode specifies which client mode the getters should operate in. +func WithMode(mode ClientMode) ClientOption { + return func(c *Client) error { + c.Mode = mode + return nil + } +} + +// WithUmask specifies how to mask file permissions when storing local +// files or decompressing an archive. +func WithUmask(mode os.FileMode) ClientOption { + return func(c *Client) error { + c.Umask = mode + return nil + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go new file mode 100644 index 0000000000..75da58cdda --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go @@ -0,0 +1,14 @@ +package getter + +// WithInsecure allows for a user to avoid +// checking certificates (not recommended). +// For example, when connecting on HTTPS where an +// invalid certificate is presented. +// User assumes all risk. +// Not all getters have support for insecure mode yet. +func WithInsecure() func(*Client) error { + return func(c *Client) error { + c.Insecure = true + return nil + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go new file mode 100644 index 0000000000..9b185f71de --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go @@ -0,0 +1,38 @@ +package getter + +import ( + "io" +) + +// WithProgress allows for a user to track +// the progress of a download. +// For example by displaying a progress bar with +// current download. +// Not all getters have progress support yet. +func WithProgress(pl ProgressTracker) func(*Client) error { + return func(c *Client) error { + c.ProgressListener = pl + return nil + } +} + +// ProgressTracker allows to track the progress of downloads. +type ProgressTracker interface { + // TrackProgress should be called when + // a new object is being downloaded. + // src is the location the file is + // downloaded from. + // currentSize is the current size of + // the file in case it is a partial + // download. + // totalSize is the total size in bytes, + // size can be zero if the file size + // is not known. + // stream is the file being downloaded, every + // written byte will add up to processed size. + // + // TrackProgress returns a ReadCloser that wraps the + // download in progress ( stream ). + // When the download is finished, body shall be closed. + TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go new file mode 100644 index 0000000000..a578fed674 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go @@ -0,0 +1,65 @@ +package getter + +import ( + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "sync" + "testing" +) + +type MockProgressTracking struct { + sync.Mutex + downloaded map[string]int +} + +func (p *MockProgressTracking) TrackProgress(src string, + currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) { + p.Lock() + defer p.Unlock() + + if p.downloaded == nil { + p.downloaded = map[string]int{} + } + + v, _ := p.downloaded[src] + p.downloaded[src] = v + 1 + return stream +} + +func TestGet_progress(t *testing.T) { + s := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + // all good + rw.Header().Add("X-Terraform-Get", "something") + })) + defer s.Close() + + { // dl without tracking + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + if err := GetFile(dst, s.URL+"/file?thig=this&that"); err != nil { + t.Fatalf("download failed: %v", err) + } + } + + { // tracking + p := &MockProgressTracking{} + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + if err := GetFile(dst, s.URL+"/file?thig=this&that", WithProgress(p)); err != nil { + t.Fatalf("download failed: %v", err) + } + if err := GetFile(dst, s.URL+"/otherfile?thig=this&that", WithProgress(p)); err != nil { + t.Fatalf("download failed: %v", err) + } + + if p.downloaded["file"] != 1 { + t.Error("Expected a file download") + } + if p.downloaded["otherfile"] != 1 { + t.Error("Expected a otherfile download") + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go b/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go new file mode 100644 index 0000000000..317874d85d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go @@ -0,0 +1,93 @@ +package main + +import ( + "context" + "flag" + "log" + "os" + "os/signal" + "sync" + + getter "github.com/hashicorp/go-getter" +) + +func main() { + modeRaw := flag.String("mode", "any", "get mode (any, file, dir)") + progress := flag.Bool("progress", false, "display terminal progress") + insecure := flag.Bool("insecure", false, "do not verify server's certificate chain (not recommended)") + flag.Parse() + args := flag.Args() + if len(args) < 2 { + log.Fatalf("Expected two args: URL and dst") + os.Exit(1) + } + + // Get the mode + var mode getter.ClientMode + switch *modeRaw { + case "any": + mode = getter.ClientModeAny + case "file": + mode = getter.ClientModeFile + case "dir": + mode = getter.ClientModeDir + default: + log.Fatalf("Invalid client mode, must be 'any', 'file', or 'dir': %s", *modeRaw) + os.Exit(1) + } + + // Get the pwd + pwd, err := os.Getwd() + if err != nil { + log.Fatalf("Error getting wd: %s", err) + } + + opts := []getter.ClientOption{} + if *progress { + opts = append(opts, getter.WithProgress(defaultProgressBar)) + } + + if *insecure { + log.Println("WARNING: Using Insecure TLS transport!") + opts = append(opts, getter.WithInsecure()) + } + + ctx, cancel := context.WithCancel(context.Background()) + // Build the client + client := &getter.Client{ + Ctx: ctx, + Src: args[0], + Dst: args[1], + Pwd: pwd, + Mode: mode, + Options: opts, + } + + wg := sync.WaitGroup{} + wg.Add(1) + errChan := make(chan error, 2) + go func() { + defer wg.Done() + defer cancel() + if err := client.Get(); err != nil { + errChan <- err + } + }() + + c := make(chan os.Signal) + signal.Notify(c, os.Interrupt) + + select { + case sig := <-c: + signal.Reset(os.Interrupt) + cancel() + wg.Wait() + log.Printf("signal %v", sig) + case <-ctx.Done(): + wg.Wait() + log.Printf("success!") + case err := <-errChan: + wg.Wait() + log.Fatalf("Error downloading: %s", err) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go b/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go new file mode 100644 index 0000000000..c0db65c67a --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go @@ -0,0 +1,77 @@ +package main + +import ( + "io" + "path/filepath" + "sync" + + "github.com/cheggaaa/pb" + getter "github.com/hashicorp/go-getter" +) + +// defaultProgressBar is the default instance of a cheggaaa +// progress bar. +var defaultProgressBar getter.ProgressTracker = &ProgressBar{} + +// ProgressBar wraps a github.com/cheggaaa/pb.Pool +// in order to display download progress for one or multiple +// downloads. +// +// If two different instance of ProgressBar try to +// display a progress only one will be displayed. +// It is therefore recommended to use DefaultProgressBar +type ProgressBar struct { + // lock everything below + lock sync.Mutex + + pool *pb.Pool + + pbs int +} + +func ProgressBarConfig(bar *pb.ProgressBar, prefix string) { + bar.SetUnits(pb.U_BYTES) + bar.Prefix(prefix) +} + +// TrackProgress instantiates a new progress bar that will +// display the progress of stream until closed. +// total can be 0. +func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser { + cpb.lock.Lock() + defer cpb.lock.Unlock() + + newPb := pb.New64(totalSize) + newPb.Set64(currentSize) + ProgressBarConfig(newPb, filepath.Base(src)) + if cpb.pool == nil { + cpb.pool = pb.NewPool() + cpb.pool.Start() + } + cpb.pool.Add(newPb) + reader := newPb.NewProxyReader(stream) + + cpb.pbs++ + return &readCloser{ + Reader: reader, + close: func() error { + cpb.lock.Lock() + defer cpb.lock.Unlock() + + newPb.Finish() + cpb.pbs-- + if cpb.pbs <= 0 { + cpb.pool.Stop() + cpb.pool = nil + } + return nil + }, + } +} + +type readCloser struct { + io.Reader + close func() error +} + +func (c *readCloser) Close() error { return c.close() } diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/common.go b/test/integration/licenses/github.com/hashicorp/go-getter/common.go new file mode 100644 index 0000000000..d2afd8ad88 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/common.go @@ -0,0 +1,14 @@ +package getter + +import ( + "io/ioutil" +) + +func tmpFile(dir, pattern string) (string, error) { + f, err := ioutil.TempFile(dir, pattern) + if err != nil { + return "", err + } + f.Close() + return f.Name(), nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go b/test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go new file mode 100644 index 0000000000..646c283db3 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go @@ -0,0 +1,85 @@ +package getter + +import ( + "context" + "fmt" + "os" + "path/filepath" + "strings" +) + +// mode returns the file mode masked by the umask +func mode(mode, umask os.FileMode) os.FileMode { + return mode & ^umask +} + +// copyDir copies the src directory contents into dst. Both directories +// should already exist. +// +// If ignoreDot is set to true, then dot-prefixed files/folders are ignored. +func copyDir(ctx context.Context, dst string, src string, ignoreDot bool, disableSymlinks bool, umask os.FileMode) error { + // We can safely evaluate the symlinks here, even if disabled, because they + // will be checked before actual use in walkFn and copyFile + var err error + src, err = filepath.EvalSymlinks(src) + if err != nil { + return err + } + + walkFn := func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + if disableSymlinks { + fileInfo, err := os.Lstat(path) + if err != nil { + return fmt.Errorf("failed to check copy file source for symlinks: %w", err) + } + if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { + return ErrSymlinkCopy + } + // if info.Mode()&os.ModeSymlink == os.ModeSymlink { + // return ErrSymlinkCopy + // } + } + + if path == src { + return nil + } + + if ignoreDot && strings.HasPrefix(filepath.Base(path), ".") { + // Skip any dot files + if info.IsDir() { + return filepath.SkipDir + } else { + return nil + } + } + + // The "path" has the src prefixed to it. We need to join our + // destination with the path without the src on it. + dstPath := filepath.Join(dst, path[len(src):]) + + // If we have a directory, make that subdirectory, then continue + // the walk. + if info.IsDir() { + if path == filepath.Join(src, dst) { + // dst is in src; don't walk it. + return nil + } + + if err := os.MkdirAll(dstPath, mode(0755, umask)); err != nil { + return err + } + + return nil + } + + // If we have a file, copy the contents. + _, err = copyFile(ctx, dstPath, path, disableSymlinks, info.Mode(), umask) + return err + } + + return filepath.Walk(src, walkFn) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress.go new file mode 100644 index 0000000000..9db9e15c08 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress.go @@ -0,0 +1,65 @@ +package getter + +import ( + "os" + "strings" +) + +// Decompressor defines the interface that must be implemented to add +// support for decompressing a type. +// +// Important: if you're implementing a decompressor, please use the +// containsDotDot helper in this file to ensure that files can't be +// decompressed outside of the specified directory. +type Decompressor interface { + // Decompress should decompress src to dst. dir specifies whether dst + // is a directory or single file. src is guaranteed to be a single file + // that exists. dst is not guaranteed to exist already. + Decompress(dst, src string, dir bool, umask os.FileMode) error +} + +// Decompressors is the mapping of extension to the Decompressor implementation +// that will decompress that extension/type. +var Decompressors map[string]Decompressor + +func init() { + tarDecompressor := new(TarDecompressor) + tbzDecompressor := new(TarBzip2Decompressor) + tgzDecompressor := new(TarGzipDecompressor) + txzDecompressor := new(TarXzDecompressor) + tzstDecompressor := new(TarZstdDecompressor) + + Decompressors = map[string]Decompressor{ + "bz2": new(Bzip2Decompressor), + "gz": new(GzipDecompressor), + "xz": new(XzDecompressor), + "tar": tarDecompressor, + "tar.bz2": tbzDecompressor, + "tar.gz": tgzDecompressor, + "tar.xz": txzDecompressor, + "tar.zst": tzstDecompressor, + "tbz2": tbzDecompressor, + "tgz": tgzDecompressor, + "txz": txzDecompressor, + "tzst": tzstDecompressor, + "zip": new(ZipDecompressor), + "zst": new(ZstdDecompressor), + } +} + +// containsDotDot checks if the filepath value v contains a ".." entry. +// This will check filepath components by splitting along / or \. This +// function is copied directly from the Go net/http implementation. +func containsDotDot(v string) bool { + if !strings.Contains(v, "..") { + return false + } + for _, ent := range strings.FieldsFunc(v, isSlashRune) { + if ent == ".." { + return true + } + } + return false +} + +func isSlashRune(r rune) bool { return r == '/' || r == '\\' } diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go new file mode 100644 index 0000000000..a5373e4e1d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go @@ -0,0 +1,37 @@ +package getter + +import ( + "compress/bzip2" + "fmt" + "os" + "path/filepath" +) + +// Bzip2Decompressor is an implementation of Decompressor that can +// decompress bz2 files. +type Bzip2Decompressor struct{} + +func (d *Bzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // Directory isn't supported at all + if dir { + return fmt.Errorf("bzip2-compressed files can only unarchive to a single file") + } + + // If we're going into a directory we should make that first + if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // Bzip2 compression is second + bzipR := bzip2.NewReader(f) + + // Copy it out + return copyReader(dst, bzipR, 0622, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go new file mode 100644 index 0000000000..0315c59c87 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go @@ -0,0 +1,34 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestBzip2Decompressor(t *testing.T) { + cases := []TestDecompressCase{ + { + "single.bz2", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.bz2", + true, + true, + nil, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-bz2", tc.Input) + } + + TestDecompressor(t, new(Bzip2Decompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go new file mode 100644 index 0000000000..669e5eafdf --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go @@ -0,0 +1,41 @@ +package getter + +import ( + "compress/gzip" + "fmt" + "os" + "path/filepath" +) + +// GzipDecompressor is an implementation of Decompressor that can +// decompress gzip files. +type GzipDecompressor struct{} + +func (d *GzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // Directory isn't supported at all + if dir { + return fmt.Errorf("gzip-compressed files can only unarchive to a single file") + } + + // If we're going into a directory we should make that first + if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // gzip compression is second + gzipR, err := gzip.NewReader(f) + if err != nil { + return err + } + defer gzipR.Close() + + // Copy it out + return copyReader(dst, gzipR, 0622, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go new file mode 100644 index 0000000000..b805678a42 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go @@ -0,0 +1,34 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestGzipDecompressor(t *testing.T) { + cases := []TestDecompressCase{ + { + "single.gz", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.gz", + true, + true, + nil, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-gz", tc.Input) + } + + TestDecompressor(t, new(GzipDecompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go new file mode 100644 index 0000000000..ee1d29ca96 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go @@ -0,0 +1,150 @@ +package getter + +import ( + "archive/tar" + "fmt" + "io" + "os" + "path/filepath" + "time" +) + +// untar is a shared helper for untarring an archive. The reader should provide +// an uncompressed view of the tar archive. +func untar(input io.Reader, dst, src string, dir bool, umask os.FileMode) error { + tarR := tar.NewReader(input) + done := false + dirHdrs := []*tar.Header{} + now := time.Now() + for { + hdr, err := tarR.Next() + if err == io.EOF { + if !done { + // Empty archive + return fmt.Errorf("empty archive: %s", src) + } + + break + } + if err != nil { + return err + } + + if hdr.Typeflag == tar.TypeXGlobalHeader || hdr.Typeflag == tar.TypeXHeader { + // don't unpack extended headers as files + continue + } + + path := dst + if dir { + // Disallow parent traversal + if containsDotDot(hdr.Name) { + return fmt.Errorf("entry contains '..': %s", hdr.Name) + } + + path = filepath.Join(path, hdr.Name) + } + + if hdr.FileInfo().IsDir() { + if !dir { + return fmt.Errorf("expected a single file: %s", src) + } + + // A directory, just make the directory and continue unarchiving... + if err := os.MkdirAll(path, mode(0755, umask)); err != nil { + return err + } + + // Record the directory information so that we may set its attributes + // after all files have been extracted + dirHdrs = append(dirHdrs, hdr) + + continue + } else { + // There is no ordering guarantee that a file in a directory is + // listed before the directory + dstPath := filepath.Dir(path) + + // Check that the directory exists, otherwise create it + if _, err := os.Stat(dstPath); os.IsNotExist(err) { + if err := os.MkdirAll(dstPath, mode(0755, umask)); err != nil { + return err + } + } + } + + // We have a file. If we already decoded, then it is an error + if !dir && done { + return fmt.Errorf("expected a single file, got multiple: %s", src) + } + + // Mark that we're done so future in single file mode errors + done = true + + // Open the file for writing + err = copyReader(path, tarR, hdr.FileInfo().Mode(), umask) + if err != nil { + return err + } + + // Set the access and modification time if valid, otherwise default to current time + aTime := now + mTime := now + if hdr.AccessTime.Unix() > 0 { + aTime = hdr.AccessTime + } + if hdr.ModTime.Unix() > 0 { + mTime = hdr.ModTime + } + if err := os.Chtimes(path, aTime, mTime); err != nil { + return err + } + } + + // Perform a final pass over extracted directories to update metadata + for _, dirHdr := range dirHdrs { + path := filepath.Join(dst, dirHdr.Name) + // Chmod the directory since they might be created before we know the mode flags + if err := os.Chmod(path, mode(dirHdr.FileInfo().Mode(), umask)); err != nil { + return err + } + // Set the mtime/atime attributes since they would have been changed during extraction + aTime := now + mTime := now + if dirHdr.AccessTime.Unix() > 0 { + aTime = dirHdr.AccessTime + } + if dirHdr.ModTime.Unix() > 0 { + mTime = dirHdr.ModTime + } + if err := os.Chtimes(path, aTime, mTime); err != nil { + return err + } + } + + return nil +} + +// TarDecompressor is an implementation of Decompressor that can +// unpack tar files. +type TarDecompressor struct{} + +func (d *TarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + return untar(f, dst, src, dir, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go new file mode 100644 index 0000000000..cfc8420191 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go @@ -0,0 +1,107 @@ +package getter + +import ( + "io/ioutil" + "os" + "path/filepath" + "runtime" + "testing" + "time" +) + +func TestTar(t *testing.T) { + mtime := time.Unix(0, 0) + cases := []TestDecompressCase{ + { + "extended_header.tar", + true, + false, + []string{"directory/", "directory/a", "directory/b"}, + "", + nil, + }, + { + "implied_dir.tar", + true, + false, + []string{"directory/", "directory/sub/", "directory/sub/a", "directory/sub/b"}, + "", + nil, + }, + { + "unix_time_0.tar", + true, + false, + []string{"directory/", "directory/sub/", "directory/sub/a", "directory/sub/b"}, + "", + &mtime, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-tar", tc.Input) + } + + TestDecompressor(t, new(TarDecompressor), cases) +} + +// testDecompressPermissions decompresses a directory and checks the permissions of the expanded files +func testDecompressorPermissions(t *testing.T, d Decompressor, input string, expected map[string]int, umask os.FileMode) { + td, err := ioutil.TempDir("", "getter") + if err != nil { + t.Fatalf("err: %s", err) + } + + // Destination is always joining result so that we have a new path + dst := filepath.Join(td, "subdir", "result") + + err = d.Decompress(dst, input, true, umask) + if err != nil { + t.Fatalf("err: %s", err) + } + + defer os.RemoveAll(dst) + + for name, mode := range expected { + fi, err := os.Stat(filepath.Join(dst, name)) + if err != nil { + t.Fatalf("err: %s", err) + } + + real := fi.Mode() + if real != os.FileMode(mode) { + t.Fatalf("err: %s expected mode %o got %o", name, mode, real) + } + } +} + +func TestDecompressTarPermissions(t *testing.T) { + d := new(TarDecompressor) + input := "./test-fixtures/decompress-tar/permissions.tar" + + var expected map[string]int + var masked int + + if runtime.GOOS == "windows" { + expected = map[string]int{ + "directory/public": 0666, + "directory/private": 0666, + "directory/exec": 0666, + "directory/setuid": 0666, + } + masked = 0666 + } else { + expected = map[string]int{ + "directory/public": 0666, + "directory/private": 0600, + "directory/exec": 0755, + "directory/setuid": 040000755, + } + masked = 0755 + } + + testDecompressorPermissions(t, d, input, expected, os.FileMode(0)) + + expected["directory/setuid"] = masked + testDecompressorPermissions(t, d, input, expected, os.FileMode(060000000)) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go new file mode 100644 index 0000000000..e2e5458c9d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go @@ -0,0 +1,33 @@ +package getter + +import ( + "compress/bzip2" + "os" + "path/filepath" +) + +// TarBzip2Decompressor is an implementation of Decompressor that can +// decompress tar.bz2 files. +type TarBzip2Decompressor struct{} + +func (d *TarBzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // Bzip2 compression is second + bzipR := bzip2.NewReader(f) + return untar(bzipR, dst, src, dir, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go new file mode 100644 index 0000000000..14a16c21b5 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go @@ -0,0 +1,73 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestTarBzip2Decompressor(t *testing.T) { + orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} + + cases := []TestDecompressCase{ + { + "empty.tar.bz2", + false, + true, + nil, + "", + nil, + }, + + { + "single.tar.bz2", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.tar.bz2", + true, + false, + []string{"file"}, + "", + nil, + }, + + { + "multiple.tar.bz2", + true, + false, + []string{"file1", "file2"}, + "", + nil, + }, + + { + "multiple.tar.bz2", + false, + true, + nil, + "", + nil, + }, + + // Tests when the file is listed before the parent folder + { + "ordering.tar.bz2", + true, + false, + orderingPaths, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-tbz2", tc.Input) + } + + TestDecompressor(t, new(TarBzip2Decompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go new file mode 100644 index 0000000000..b18bd6cb6d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go @@ -0,0 +1,171 @@ +package getter + +import ( + "crypto/md5" + "encoding/hex" + "io" + "io/ioutil" + "os" + "path/filepath" + "reflect" + "runtime" + "sort" + "strings" + "time" + + "github.com/mitchellh/go-testing-interface" +) + +// TestDecompressCase is a single test case for testing decompressors +type TestDecompressCase struct { + Input string // Input is the complete path to the input file + Dir bool // Dir is whether or not we're testing directory mode + Err bool // Err is whether we expect an error or not + DirList []string // DirList is the list of files for Dir mode + FileMD5 string // FileMD5 is the expected MD5 for a single file + Mtime *time.Time // Mtime is the optionally expected mtime for a single file (or all files if in Dir mode) +} + +// TestDecompressor is a helper function for testing generic decompressors. +func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) { + t.Helper() + + for _, tc := range cases { + t.Logf("Testing: %s", tc.Input) + + // Temporary dir to store stuff + td, err := ioutil.TempDir("", "getter") + if err != nil { + t.Fatalf("err: %s", err) + } + + // Destination is always joining result so that we have a new path + dst := filepath.Join(td, "subdir", "result") + + // We use a function so defers work + func() { + defer os.RemoveAll(td) + + // Decompress + err := d.Decompress(dst, tc.Input, tc.Dir, 0022) + if (err != nil) != tc.Err { + t.Fatalf("err %s: %s", tc.Input, err) + } + if tc.Err { + return + } + + // If it isn't a directory, then check for a single file + if !tc.Dir { + fi, err := os.Stat(dst) + if err != nil { + t.Fatalf("err %s: %s", tc.Input, err) + } + if fi.IsDir() { + t.Fatalf("err %s: expected file, got directory", tc.Input) + } + if tc.FileMD5 != "" { + actual := testMD5(t, dst) + expected := tc.FileMD5 + if actual != expected { + t.Fatalf("err %s: expected MD5 %s, got %s", tc.Input, expected, actual) + } + } + + if tc.Mtime != nil { + actual := fi.ModTime() + if tc.Mtime.Unix() > 0 { + expected := *tc.Mtime + if actual != expected { + t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), dst, actual.String()) + } + } else if actual.Unix() <= 0 { + t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) + } + } + + return + } + + // Convert expected for windows + expected := tc.DirList + if runtime.GOOS == "windows" { + for i, v := range expected { + expected[i] = strings.Replace(v, "/", "\\", -1) + } + } + + // Directory, check for the correct contents + actual := testListDir(t, dst) + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("bad %s\n\n%#v\n\n%#v", tc.Input, actual, expected) + } + // Check for correct atime/mtime + for _, dir := range actual { + path := filepath.Join(dst, dir) + if tc.Mtime != nil { + fi, err := os.Stat(path) + if err != nil { + t.Fatalf("err: %s", err) + } + actual := fi.ModTime() + if tc.Mtime.Unix() > 0 { + expected := *tc.Mtime + if actual != expected { + t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), path, actual.String()) + } + } else if actual.Unix() < 0 { + t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) + } + + } + } + }() + } +} + +func testListDir(t testing.T, path string) []string { + var result []string + err := filepath.Walk(path, func(sub string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + sub = strings.TrimPrefix(sub, path) + if sub == "" { + return nil + } + sub = sub[1:] // Trim the leading path sep. + + // If it is a dir, add trailing sep + if info.IsDir() { + sub += string(os.PathSeparator) + } + + result = append(result, sub) + return nil + }) + if err != nil { + t.Fatalf("err: %s", err) + } + + sort.Strings(result) + return result +} + +func testMD5(t testing.T, path string) string { + f, err := os.Open(path) + if err != nil { + t.Fatalf("err: %s", err) + } + defer f.Close() + + h := md5.New() + _, err = io.Copy(h, f) + if err != nil { + t.Fatalf("err: %s", err) + } + + result := h.Sum(nil) + return hex.EncodeToString(result) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go new file mode 100644 index 0000000000..84c4aa33d7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go @@ -0,0 +1,39 @@ +package getter + +import ( + "compress/gzip" + "fmt" + "os" + "path/filepath" +) + +// TarGzipDecompressor is an implementation of Decompressor that can +// decompress tar.gzip files. +type TarGzipDecompressor struct{} + +func (d *TarGzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // Gzip compression is second + gzipR, err := gzip.NewReader(f) + if err != nil { + return fmt.Errorf("Error opening a gzip reader for %s: %s", src, err) + } + defer gzipR.Close() + + return untar(gzipR, dst, src, dir, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go new file mode 100644 index 0000000000..e0e4d2380c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go @@ -0,0 +1,95 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestTarGzipDecompressor(t *testing.T) { + + multiplePaths := []string{"dir/", "dir/test2", "test1"} + orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} + + cases := []TestDecompressCase{ + { + "empty.tar.gz", + false, + true, + nil, + "", + nil, + }, + + { + "single.tar.gz", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.tar.gz", + true, + false, + []string{"file"}, + "", + nil, + }, + + { + "multiple.tar.gz", + true, + false, + []string{"file1", "file2"}, + "", + nil, + }, + + { + "multiple.tar.gz", + false, + true, + nil, + "", + nil, + }, + + { + "multiple_dir.tar.gz", + true, + false, + multiplePaths, + "", + nil, + }, + + // Tests when the file is listed before the parent folder + { + "ordering.tar.gz", + true, + false, + orderingPaths, + "", + nil, + }, + + // Tests that a tar.gz can't contain references with "..". + // GNU `tar` also disallows this. + { + "outside_parent.tar.gz", + true, + true, + nil, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-tgz", tc.Input) + } + + TestDecompressor(t, new(TarGzipDecompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go new file mode 100644 index 0000000000..24686f4546 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go @@ -0,0 +1,39 @@ +package getter + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/ulikunitz/xz" +) + +// TarXzDecompressor is an implementation of Decompressor that can +// decompress tar.xz files. +type TarXzDecompressor struct{} + +func (d *TarXzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // xz compression is second + txzR, err := xz.NewReader(f) + if err != nil { + return fmt.Errorf("Error opening an xz reader for %s: %s", src, err) + } + + return untar(txzR, dst, src, dir, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go new file mode 100644 index 0000000000..cb71c42505 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go @@ -0,0 +1,84 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestTarXzDecompressor(t *testing.T) { + + multiplePaths := []string{"dir/", "dir/test2", "test1"} + orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} + + cases := []TestDecompressCase{ + { + "empty.tar.xz", + false, + true, + nil, + "", + nil, + }, + + { + "single.tar.xz", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.tar.xz", + true, + false, + []string{"file"}, + "", + nil, + }, + + { + "multiple.tar.xz", + true, + false, + []string{"file1", "file2"}, + "", + nil, + }, + + { + "multiple.tar.xz", + false, + true, + nil, + "", + nil, + }, + + { + "multiple_dir.tar.xz", + true, + false, + multiplePaths, + "", + nil, + }, + + // Tests when the file is listed before the parent folder + { + "ordering.tar.xz", + true, + false, + orderingPaths, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-txz", tc.Input) + } + + TestDecompressor(t, new(TarXzDecompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go new file mode 100644 index 0000000000..a9f3da51e4 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go @@ -0,0 +1,39 @@ +package getter + +import ( + "fmt" + "github.com/klauspost/compress/zstd" + "os" + "path/filepath" +) + +// TarZstdDecompressor is an implementation of Decompressor that can +// decompress tar.zstd files. +type TarZstdDecompressor struct{} + +func (d *TarZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // Zstd compression is second + zstdR, err := zstd.NewReader(f) + if err != nil { + return fmt.Errorf("Error opening a zstd reader for %s: %s", src, err) + } + defer zstdR.Close() + + return untar(zstdR, dst, src, dir, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go new file mode 100644 index 0000000000..9787c72674 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go @@ -0,0 +1,95 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestTarZstdDecompressor(t *testing.T) { + + multiplePaths := []string{"dir/", "dir/test2", "test1"} + orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} + + cases := []TestDecompressCase{ + { + "empty.tar.zst", + false, + true, + nil, + "", + nil, + }, + + { + "single.tar.zst", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.tar.zst", + true, + false, + []string{"file"}, + "", + nil, + }, + + { + "multiple.tar.zst", + true, + false, + []string{"file1", "file2"}, + "", + nil, + }, + + { + "multiple.tar.zst", + false, + true, + nil, + "", + nil, + }, + + { + "multiple_dir.tar.zst", + true, + false, + multiplePaths, + "", + nil, + }, + + // Tests when the file is listed before the parent folder + { + "ordering.tar.zst", + true, + false, + orderingPaths, + "", + nil, + }, + + // Tests that a tar.zst can't contain references with "..". + // GNU `tar` also disallows this. + { + "outside_parent.tar.zst", + true, + true, + nil, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-tzst", tc.Input) + } + + TestDecompressor(t, new(TarZstdDecompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go new file mode 100644 index 0000000000..de5d6ce2b2 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go @@ -0,0 +1,41 @@ +package getter + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/ulikunitz/xz" +) + +// XzDecompressor is an implementation of Decompressor that can +// decompress xz files. +type XzDecompressor struct{} + +func (d *XzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // Directory isn't supported at all + if dir { + return fmt.Errorf("xz-compressed files can only unarchive to a single file") + } + + // If we're going into a directory we should make that first + if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // xz compression is second + xzR, err := xz.NewReader(f) + if err != nil { + return err + } + + // Copy it out + return copyReader(dst, xzR, 0622, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go new file mode 100644 index 0000000000..9aa55b1f86 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go @@ -0,0 +1,34 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestXzDecompressor(t *testing.T) { + cases := []TestDecompressCase{ + { + "single.xz", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.xz", + true, + true, + nil, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-xz", tc.Input) + } + + TestDecompressor(t, new(XzDecompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go new file mode 100644 index 0000000000..943610aee0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go @@ -0,0 +1,91 @@ +package getter + +import ( + "archive/zip" + "fmt" + "os" + "path/filepath" +) + +// ZipDecompressor is an implementation of Decompressor that can +// decompress zip files. +type ZipDecompressor struct{} + +func (d *ZipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { + return err + } + + // Open the zip + zipR, err := zip.OpenReader(src) + if err != nil { + return err + } + defer zipR.Close() + + // Check the zip integrity + if len(zipR.File) == 0 { + // Empty archive + return fmt.Errorf("empty archive: %s", src) + } + if !dir && len(zipR.File) > 1 { + return fmt.Errorf("expected a single file: %s", src) + } + + // Go through and unarchive + for _, f := range zipR.File { + path := dst + if dir { + // Disallow parent traversal + if containsDotDot(f.Name) { + return fmt.Errorf("entry contains '..': %s", f.Name) + } + + path = filepath.Join(path, f.Name) + } + + if f.FileInfo().IsDir() { + if !dir { + return fmt.Errorf("expected a single file: %s", src) + } + + // A directory, just make the directory and continue unarchiving... + if err := os.MkdirAll(path, mode(0755, umask)); err != nil { + return err + } + + continue + } + + // Create the enclosing directories if we must. ZIP files aren't + // required to contain entries for just the directories so this + // can happen. + if dir { + if err := os.MkdirAll(filepath.Dir(path), mode(0755, umask)); err != nil { + return err + } + } + + // Open the file for reading + srcF, err := f.Open() + if err != nil { + if srcF != nil { + srcF.Close() + } + return err + } + + err = copyReader(path, srcF, f.Mode(), umask) + srcF.Close() + if err != nil { + return err + } + } + + return nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go new file mode 100644 index 0000000000..d898da158a --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go @@ -0,0 +1,131 @@ +package getter + +import ( + "os" + "path/filepath" + "runtime" + "testing" +) + +func TestZipDecompressor(t *testing.T) { + cases := []TestDecompressCase{ + { + "empty.zip", + false, + true, + nil, + "", + nil, + }, + + { + "single.zip", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.zip", + true, + false, + []string{"file"}, + "", + nil, + }, + + { + "multiple.zip", + true, + false, + []string{"file1", "file2"}, + "", + nil, + }, + + { + "multiple.zip", + false, + true, + nil, + "", + nil, + }, + + { + "subdir.zip", + true, + false, + []string{"file1", "subdir/", "subdir/child"}, + "", + nil, + }, + + { + "subdir_empty.zip", + true, + false, + []string{"file1", "subdir/"}, + "", + nil, + }, + + { + "subdir_missing_dir.zip", + true, + false, + []string{"file1", "subdir/", "subdir/child"}, + "", + nil, + }, + + // Tests that a zip can't contain references with "..". + { + "outside_parent.zip", + true, + true, + nil, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-zip", tc.Input) + } + + TestDecompressor(t, new(ZipDecompressor), cases) +} + +func TestDecompressZipPermissions(t *testing.T) { + d := new(ZipDecompressor) + input := "./test-fixtures/decompress-zip/permissions.zip" + + var expected map[string]int + var masked int + + if runtime.GOOS == "windows" { + expected = map[string]int{ + "directory/public": 0666, + "directory/private": 0666, + "directory/exec": 0666, + "directory/setuid": 0666, + } + masked = 0666 + } else { + expected = map[string]int{ + "directory/public": 0666, + "directory/private": 0600, + "directory/exec": 0755, + "directory/setuid": 040000755, + } + masked = 0755 + } + + testDecompressorPermissions(t, d, input, expected, os.FileMode(0)) + + expected["directory/setuid"] = masked + testDecompressorPermissions(t, d, input, expected, os.FileMode(060000000)) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go new file mode 100644 index 0000000000..6ff6c86a94 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go @@ -0,0 +1,40 @@ +package getter + +import ( + "fmt" + "github.com/klauspost/compress/zstd" + "os" + "path/filepath" +) + +// ZstdDecompressor is an implementation of Decompressor that +// can decompress .zst files. +type ZstdDecompressor struct{} + +func (d *ZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + if dir { + return fmt.Errorf("zstd-compressed files can only unarchive to a single file") + } + + // If we're going into a directory we should make that first + if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // zstd compression is second + zstdR, err := zstd.NewReader(f) + if err != nil { + return err + } + defer zstdR.Close() + + // Copy it out + return copyReader(dst, zstdR, 0622, umask) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go new file mode 100644 index 0000000000..6a0683589f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go @@ -0,0 +1,34 @@ +package getter + +import ( + "path/filepath" + "testing" +) + +func TestZstdDecompressor(t *testing.T) { + cases := []TestDecompressCase{ + { + "single.zst", + false, + false, + nil, + "d3b07384d113edec49eaa6238ad5ff00", + nil, + }, + + { + "single.zst", + true, + true, + nil, + "", + nil, + }, + } + + for i, tc := range cases { + cases[i].Input = filepath.Join("./testdata", "decompress-zst", tc.Input) + } + + TestDecompressor(t, new(ZstdDecompressor), cases) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect.go new file mode 100644 index 0000000000..f134f77051 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect.go @@ -0,0 +1,106 @@ +package getter + +import ( + "fmt" + "path/filepath" + + "github.com/hashicorp/go-getter/helper/url" +) + +// Detector defines the interface that an invalid URL or a URL with a blank +// scheme is passed through in order to determine if its shorthand for +// something else well-known. +type Detector interface { + // Detect will detect whether the string matches a known pattern to + // turn it into a proper URL. + Detect(string, string) (string, bool, error) +} + +// Detectors is the list of detectors that are tried on an invalid URL. +// This is also the order they're tried (index 0 is first). +var Detectors []Detector + +func init() { + Detectors = []Detector{ + new(GitHubDetector), + new(GitLabDetector), + new(GitDetector), + new(BitBucketDetector), + new(S3Detector), + new(GCSDetector), + new(FileDetector), + } +} + +// Detect turns a source string into another source string if it is +// detected to be of a known pattern. +// +// The third parameter should be the list of detectors to use in the +// order to try them. If you don't want to configure this, just use +// the global Detectors variable. +// +// This is safe to be called with an already valid source string: Detect +// will just return it. +func Detect(src string, pwd string, ds []Detector) (string, error) { + getForce, getSrc := getForcedGetter(src) + + // Separate out the subdir if there is one, we don't pass that to detect + getSrc, subDir := SourceDirSubdir(getSrc) + + u, err := url.Parse(getSrc) + if err == nil && u.Scheme != "" { + // Valid URL + return src, nil + } + + for _, d := range ds { + result, ok, err := d.Detect(getSrc, pwd) + if err != nil { + return "", err + } + if !ok { + continue + } + + var detectForce string + detectForce, result = getForcedGetter(result) + result, detectSubdir := SourceDirSubdir(result) + + // If we have a subdir from the detection, then prepend it to our + // requested subdir. + if detectSubdir != "" { + if subDir != "" { + subDir = filepath.Join(detectSubdir, subDir) + } else { + subDir = detectSubdir + } + } + + if subDir != "" { + u, err := url.Parse(result) + if err != nil { + return "", fmt.Errorf("Error parsing URL: %s", err) + } + u.Path += "//" + subDir + + // a subdir may contain wildcards, but in order to support them we + // have to ensure the path isn't escaped. + u.RawPath = u.Path + + result = u.String() + } + + // Preserve the forced getter if it exists. We try to use the + // original set force first, followed by any force set by the + // detector. + if getForce != "" { + result = fmt.Sprintf("%s::%s", getForce, result) + } else if detectForce != "" { + result = fmt.Sprintf("%s::%s", detectForce, result) + } + + return result, nil + } + + return "", fmt.Errorf("invalid source string: %s", src) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go new file mode 100644 index 0000000000..19047eb197 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go @@ -0,0 +1,66 @@ +package getter + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + "strings" +) + +// BitBucketDetector implements Detector to detect BitBucket URLs and turn +// them into URLs that the Git or Hg Getter can understand. +type BitBucketDetector struct{} + +func (d *BitBucketDetector) Detect(src, _ string) (string, bool, error) { + if len(src) == 0 { + return "", false, nil + } + + if strings.HasPrefix(src, "bitbucket.org/") { + return d.detectHTTP(src) + } + + return "", false, nil +} + +func (d *BitBucketDetector) detectHTTP(src string) (string, bool, error) { + u, err := url.Parse("https://" + src) + if err != nil { + return "", true, fmt.Errorf("error parsing BitBucket URL: %s", err) + } + + // We need to get info on this BitBucket repository to determine whether + // it is Git or Hg. + var info struct { + SCM string `json:"scm"` + } + infoUrl := "https://api.bitbucket.org/2.0/repositories" + u.Path + resp, err := http.Get(infoUrl) + if err != nil { + return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) + } + if resp.StatusCode == 403 { + // A private repo + return "", true, fmt.Errorf( + "shorthand BitBucket URL can't be used for private repos, " + + "please use a full URL") + } + dec := json.NewDecoder(resp.Body) + if err := dec.Decode(&info); err != nil { + return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) + } + + switch info.SCM { + case "git": + if !strings.HasSuffix(u.Path, ".git") { + u.Path += ".git" + } + + return "git::" + u.String(), true, nil + case "hg": + return "hg::" + u.String(), true, nil + default: + return "", true, fmt.Errorf("unknown BitBucket SCM type: %s", info.SCM) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go new file mode 100644 index 0000000000..2b5948cebf --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go @@ -0,0 +1,63 @@ +package getter + +import ( + "net/http" + "strings" + "testing" +) + +const testBBUrl = "https://bitbucket.org/hashicorp/tf-test-git" + +func TestBitBucketDetector(t *testing.T) { + t.Parallel() + + if _, err := http.Get(testBBUrl); err != nil { + t.Log("internet may not be working, skipping BB tests") + t.Skip() + } + + cases := []struct { + Input string + Output string + }{ + // HTTP + { + "bitbucket.org/hashicorp/tf-test-git", + "git::https://bitbucket.org/hashicorp/tf-test-git.git", + }, + { + "bitbucket.org/hashicorp/tf-test-git.git", + "git::https://bitbucket.org/hashicorp/tf-test-git.git", + }, + } + + pwd := "/pwd" + f := new(BitBucketDetector) + for i, tc := range cases { + var err error + for i := 0; i < 3; i++ { + var output string + var ok bool + output, ok, err = f.Detect(tc.Input, pwd) + if err != nil { + if strings.Contains(err.Error(), "invalid character") { + continue + } + + t.Fatalf("err: %s", err) + } + if !ok { + t.Fatal("not ok") + } + + if output != tc.Output { + t.Fatalf("%d: bad: %#v", i, output) + } + + break + } + if i >= 3 { + t.Fatalf("failure from bitbucket: %s", err) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go new file mode 100644 index 0000000000..4ef41ea73f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go @@ -0,0 +1,67 @@ +package getter + +import ( + "fmt" + "os" + "path/filepath" + "runtime" +) + +// FileDetector implements Detector to detect file paths. +type FileDetector struct{} + +func (d *FileDetector) Detect(src, pwd string) (string, bool, error) { + if len(src) == 0 { + return "", false, nil + } + + if !filepath.IsAbs(src) { + if pwd == "" { + return "", true, fmt.Errorf( + "relative paths require a module with a pwd") + } + + // Stat the pwd to determine if its a symbolic link. If it is, + // then the pwd becomes the original directory. Otherwise, + // `filepath.Join` below does some weird stuff. + // + // We just ignore if the pwd doesn't exist. That error will be + // caught later when we try to use the URL. + if fi, err := os.Lstat(pwd); !os.IsNotExist(err) { + if err != nil { + return "", true, err + } + if fi.Mode()&os.ModeSymlink != 0 { + pwd, err = filepath.EvalSymlinks(pwd) + if err != nil { + return "", true, err + } + + // The symlink itself might be a relative path, so we have to + // resolve this to have a correctly rooted URL. + pwd, err = filepath.Abs(pwd) + if err != nil { + return "", true, err + } + } + } + + src = filepath.Join(pwd, src) + } + + return fmtFileURL(src), true, nil +} + +func fmtFileURL(path string) string { + if runtime.GOOS == "windows" { + // Make sure we're using "/" on Windows. URLs are "/"-based. + path = filepath.ToSlash(path) + return fmt.Sprintf("file://%s", path) + } + + // Make sure that we don't start with "/" since we add that below. + if path[0] == '/' { + path = path[1:] + } + return fmt.Sprintf("file:///%s", path) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go new file mode 100644 index 0000000000..0f7a055c93 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go @@ -0,0 +1,115 @@ +package getter + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + "strings" + "testing" +) + +type fileTest struct { + in, pwd, out string + err bool +} + +var fileTests = []fileTest{ + {"./foo", "/pwd", "file:///pwd/foo", false}, + {"./foo?foo=bar", "/pwd", "file:///pwd/foo?foo=bar", false}, + {"foo", "/pwd", "file:///pwd/foo", false}, +} + +var unixFileTests = []fileTest{ + {"./foo", "testdata/detect-file-symlink-pwd/syml/pwd", + "testdata/detect-file-symlink-pwd/real/foo", false}, + + {"/foo", "/pwd", "file:///foo", false}, + {"/foo?bar=baz", "/pwd", "file:///foo?bar=baz", false}, +} + +var winFileTests = []fileTest{ + {"/foo", "/pwd", "file:///pwd/foo", false}, + {`C:\`, `/pwd`, `file://C:/`, false}, + {`C:\?bar=baz`, `/pwd`, `file://C:/?bar=baz`, false}, +} + +func TestFileDetector(t *testing.T) { + if runtime.GOOS == "windows" { + fileTests = append(fileTests, winFileTests...) + } else { + fileTests = append(fileTests, unixFileTests...) + } + + // Get the pwd + pwdRoot, err := os.Getwd() + if err != nil { + t.Fatalf("err: %s", err) + } + pwdRoot, err = filepath.Abs(pwdRoot) + if err != nil { + t.Fatalf("err: %s", err) + } + + f := new(FileDetector) + for i, tc := range fileTests { + t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { + pwd := tc.pwd + + out, ok, err := f.Detect(tc.in, pwd) + if err != nil { + t.Fatalf("err: %s", err) + } + if !ok { + t.Fatal("not ok") + } + + expected := tc.out + if !strings.HasPrefix(expected, "file://") { + expected = "file://" + filepath.Join(pwdRoot, expected) + } + + if out != expected { + t.Fatalf("input: %q\npwd: %q\nexpected: %q\nbad output: %#v", + tc.in, pwd, expected, out) + } + }) + } +} + +var noPwdFileTests = []fileTest{ + {in: "./foo", pwd: "", out: "", err: true}, + {in: "foo", pwd: "", out: "", err: true}, +} + +var noPwdUnixFileTests = []fileTest{ + {in: "/foo", pwd: "", out: "file:///foo", err: false}, +} + +var noPwdWinFileTests = []fileTest{ + {in: "/foo", pwd: "", out: "", err: true}, + {in: `C:\`, pwd: ``, out: `file://C:/`, err: false}, +} + +func TestFileDetector_noPwd(t *testing.T) { + if runtime.GOOS == "windows" { + noPwdFileTests = append(noPwdFileTests, noPwdWinFileTests...) + } else { + noPwdFileTests = append(noPwdFileTests, noPwdUnixFileTests...) + } + + f := new(FileDetector) + for i, tc := range noPwdFileTests { + out, ok, err := f.Detect(tc.in, tc.pwd) + if err != nil != tc.err { + t.Fatalf("%d: err: %s", i, err) + } + if !ok { + t.Fatal("not ok") + } + + if out != tc.out { + t.Fatalf("%d: bad: %#v", i, out) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go new file mode 100644 index 0000000000..657f1a41c9 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go @@ -0,0 +1,70 @@ +// +build test unix + +package getter + +import ( + "io/ioutil" + "os" + "path/filepath" + "testing" +) + +// If a relative symlink is passed in as the pwd to Detect, the resulting URL +// can have an invalid path. +func TestFileDetector_relativeSymlink(t *testing.T) { + tmpDir, err := ioutil.TempDir("", "go-getter") + if err != nil { + t.Fatal(err) + } + + defer os.RemoveAll(tmpDir) + + // We may have a symlinked tmp dir, + // e.g. OSX uses /var -> /private/var + tmpDir, err = filepath.EvalSymlinks(tmpDir) + if err != nil { + t.Fatal(err) + } + + err = os.Mkdir(filepath.Join(tmpDir, "realPWD"), 0755) + if err != nil { + t.Fatal(err) + } + + subdir := filepath.Join(tmpDir, "subdir") + err = os.Mkdir(subdir, 0755) + if err != nil { + t.Fatal(err) + } + + prevDir, err := os.Getwd() + if err != nil { + t.Fatal(err) + } + defer os.Chdir(prevDir) + + err = os.Chdir(subdir) + if err != nil { + t.Fatal(err) + } + + err = os.Symlink("../realPWD", "linkedPWD") + if err != nil { + t.Fatal(err) + } + + // if detech doesn't fully resolve the pwd symlink, the output will be the + // invalid path: "file:///../modules/foo" + f := new(FileDetector) + out, ok, err := f.Detect("../modules/foo", "./linkedPWD") + if err != nil { + t.Fatalf("err: %v", err) + } + if !ok { + t.Fatal("not ok") + } + if out != "file://"+filepath.Join(tmpDir, "modules/foo") { + t.Logf("expected: %v", "file://"+filepath.Join(tmpDir, "modules/foo")) + t.Fatalf("bad: %v", out) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go new file mode 100644 index 0000000000..11363737c7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go @@ -0,0 +1,43 @@ +package getter + +import ( + "fmt" + "net/url" + "strings" +) + +// GCSDetector implements Detector to detect GCS URLs and turn +// them into URLs that the GCSGetter can understand. +type GCSDetector struct{} + +func (d *GCSDetector) Detect(src, _ string) (string, bool, error) { + if len(src) == 0 { + return "", false, nil + } + + if strings.Contains(src, "googleapis.com/") { + return d.detectHTTP(src) + } + + return "", false, nil +} + +func (d *GCSDetector) detectHTTP(src string) (string, bool, error) { + + parts := strings.Split(src, "/") + if len(parts) < 5 { + return "", false, fmt.Errorf( + "URL is not a valid GCS URL") + } + version := parts[2] + bucket := parts[3] + object := strings.Join(parts[4:], "/") + + url, err := url.Parse(fmt.Sprintf("https://www.googleapis.com/storage/%s/%s/%s", + version, bucket, object)) + if err != nil { + return "", false, fmt.Errorf("error parsing GCS URL: %s", err) + } + + return "gcs::" + url.String(), true, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go new file mode 100644 index 0000000000..94e1ec42b2 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go @@ -0,0 +1,41 @@ +package getter + +import ( + "testing" +) + +func TestGCSDetector(t *testing.T) { + cases := []struct { + Input string + Output string + }{ + { + "www.googleapis.com/storage/v1/bucket/foo", + "gcs::https://www.googleapis.com/storage/v1/bucket/foo", + }, + { + "www.googleapis.com/storage/v1/bucket/foo/bar", + "gcs::https://www.googleapis.com/storage/v1/bucket/foo/bar", + }, + { + "www.googleapis.com/storage/v1/foo/bar.baz", + "gcs::https://www.googleapis.com/storage/v1/foo/bar.baz", + }, + } + + pwd := "/pwd" + f := new(GCSDetector) + for i, tc := range cases { + output, ok, err := f.Detect(tc.Input, pwd) + if err != nil { + t.Fatalf("err: %s", err) + } + if !ok { + t.Fatal("not ok") + } + + if output != tc.Output { + t.Fatalf("%d: bad: %#v", i, output) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go new file mode 100644 index 0000000000..eeb8a04c5e --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go @@ -0,0 +1,26 @@ +package getter + +// GitDetector implements Detector to detect Git SSH URLs such as +// git@host.com:dir1/dir2 and converts them to proper URLs. +type GitDetector struct{} + +func (d *GitDetector) Detect(src, _ string) (string, bool, error) { + if len(src) == 0 { + return "", false, nil + } + + u, err := detectSSH(src) + if err != nil { + return "", true, err + } + if u == nil { + return "", false, nil + } + + // We require the username to be "git" to assume that this is a Git URL + if u.User.Username() != "git" { + return "", false, nil + } + + return "git::" + u.String(), true, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go new file mode 100644 index 0000000000..a71dde2c31 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go @@ -0,0 +1,69 @@ +package getter + +import ( + "testing" +) + +func TestGitDetector(t *testing.T) { + cases := []struct { + Input string + Output string + }{ + { + "git@github.com:hashicorp/foo.git", + "git::ssh://git@github.com/hashicorp/foo.git", + }, + { + "git@github.com:org/project.git?ref=test-branch", + "git::ssh://git@github.com/org/project.git?ref=test-branch", + }, + { + "git@github.com:hashicorp/foo.git//bar", + "git::ssh://git@github.com/hashicorp/foo.git//bar", + }, + { + "git@github.com:hashicorp/foo.git?foo=bar", + "git::ssh://git@github.com/hashicorp/foo.git?foo=bar", + }, + { + "git@github.xyz.com:org/project.git", + "git::ssh://git@github.xyz.com/org/project.git", + }, + { + "git@github.xyz.com:org/project.git?ref=test-branch", + "git::ssh://git@github.xyz.com/org/project.git?ref=test-branch", + }, + { + "git@github.xyz.com:org/project.git//module/a", + "git::ssh://git@github.xyz.com/org/project.git//module/a", + }, + { + "git@github.xyz.com:org/project.git//module/a?ref=test-branch", + "git::ssh://git@github.xyz.com/org/project.git//module/a?ref=test-branch", + }, + { + // Already in the canonical form, so no rewriting required + // When the ssh: protocol is used explicitly, we recognize it as + // URL form rather than SCP-like form, so the part after the colon + // is a port number, not part of the path. + "git::ssh://git@git.example.com:2222/hashicorp/foo.git", + "git::ssh://git@git.example.com:2222/hashicorp/foo.git", + }, + } + + pwd := "/pwd" + f := new(GitDetector) + ds := []Detector{f} + for _, tc := range cases { + t.Run(tc.Input, func(t *testing.T) { + output, err := Detect(tc.Input, pwd, ds) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + + if output != tc.Output { + t.Errorf("wrong result\ninput: %s\ngot: %s\nwant: %s", tc.Input, output, tc.Output) + } + }) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go new file mode 100644 index 0000000000..4bf4daf238 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go @@ -0,0 +1,47 @@ +package getter + +import ( + "fmt" + "net/url" + "strings" +) + +// GitHubDetector implements Detector to detect GitHub URLs and turn +// them into URLs that the Git Getter can understand. +type GitHubDetector struct{} + +func (d *GitHubDetector) Detect(src, _ string) (string, bool, error) { + if len(src) == 0 { + return "", false, nil + } + + if strings.HasPrefix(src, "github.com/") { + return d.detectHTTP(src) + } + + return "", false, nil +} + +func (d *GitHubDetector) detectHTTP(src string) (string, bool, error) { + parts := strings.Split(src, "/") + if len(parts) < 3 { + return "", false, fmt.Errorf( + "GitHub URLs should be github.com/username/repo") + } + + urlStr := fmt.Sprintf("https://%s", strings.Join(parts[:3], "/")) + url, err := url.Parse(urlStr) + if err != nil { + return "", true, fmt.Errorf("error parsing GitHub URL: %s", err) + } + + if !strings.HasSuffix(url.Path, ".git") { + url.Path += ".git" + } + + if len(parts) > 3 { + url.Path += "//" + strings.Join(parts[3:], "/") + } + + return "git::" + url.String(), true, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go new file mode 100644 index 0000000000..70f1c83291 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go @@ -0,0 +1,44 @@ +package getter + +import ( + "testing" +) + +func TestGitHubDetector(t *testing.T) { + cases := []struct { + Input string + Output string + }{ + // HTTP + {"github.com/hashicorp/foo", "git::https://github.com/hashicorp/foo.git"}, + {"github.com/hashicorp/foo.git", "git::https://github.com/hashicorp/foo.git"}, + { + "github.com/hashicorp/foo/bar", + "git::https://github.com/hashicorp/foo.git//bar", + }, + { + "github.com/hashicorp/foo?foo=bar", + "git::https://github.com/hashicorp/foo.git?foo=bar", + }, + { + "github.com/hashicorp/foo.git?foo=bar", + "git::https://github.com/hashicorp/foo.git?foo=bar", + }, + } + + pwd := "/pwd" + f := new(GitHubDetector) + for i, tc := range cases { + output, ok, err := f.Detect(tc.Input, pwd) + if err != nil { + t.Fatalf("err: %s", err) + } + if !ok { + t.Fatal("not ok") + } + + if output != tc.Output { + t.Fatalf("%d: bad: %#v", i, output) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go new file mode 100644 index 0000000000..9d1e8d83cd --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go @@ -0,0 +1,47 @@ +package getter + +import ( + "fmt" + "net/url" + "strings" +) + +// GitLabDetector implements Detector to detect GitLab URLs and turn +// them into URLs that the Git Getter can understand. +type GitLabDetector struct{} + +func (d *GitLabDetector) Detect(src, _ string) (string, bool, error) { + if len(src) == 0 { + return "", false, nil + } + + if strings.HasPrefix(src, "gitlab.com/") { + return d.detectHTTP(src) + } + + return "", false, nil +} + +func (d *GitLabDetector) detectHTTP(src string) (string, bool, error) { + parts := strings.Split(src, "/") + if len(parts) < 3 { + return "", false, fmt.Errorf( + "GitLab URLs should be gitlab.com/username/repo") + } + + urlStr := fmt.Sprintf("https://%s", strings.Join(parts[:3], "/")) + repoUrl, err := url.Parse(urlStr) + if err != nil { + return "", true, fmt.Errorf("error parsing GitLab URL: %s", err) + } + + if !strings.HasSuffix(repoUrl.Path, ".git") { + repoUrl.Path += ".git" + } + + if len(parts) > 3 { + repoUrl.Path += "//" + strings.Join(parts[3:], "/") + } + + return "git::" + repoUrl.String(), true, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go new file mode 100644 index 0000000000..f1f85af3c0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go @@ -0,0 +1,44 @@ +package getter + +import ( + "testing" +) + +func TestGitLabDetector(t *testing.T) { + cases := []struct { + Input string + Output string + }{ + // HTTP + {"gitlab.com/hashicorp/foo", "git::https://gitlab.com/hashicorp/foo.git"}, + {"gitlab.com/hashicorp/foo.git", "git::https://gitlab.com/hashicorp/foo.git"}, + { + "gitlab.com/hashicorp/foo/bar", + "git::https://gitlab.com/hashicorp/foo.git//bar", + }, + { + "gitlab.com/hashicorp/foo?foo=bar", + "git::https://gitlab.com/hashicorp/foo.git?foo=bar", + }, + { + "gitlab.com/hashicorp/foo.git?foo=bar", + "git::https://gitlab.com/hashicorp/foo.git?foo=bar", + }, + } + + pwd := "/pwd" + f := new(GitLabDetector) + for i, tc := range cases { + output, ok, err := f.Detect(tc.Input, pwd) + if err != nil { + t.Fatalf("err: %s", err) + } + if !ok { + t.Fatal("not ok") + } + + if output != tc.Output { + t.Fatalf("%d: bad: %#v", i, output) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go new file mode 100644 index 0000000000..89f3c35dcf --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go @@ -0,0 +1,73 @@ +package getter + +import ( + "fmt" + "net/url" + "strings" +) + +// S3Detector implements Detector to detect S3 URLs and turn +// them into URLs that the S3 getter can understand. +type S3Detector struct{} + +func (d *S3Detector) Detect(src, _ string) (string, bool, error) { + if len(src) == 0 { + return "", false, nil + } + + if strings.Contains(src, ".amazonaws.com/") { + return d.detectHTTP(src) + } + + return "", false, nil +} + +func (d *S3Detector) detectHTTP(src string) (string, bool, error) { + parts := strings.Split(src, "/") + if len(parts) < 2 { + return "", false, fmt.Errorf( + "URL is not a valid S3 URL") + } + + hostParts := strings.Split(parts[0], ".") + if len(hostParts) == 3 { + return d.detectPathStyle(hostParts[0], parts[1:]) + } else if len(hostParts) == 4 { + return d.detectVhostStyle(hostParts[1], hostParts[0], parts[1:]) + } else if len(hostParts) == 5 && hostParts[1] == "s3" { + return d.detectNewVhostStyle(hostParts[2], hostParts[0], parts[1:]) + } else { + return "", false, fmt.Errorf( + "URL is not a valid S3 URL") + } +} + +func (d *S3Detector) detectPathStyle(region string, parts []string) (string, bool, error) { + urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s", region, strings.Join(parts, "/")) + url, err := url.Parse(urlStr) + if err != nil { + return "", false, fmt.Errorf("error parsing S3 URL: %s", err) + } + + return "s3::" + url.String(), true, nil +} + +func (d *S3Detector) detectVhostStyle(region, bucket string, parts []string) (string, bool, error) { + urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s/%s", region, bucket, strings.Join(parts, "/")) + url, err := url.Parse(urlStr) + if err != nil { + return "", false, fmt.Errorf("error parsing S3 URL: %s", err) + } + + return "s3::" + url.String(), true, nil +} + +func (d *S3Detector) detectNewVhostStyle(region, bucket string, parts []string) (string, bool, error) { + urlStr := fmt.Sprintf("https://s3.%s.amazonaws.com/%s/%s", region, bucket, strings.Join(parts, "/")) + url, err := url.Parse(urlStr) + if err != nil { + return "", false, fmt.Errorf("error parsing S3 URL: %s", err) + } + + return "s3::" + url.String(), true, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go new file mode 100644 index 0000000000..6aceafd8f3 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go @@ -0,0 +1,89 @@ +package getter + +import ( + "testing" +) + +func TestS3Detector(t *testing.T) { + cases := []struct { + Input string + Output string + }{ + // Virtual hosted style + { + "bucket.s3.amazonaws.com/foo", + "s3::https://s3.amazonaws.com/bucket/foo", + }, + { + "bucket.s3.amazonaws.com/foo/bar", + "s3::https://s3.amazonaws.com/bucket/foo/bar", + }, + { + "bucket.s3.amazonaws.com/foo/bar.baz", + "s3::https://s3.amazonaws.com/bucket/foo/bar.baz", + }, + { + "bucket.s3-eu-west-1.amazonaws.com/foo", + "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo", + }, + { + "bucket.s3-eu-west-1.amazonaws.com/foo/bar", + "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar", + }, + { + "bucket.s3-eu-west-1.amazonaws.com/foo/bar.baz", + "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz", + }, + // 5 parts Virtual hosted-style + { + "bucket.s3.eu-west-1.amazonaws.com/foo/bar.baz", + "s3::https://s3.eu-west-1.amazonaws.com/bucket/foo/bar.baz", + }, + // Path style + { + "s3.amazonaws.com/bucket/foo", + "s3::https://s3.amazonaws.com/bucket/foo", + }, + { + "s3.amazonaws.com/bucket/foo/bar", + "s3::https://s3.amazonaws.com/bucket/foo/bar", + }, + { + "s3.amazonaws.com/bucket/foo/bar.baz", + "s3::https://s3.amazonaws.com/bucket/foo/bar.baz", + }, + { + "s3-eu-west-1.amazonaws.com/bucket/foo", + "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo", + }, + { + "s3-eu-west-1.amazonaws.com/bucket/foo/bar", + "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar", + }, + { + "s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz", + "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz", + }, + // Misc tests + { + "s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz?version=1234", + "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz?version=1234", + }, + } + + pwd := "/pwd" + f := new(S3Detector) + for i, tc := range cases { + output, ok, err := f.Detect(tc.Input, pwd) + if err != nil { + t.Fatalf("err: %s", err) + } + if !ok { + t.Fatal("not ok") + } + + if output != tc.Output { + t.Fatalf("%d: bad: %#v", i, output) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go new file mode 100644 index 0000000000..c0dbe9d475 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go @@ -0,0 +1,49 @@ +package getter + +import ( + "fmt" + "net/url" + "regexp" + "strings" +) + +// Note that we do not have an SSH-getter currently so this file serves +// only to hold the detectSSH helper that is used by other detectors. + +// sshPattern matches SCP-like SSH patterns (user@host:path) +var sshPattern = regexp.MustCompile("^(?:([^@]+)@)?([^:]+):/?(.+)$") + +// detectSSH determines if the src string matches an SSH-like URL and +// converts it into a net.URL compatible string. This returns nil if the +// string doesn't match the SSH pattern. +// +// This function is tested indirectly via detect_git_test.go +func detectSSH(src string) (*url.URL, error) { + matched := sshPattern.FindStringSubmatch(src) + if matched == nil { + return nil, nil + } + + user := matched[1] + host := matched[2] + path := matched[3] + qidx := strings.Index(path, "?") + if qidx == -1 { + qidx = len(path) + } + + var u url.URL + u.Scheme = "ssh" + u.User = url.User(user) + u.Host = host + u.Path = path[0:qidx] + if qidx < len(path) { + q, err := url.ParseQuery(path[qidx+1:]) + if err != nil { + return nil, fmt.Errorf("error parsing GitHub SSH URL: %s", err) + } + u.RawQuery = q.Encode() + } + + return &u, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go new file mode 100644 index 0000000000..9bef662a7b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go @@ -0,0 +1,92 @@ +package getter + +import ( + "fmt" + "testing" +) + +func TestDetect(t *testing.T) { + cases := []struct { + Input string + Pwd string + Output string + Err bool + }{ + {"./foo", "/foo", "file:///foo/foo", false}, + {"git::./foo", "/foo", "git::file:///foo/foo", false}, + { + "git::github.com/hashicorp/foo", + "", + "git::https://github.com/hashicorp/foo.git", + false, + }, + { + "./foo//bar", + "/foo", + "file:///foo/foo//bar", + false, + }, + { + "git::github.com/hashicorp/foo//bar", + "", + "git::https://github.com/hashicorp/foo.git//bar", + false, + }, + { + "git::https://github.com/hashicorp/consul.git", + "", + "git::https://github.com/hashicorp/consul.git", + false, + }, + { + "git::https://person@someothergit.com/foo/bar", + "", + "git::https://person@someothergit.com/foo/bar", + false, + }, + { + "git::https://person@someothergit.com/foo/bar", + "/bar", + "git::https://person@someothergit.com/foo/bar", + false, + }, + { + "./foo/archive//*", + "/bar", + "file:///bar/foo/archive//*", + false, + }, + + // https://github.com/hashicorp/go-getter/pull/124 + { + "git::ssh://git@my.custom.git/dir1/dir2", + "", + "git::ssh://git@my.custom.git/dir1/dir2", + false, + }, + { + "git::git@my.custom.git:dir1/dir2", + "/foo", + "git::ssh://git@my.custom.git/dir1/dir2", + false, + }, + { + "git::git@my.custom.git:dir1/dir2", + "", + "git::ssh://git@my.custom.git/dir1/dir2", + false, + }, + } + + for i, tc := range cases { + t.Run(fmt.Sprintf("%d %s", i, tc.Input), func(t *testing.T) { + output, err := Detect(tc.Input, tc.Pwd, Detectors) + if err != nil != tc.Err { + t.Fatalf("%d: bad err: %s", i, err) + } + if output != tc.Output { + t.Fatalf("%d: bad output: %s\nexpected: %s", i, output, tc.Output) + } + }) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go b/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go new file mode 100644 index 0000000000..647ccf4592 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go @@ -0,0 +1,65 @@ +package getter + +import ( + "crypto/md5" + "encoding/hex" + "fmt" + "os" + "path/filepath" +) + +// FolderStorage is an implementation of the Storage interface that manages +// modules on the disk. +type FolderStorage struct { + // StorageDir is the directory where the modules will be stored. + StorageDir string +} + +// Dir implements Storage.Dir +func (s *FolderStorage) Dir(key string) (d string, e bool, err error) { + d = s.dir(key) + _, err = os.Stat(d) + if err == nil { + // Directory exists + e = true + return + } + if os.IsNotExist(err) { + // Directory doesn't exist + d = "" + e = false + err = nil + return + } + + // An error + d = "" + e = false + return +} + +// Get implements Storage.Get +func (s *FolderStorage) Get(key string, source string, update bool) error { + dir := s.dir(key) + if !update { + if _, err := os.Stat(dir); err == nil { + // If the directory already exists, then we're done since + // we're not updating. + return nil + } else if !os.IsNotExist(err) { + // If the error we got wasn't a file-not-exist error, then + // something went wrong and we should report it. + return fmt.Errorf("Error reading module directory: %s", err) + } + } + + // Get the source. This always forces an update. + return Get(dir, source) +} + +// dir returns the directory name internally that we'll use to map to +// internally. +func (s *FolderStorage) dir(key string) string { + sum := md5.Sum([]byte(key)) + return filepath.Join(s.StorageDir, hex.EncodeToString(sum[:])) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go new file mode 100644 index 0000000000..feb8d34252 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go @@ -0,0 +1,48 @@ +package getter + +import ( + "os" + "path/filepath" + "testing" +) + +func TestFolderStorage_impl(t *testing.T) { + var _ Storage = new(FolderStorage) +} + +func TestFolderStorage(t *testing.T) { + s := &FolderStorage{StorageDir: tempDir(t)} + + module := testModule("basic") + + // A module shouldn't exist at first... + _, ok, err := s.Dir(module) + if err != nil { + t.Fatalf("err: %s", err) + } + if ok { + t.Fatal("should not exist") + } + + key := "foo" + + // We can get it + err = s.Get(key, module, false) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Now the module exists + dir, ok, err := s.Dir(key) + if err != nil { + t.Fatalf("err: %s", err) + } + if !ok { + t.Fatal("should exist") + } + + mainPath := filepath.Join(dir, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get.go b/test/integration/licenses/github.com/hashicorp/go-getter/get.go new file mode 100644 index 0000000000..c233763c67 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get.go @@ -0,0 +1,152 @@ +// getter is a package for downloading files or directories from a variety of +// protocols. +// +// getter is unique in its ability to download both directories and files. +// It also detects certain source strings to be protocol-specific URLs. For +// example, "github.com/hashicorp/go-getter" would turn into a Git URL and +// use the Git protocol. +// +// Protocols and detectors are extensible. +// +// To get started, see Client. +package getter + +import ( + "bytes" + "fmt" + "net/url" + "os/exec" + "regexp" + "syscall" + + cleanhttp "github.com/hashicorp/go-cleanhttp" +) + +// Getter defines the interface that schemes must implement to download +// things. +type Getter interface { + // Get downloads the given URL into the given directory. This always + // assumes that we're updating and gets the latest version that it can. + // + // The directory may already exist (if we're updating). If it is in a + // format that isn't understood, an error should be returned. Get shouldn't + // simply nuke the directory. + Get(string, *url.URL) error + + // GetFile downloads the give URL into the given path. The URL must + // reference a single file. If possible, the Getter should check if + // the remote end contains the same file and no-op this operation. + GetFile(string, *url.URL) error + + // ClientMode returns the mode based on the given URL. This is used to + // allow clients to let the getters decide which mode to use. + ClientMode(*url.URL) (ClientMode, error) + + // SetClient allows a getter to know it's client + // in order to access client's Get functions or + // progress tracking. + SetClient(*Client) +} + +// Getters is the mapping of scheme to the Getter implementation that will +// be used to get a dependency. +var Getters map[string]Getter + +// forcedRegexp is the regular expression that finds forced getters. This +// syntax is schema::url, example: git::https://foo.com +var forcedRegexp = regexp.MustCompile(`^([A-Za-z0-9]+)::(.+)$`) + +// httpClient is the default client to be used by HttpGetters. +var httpClient = cleanhttp.DefaultClient() + +func init() { + httpGetter := &HttpGetter{ + Netrc: true, + } + + Getters = map[string]Getter{ + "file": new(FileGetter), + "git": new(GitGetter), + "gcs": new(GCSGetter), + "hg": new(HgGetter), + "s3": new(S3Getter), + "http": httpGetter, + "https": httpGetter, + } +} + +// Get downloads the directory specified by src into the folder specified by +// dst. If dst already exists, Get will attempt to update it. +// +// src is a URL, whereas dst is always just a file path to a folder. This +// folder doesn't need to exist. It will be created if it doesn't exist. +func Get(dst, src string, opts ...ClientOption) error { + return (&Client{ + Src: src, + Dst: dst, + Dir: true, + Options: opts, + }).Get() +} + +// GetAny downloads a URL into the given destination. Unlike Get or +// GetFile, both directories and files are supported. +// +// dst must be a directory. If src is a file, it will be downloaded +// into dst with the basename of the URL. If src is a directory or +// archive, it will be unpacked directly into dst. +func GetAny(dst, src string, opts ...ClientOption) error { + return (&Client{ + Src: src, + Dst: dst, + Mode: ClientModeAny, + Options: opts, + }).Get() +} + +// GetFile downloads the file specified by src into the path specified by +// dst. +func GetFile(dst, src string, opts ...ClientOption) error { + return (&Client{ + Src: src, + Dst: dst, + Dir: false, + Options: opts, + }).Get() +} + +// getRunCommand is a helper that will run a command and capture the output +// in the case an error happens. +func getRunCommand(cmd *exec.Cmd) error { + var buf bytes.Buffer + cmd.Stdout = &buf + cmd.Stderr = &buf + err := cmd.Run() + if err == nil { + return nil + } + if exiterr, ok := err.(*exec.ExitError); ok { + // The program has exited with an exit code != 0 + if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { + return fmt.Errorf( + "%s exited with %d: %s", + cmd.Path, + status.ExitStatus(), + buf.String()) + } + } + + return fmt.Errorf("error running %s: %s", cmd.Path, buf.String()) +} + +// getForcedGetter takes a source and returns the tuple of the forced +// getter and the raw URL (without the force syntax). +func getForcedGetter(src string) (string, string) { + var forced string + if ms := forcedRegexp.FindStringSubmatch(src); ms != nil { + forced = ms[1] + src = ms[2] + } + + return forced, src +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_base.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_base.go new file mode 100644 index 0000000000..09e9b6313b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_base.go @@ -0,0 +1,20 @@ +package getter + +import "context" + +// getter is our base getter; it regroups +// fields all getters have in common. +type getter struct { + client *Client +} + +func (g *getter) SetClient(c *Client) { g.client = c } + +// Context tries to returns the Contex from the getter's +// client. otherwise context.Background() is returned. +func (g *getter) Context() context.Context { + if g == nil || g.client == nil { + return context.Background() + } + return g.client.Ctx +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file.go new file mode 100644 index 0000000000..78660839a0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_file.go @@ -0,0 +1,36 @@ +package getter + +import ( + "net/url" + "os" +) + +// FileGetter is a Getter implementation that will download a module from +// a file scheme. +type FileGetter struct { + getter + + // Copy, if set to true, will copy data instead of using a symlink. If + // false, attempts to symlink to speed up the operation and to lower the + // disk space usage. If the symlink fails, may attempt to copy on windows. + Copy bool +} + +func (g *FileGetter) ClientMode(u *url.URL) (ClientMode, error) { + path := u.Path + if u.RawPath != "" { + path = u.RawPath + } + + fi, err := os.Stat(path) + if err != nil { + return 0, err + } + + // Check if the source is a directory. + if fi.IsDir() { + return ClientModeDir, nil + } + + return ClientModeFile, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go new file mode 100644 index 0000000000..6eeda23ca9 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go @@ -0,0 +1,86 @@ +package getter + +import ( + "context" + "fmt" + "io" + "os" +) + +// readerFunc is syntactic sugar for read interface. +type readerFunc func(p []byte) (n int, err error) + +func (rf readerFunc) Read(p []byte) (n int, err error) { return rf(p) } + +// Copy is a io.Copy cancellable by context +func Copy(ctx context.Context, dst io.Writer, src io.Reader) (int64, error) { + // Copy will call the Reader and Writer interface multiple time, in order + // to copy by chunk (avoiding loading the whole file in memory). + return io.Copy(dst, readerFunc(func(p []byte) (int, error) { + + select { + case <-ctx.Done(): + // context has been canceled + // stop process and propagate "context canceled" error + return 0, ctx.Err() + default: + // otherwise just run default io.Reader implementation + return src.Read(p) + } + })) +} + +// copyReader copies from an io.Reader into a file, using umask to create the dst file +func copyReader(dst string, src io.Reader, fmode, umask os.FileMode) error { + dstF, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, fmode) + if err != nil { + return err + } + defer dstF.Close() + + _, err = io.Copy(dstF, src) + if err != nil { + return err + } + + // Explicitly chmod; the process umask is unconditionally applied otherwise. + // We'll mask the mode with our own umask, but that may be different than + // the process umask + return os.Chmod(dst, mode(fmode, umask)) +} + +// copyFile copies a file in chunks from src path to dst path, using umask to create the dst file +func copyFile(ctx context.Context, dst, src string, disableSymlinks bool, fmode, umask os.FileMode) (int64, error) { + if disableSymlinks { + fileInfo, err := os.Lstat(src) + if err != nil { + return 0, fmt.Errorf("failed to check copy file source for symlinks: %w", err) + } + if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { + return 0, ErrSymlinkCopy + } + } + + srcF, err := os.Open(src) + if err != nil { + return 0, err + } + defer srcF.Close() + + dstF, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, fmode) + if err != nil { + return 0, err + } + defer dstF.Close() + + count, err := Copy(ctx, dstF, srcF) + if err != nil { + return 0, err + } + + // Explicitly chmod; the process umask is unconditionally applied otherwise. + // We'll mask the mode with our own umask, but that may be different than + // the process umask + err = os.Chmod(dst, mode(fmode, umask)) + return count, err +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go new file mode 100644 index 0000000000..659edd2003 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go @@ -0,0 +1,82 @@ +package getter + +import ( + "bytes" + "context" + "io" + "testing" + "time" +) + +// OneDoneContext is a context that is +// cancelled after a first done is called. +type OneDoneContext bool + +func (*OneDoneContext) Deadline() (deadline time.Time, ok bool) { return } +func (*OneDoneContext) Value(key interface{}) interface{} { return nil } + +func (o *OneDoneContext) Err() error { + if *o == false { + return nil + } + return context.Canceled +} + +func (o *OneDoneContext) Done() <-chan struct{} { + if *o == false { + *o = true + return nil + } + c := make(chan struct{}) + close(c) + return c +} + +func (o *OneDoneContext) String() string { + if *o { + return "done OneDoneContext" + } + return "OneDoneContext" +} + +func TestCopy(t *testing.T) { + const text3lines = `line1 + line2 + line3 + ` + + cancelledContext, cancel := context.WithCancel(context.Background()) + _ = cancelledContext + cancel() + type args struct { + ctx context.Context + src io.Reader + } + tests := []struct { + name string + args args + want int64 + wantDst string + wantErr error + }{ + {"read all", args{context.Background(), bytes.NewBufferString(text3lines)}, int64(len(text3lines)), text3lines, nil}, + {"read none", args{cancelledContext, bytes.NewBufferString(text3lines)}, 0, "", context.Canceled}, + {"cancel after read", args{new(OneDoneContext), bytes.NewBufferString(text3lines)}, int64(len(text3lines)), text3lines, context.Canceled}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + dst := &bytes.Buffer{} + got, err := Copy(tt.args.ctx, dst, tt.args.src) + if err != tt.wantErr { + t.Errorf("Copy() error = %v, wantErr %v", err, tt.wantErr) + return + } + if got != tt.want { + t.Errorf("Copy() = %v, want %v", got, tt.want) + } + if gotDst := dst.String(); gotDst != tt.wantDst { + t.Errorf("Copy() = %v, want %v", gotDst, tt.wantDst) + } + }) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go new file mode 100644 index 0000000000..94ab3c1c14 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go @@ -0,0 +1,204 @@ +package getter + +import ( + "os" + "path/filepath" + "testing" +) + +func TestFileGetter_impl(t *testing.T) { + var _ Getter = new(FileGetter) +} + +func TestFileGetter(t *testing.T) { + g := new(FileGetter) + dst := tempDir(t) + + // With a dir that doesn't exist + if err := g.Get(dst, testModuleURL("basic")); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the destination folder is a symlink + fi, err := os.Lstat(dst) + if err != nil { + t.Fatalf("err: %s", err) + } + if fi.Mode()&os.ModeSymlink == 0 { + t.Fatal("destination is not a symlink") + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestFileGetter_sourceFile(t *testing.T) { + g := new(FileGetter) + dst := tempDir(t) + + // With a source URL that is a path to a file + u := testModuleURL("basic") + u.Path += "/main.tf" + if err := g.Get(dst, u); err == nil { + t.Fatal("should error") + } +} + +func TestFileGetter_sourceNoExist(t *testing.T) { + g := new(FileGetter) + dst := tempDir(t) + + // With a source URL that doesn't exist + u := testModuleURL("basic") + u.Path += "/main" + if err := g.Get(dst, u); err == nil { + t.Fatal("should error") + } +} + +func TestFileGetter_dir(t *testing.T) { + g := new(FileGetter) + dst := tempDir(t) + + if err := os.MkdirAll(dst, 0755); err != nil { + t.Fatalf("err: %s", err) + } + + // With a dir that exists that isn't a symlink + if err := g.Get(dst, testModuleURL("basic")); err == nil { + t.Fatal("should error") + } +} + +func TestFileGetter_dirSymlink(t *testing.T) { + g := new(FileGetter) + dst := tempDir(t) + dst2 := tempDir(t) + + // Make parents + if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { + t.Fatalf("err: %s", err) + } + if err := os.MkdirAll(dst2, 0755); err != nil { + t.Fatalf("err: %s", err) + } + + // Make a symlink + if err := os.Symlink(dst2, dst); err != nil { + t.Fatalf("err: %s", err) + } + + // With a dir that exists that isn't a symlink + if err := g.Get(dst, testModuleURL("basic")); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestFileGetter_GetFile(t *testing.T) { + g := new(FileGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // With a dir that doesn't exist + if err := g.GetFile(dst, testModuleURL("basic-file/foo.txt")); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the destination folder is a symlink + fi, err := os.Lstat(dst) + if err != nil { + t.Fatalf("err: %s", err) + } + if fi.Mode()&os.ModeSymlink == 0 { + t.Fatal("destination is not a symlink") + } + + // Verify the main file exists + assertContents(t, dst, "Hello\n") +} + +func TestFileGetter_GetFile_Copy(t *testing.T) { + g := new(FileGetter) + g.Copy = true + + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // With a dir that doesn't exist + if err := g.GetFile(dst, testModuleURL("basic-file/foo.txt")); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the destination folder is a symlink + fi, err := os.Lstat(dst) + if err != nil { + t.Fatalf("err: %s", err) + } + if fi.Mode()&os.ModeSymlink != 0 { + t.Fatal("destination is a symlink") + } + + // Verify the main file exists + assertContents(t, dst, "Hello\n") +} + +// https://github.com/hashicorp/terraform/issues/8418 +func TestFileGetter_percent2F(t *testing.T) { + g := new(FileGetter) + dst := tempDir(t) + + // With a dir that doesn't exist + if err := g.Get(dst, testModuleURL("basic%2Ftest")); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestFileGetter_ClientMode_notexist(t *testing.T) { + g := new(FileGetter) + + u := testURL("nonexistent") + if _, err := g.ClientMode(u); err == nil { + t.Fatal("expect source file error") + } +} + +func TestFileGetter_ClientMode_file(t *testing.T) { + g := new(FileGetter) + + // Check the client mode when pointed at a file. + mode, err := g.ClientMode(testModuleURL("basic-file/foo.txt")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeFile { + t.Fatal("expect ClientModeFile") + } +} + +func TestFileGetter_ClientMode_dir(t *testing.T) { + g := new(FileGetter) + + // Check the client mode when pointed at a directory. + mode, err := g.ClientMode(testModuleURL("basic")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeDir { + t.Fatal("expect ClientModeDir") + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go new file mode 100644 index 0000000000..a14a38263e --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go @@ -0,0 +1,99 @@ +// +build !windows + +package getter + +import ( + "fmt" + "net/url" + "os" + "path/filepath" +) + +func (g *FileGetter) Get(dst string, u *url.URL) error { + path := u.Path + if u.RawPath != "" { + path = u.RawPath + } + + // The source path must exist and be a directory to be usable. + if fi, err := os.Stat(path); err != nil { + return fmt.Errorf("source path error: %s", err) + } else if !fi.IsDir() { + return fmt.Errorf("source path must be a directory") + } + + fi, err := os.Lstat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + + // If the destination already exists, it must be a symlink + if err == nil { + mode := fi.Mode() + if mode&os.ModeSymlink == 0 { + return fmt.Errorf("destination exists and is not a symlink") + } + + // Remove the destination + if err := os.Remove(dst); err != nil { + return err + } + } + + // Create all the parent directories + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + return os.Symlink(path, dst) +} + +func (g *FileGetter) GetFile(dst string, u *url.URL) error { + ctx := g.Context() + path := u.Path + if u.RawPath != "" { + path = u.RawPath + } + + // The source path must exist and be a file to be usable. + var fi os.FileInfo + var err error + if fi, err = os.Stat(path); err != nil { + return fmt.Errorf("source path error: %s", err) + } else if fi.IsDir() { + return fmt.Errorf("source path must be a file") + } + + _, err = os.Lstat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + + // If the destination already exists, it must be a symlink + if err == nil { + // Remove the destination + if err := os.Remove(dst); err != nil { + return err + } + } + + // Create all the parent directories + if err = os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + // If we're not copying, just symlink and we're done + if !g.Copy { + return os.Symlink(path, dst) + } + + var disableSymlinks bool + + if g.client != nil && g.client.DisableSymlinks { + disableSymlinks = true + } + + // Copy + _, err = copyFile(ctx, dst, path, disableSymlinks, fi.Mode(), g.client.umask()) + return err +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go new file mode 100644 index 0000000000..31146f5753 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go @@ -0,0 +1,130 @@ +// +build windows + +package getter + +import ( + "fmt" + "net/url" + "os" + "os/exec" + "path/filepath" + "strings" + "syscall" +) + +func (g *FileGetter) Get(dst string, u *url.URL) error { + ctx := g.Context() + path := u.Path + if u.RawPath != "" { + path = u.RawPath + } + + // The source path must exist and be a directory to be usable. + if fi, err := os.Stat(path); err != nil { + return fmt.Errorf("source path error: %s", err) + } else if !fi.IsDir() { + return fmt.Errorf("source path must be a directory") + } + + fi, err := os.Lstat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + + // If the destination already exists, it must be a symlink + if err == nil { + mode := fi.Mode() + if mode&os.ModeSymlink == 0 { + return fmt.Errorf("destination exists and is not a symlink") + } + + // Remove the destination + if err := os.Remove(dst); err != nil { + return err + } + } + + // Create all the parent directories + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + sourcePath := toBackslash(path) + + // Use mklink to create a junction point + output, err := exec.CommandContext(ctx, "cmd", "/c", "mklink", "/J", dst, sourcePath).CombinedOutput() + if err != nil { + return fmt.Errorf("failed to run mklink %v %v: %v %q", dst, sourcePath, err, output) + } + + return nil +} + +func (g *FileGetter) GetFile(dst string, u *url.URL) error { + ctx := g.Context() + path := u.Path + if u.RawPath != "" { + path = u.RawPath + } + + // The source path must exist and be a directory to be usable. + if fi, err := os.Stat(path); err != nil { + return fmt.Errorf("source path error: %s", err) + } else if fi.IsDir() { + return fmt.Errorf("source path must be a file") + } + + _, err := os.Lstat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + + // If the destination already exists, it must be a symlink + if err == nil { + // Remove the destination + if err := os.Remove(dst); err != nil { + return err + } + } + + // Create all the parent directories + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + // If we're not copying, just symlink and we're done + if !g.Copy { + if err = os.Symlink(path, dst); err == nil { + return err + } + lerr, ok := err.(*os.LinkError) + if !ok { + return err + } + switch lerr.Err { + case syscall.ERROR_PRIVILEGE_NOT_HELD: + // no symlink privilege, let's + // fallback to a copy to avoid an error. + break + default: + return err + } + } + + var disableSymlinks bool + + if g.client != nil && g.client.DisableSymlinks { + disableSymlinks = true + } + + // Copy + _, err = copyFile(ctx, dst, path, disableSymlinks, 0666, g.client.umask()) + return err +} + +// toBackslash returns the result of replacing each slash character +// in path with a backslash ('\') character. Multiple separators are +// replaced by multiple backslashes. +func toBackslash(path string) string { + return strings.Replace(path, "/", "\\", -1) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go new file mode 100644 index 0000000000..abf2f1d4fc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go @@ -0,0 +1,220 @@ +package getter + +import ( + "context" + "fmt" + "net/url" + "os" + "path/filepath" + "strconv" + "strings" + "time" + + "golang.org/x/oauth2" + "google.golang.org/api/option" + + "cloud.google.com/go/storage" + "google.golang.org/api/iterator" +) + +// GCSGetter is a Getter implementation that will download a module from +// a GCS bucket. +type GCSGetter struct { + getter + + // Timeout sets a deadline which all GCS operations should + // complete within. Zero value means no timeout. + Timeout time.Duration +} + +func (g *GCSGetter) ClientMode(u *url.URL) (ClientMode, error) { + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + // Parse URL + bucket, object, _, err := g.parseURL(u) + if err != nil { + return 0, err + } + + client, err := g.getClient(ctx) + if err != nil { + return 0, err + } + iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) + for { + obj, err := iter.Next() + if err != nil && err != iterator.Done { + return 0, err + } + + if err == iterator.Done { + break + } + if strings.HasSuffix(obj.Name, "/") { + // A directory matched the prefix search, so this must be a directory + return ClientModeDir, nil + } else if obj.Name != object { + // A file matched the prefix search and doesn't have the same name + // as the query, so this must be a directory + return ClientModeDir, nil + } + } + // There are no directories or subdirectories, and if a match was returned, + // it was exactly equal to the prefix search. So return File mode + return ClientModeFile, nil +} + +func (g *GCSGetter) Get(dst string, u *url.URL) error { + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + // Parse URL + bucket, object, _, err := g.parseURL(u) + if err != nil { + return err + } + + // Remove destination if it already exists + _, err = os.Stat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + if err == nil { + // Remove the destination + if err := os.RemoveAll(dst); err != nil { + return err + } + } + + // Create all the parent directories + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + client, err := g.getClient(ctx) + if err != nil { + return err + } + + // Iterate through all matching objects. + iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) + for { + obj, err := iter.Next() + if err != nil && err != iterator.Done { + return err + } + if err == iterator.Done { + break + } + + if !strings.HasSuffix(obj.Name, "/") { + // Get the object destination path + objDst, err := filepath.Rel(object, obj.Name) + if err != nil { + return err + } + objDst = filepath.Join(dst, objDst) + // Download the matching object. + err = g.getObject(ctx, client, objDst, bucket, obj.Name, "") + if err != nil { + return err + } + } + } + return nil +} + +func (g *GCSGetter) GetFile(dst string, u *url.URL) error { + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + // Parse URL + bucket, object, fragment, err := g.parseURL(u) + if err != nil { + return err + } + + client, err := g.getClient(ctx) + if err != nil { + return err + } + return g.getObject(ctx, client, dst, bucket, object, fragment) +} + +func (g *GCSGetter) getObject(ctx context.Context, client *storage.Client, dst, bucket, object, fragment string) error { + var rc *storage.Reader + var err error + if fragment != "" { + generation, err := strconv.ParseInt(fragment, 10, 64) + if err != nil { + return err + } + rc, err = client.Bucket(bucket).Object(object).Generation(generation).NewReader(ctx) + } else { + rc, err = client.Bucket(bucket).Object(object).NewReader(ctx) + } + if err != nil { + return err + } + defer rc.Close() + + // Create all the parent directories + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + return copyReader(dst, rc, 0666, g.client.umask()) +} + +func (g *GCSGetter) parseURL(u *url.URL) (bucket, path, fragment string, err error) { + if strings.Contains(u.Host, "googleapis.com") { + hostParts := strings.Split(u.Host, ".") + if len(hostParts) != 3 { + err = fmt.Errorf("URL is not a valid GCS URL") + return + } + + pathParts := strings.SplitN(u.Path, "/", 5) + if len(pathParts) != 5 { + err = fmt.Errorf("URL is not a valid GCS URL") + return + } + bucket = pathParts[3] + path = pathParts[4] + fragment = u.Fragment + } + return +} + +func (g *GCSGetter) getClient(ctx context.Context) (client *storage.Client, err error) { + var opts []option.ClientOption + + if v, ok := os.LookupEnv("GOOGLE_OAUTH_ACCESS_TOKEN"); ok { + tokenSource := oauth2.StaticTokenSource(&oauth2.Token{ + AccessToken: v, + }) + opts = append(opts, option.WithTokenSource(tokenSource)) + } + + newClient, err := storage.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + return newClient, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go new file mode 100644 index 0000000000..cdd3e68c93 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go @@ -0,0 +1,261 @@ +package getter + +import ( + "io/ioutil" + "net/url" + "os" + "path/filepath" + "testing" +) + +// initGCPCredentials writes a temporary GCS credentials file if necessary and +// returns the path and a function to clean it up. allAuthenticatedUsers can +// access go-getter-test with read only access. +func initGCPCredentials(t *testing.T) func() { + if gc := os.Getenv("GOOGLE_CREDENTIALS"); gc != "" && + os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") == "" { + file, cleanup := tempFileContents(t, gc) + os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", file) + return func() { + os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", "") + cleanup() + } + } + return func() {} +} + +func TestGCSGetter_impl(t *testing.T) { + var _ Getter = new(GCSGetter) +} + +func TestGCSGetter(t *testing.T) { + defer initGCPCredentials(t)() + + g := new(GCSGetter) + dst := tempDir(t) + + // With a dir that doesn't exist + err := g.Get( + dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGCSGetter_subdir(t *testing.T) { + defer initGCPCredentials(t)() + + g := new(GCSGetter) + dst := tempDir(t) + + // With a dir that doesn't exist + err := g.Get( + dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the sub file exists + subPath := filepath.Join(dst, "sub.tf") + if _, err := os.Stat(subPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGCSGetter_GetFile(t *testing.T) { + defer initGCPCredentials(t)() + + g := new(GCSGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + err := g.GetFile( + dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/main.tf")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + if _, err := os.Stat(dst); err != nil { + t.Fatalf("err: %s", err) + } + assertContents(t, dst, "# Main\n") +} + +func TestGCSGetter_GetGenerationFile(t *testing.T) { + defer initGCPCredentials(t)() + + g := new(GCSGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + err := g.GetFile( + dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/versioned.txt#1615905097179533")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify contents are valid for this generation + content, err := ioutil.ReadFile(dst) + if err != nil { + t.Fatalf("err: %s", err) + } + if string(content) != "a\n" { + t.Fatalf("expected file contents from generation to be `a` but got `%s`", content) + } + + // Download + err = g.GetFile( + dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/versioned.txt#1615905174141919")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify contents are valid for this generation + content, err = ioutil.ReadFile(dst) + if err != nil { + t.Fatalf("err: %s", err) + } + if string(content) != "b\n" { + t.Fatalf("expected file contents from generation to be `b` but got `%s`", content) + } + +} + +func TestGCSGetter_GetFile_notfound(t *testing.T) { + g := new(GCSGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + err := g.GetFile( + dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/404.tf")) + if err == nil { + t.Fatalf("expected error, got none") + } +} + +func TestGCSGetter_ClientMode_dir(t *testing.T) { + defer initGCPCredentials(t)() + + g := new(GCSGetter) + + // Check client mode on a key prefix with only a single key. + mode, err := g.ClientMode( + testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeDir { + t.Fatal("expect ClientModeDir") + } +} + +func TestGCSGetter_ClientMode_file(t *testing.T) { + defer initGCPCredentials(t)() + + g := new(GCSGetter) + + // Check client mode on a key prefix which contains sub-keys. + mode, err := g.ClientMode( + testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder/sub.tf")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeFile { + t.Fatal("expect ClientModeFile") + } +} + +func TestGCSGetter_ClientMode_notfound(t *testing.T) { + defer initGCPCredentials(t)() + + g := new(GCSGetter) + + // Check the client mode when a non-existent key is looked up. This does not + // return an error, but rather should just return the file mode. + mode, err := g.ClientMode( + testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/foobar")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeFile { + t.Fatal("expect ClientModeFile") + } +} + +func TestGCSGetter_Url(t *testing.T) { + defer initGCPCredentials(t)() + + var gcstests = []struct { + name string + url string + bucket string + path string + }{ + { + name: "test1", + url: "gcs::https://www.googleapis.com/storage/v1/go-getter-test/go-getter/foo/null.zip", + bucket: "go-getter-test", + path: "go-getter/foo/null.zip", + }, + } + + for i, pt := range gcstests { + t.Run(pt.name, func(t *testing.T) { + g := new(GCSGetter) + forced, src := getForcedGetter(pt.url) + u, err := url.Parse(src) + + if err != nil { + t.Errorf("test %d: unexpected error: %s", i, err) + } + if forced != "gcs" { + t.Fatalf("expected forced protocol to be gcs") + } + + bucket, path, _, err := g.parseURL(u) + + if err != nil { + t.Fatalf("err: %s", err) + } + + if bucket != pt.bucket { + t.Fatalf("expected %s, got %s", pt.bucket, bucket) + } + if path != pt.path { + t.Fatalf("expected %s, got %s", pt.path, path) + } + }) + } +} + +func TestGCSGetter_GetFile_OAuthAccessToken(t *testing.T) { + if os.Getenv("GOOGLE_OAUTH_ACCESS_TOKEN") == "" { + t.Skip("Skipping; set GOOGLE_OAUTH_ACCESS_TOKEN to run") + } + g := new(GCSGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + err := g.GetFile( + dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/main.tf")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + if _, err := os.Stat(dst); err != nil { + t.Fatalf("err: %s", err) + } + assertContents(t, dst, "# Main\n") +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_git.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_git.go new file mode 100644 index 0000000000..db89edef8b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_git.go @@ -0,0 +1,376 @@ +package getter + +import ( + "bytes" + "context" + "encoding/base64" + "fmt" + "io/ioutil" + "net/url" + "os" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "strconv" + "strings" + "time" + + urlhelper "github.com/hashicorp/go-getter/helper/url" + safetemp "github.com/hashicorp/go-safetemp" + version "github.com/hashicorp/go-version" +) + +// GitGetter is a Getter implementation that will download a module from +// a git repository. +type GitGetter struct { + getter + + // Timeout sets a deadline which all git CLI operations should + // complete within. Zero value means no timeout. + Timeout time.Duration +} + +var defaultBranchRegexp = regexp.MustCompile(`\s->\sorigin/(.*)`) +var lsRemoteSymRefRegexp = regexp.MustCompile(`ref: refs/heads/([^\s]+).*`) + +func (g *GitGetter) ClientMode(_ *url.URL) (ClientMode, error) { + return ClientModeDir, nil +} + +func (g *GitGetter) Get(dst string, u *url.URL) error { + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + if _, err := exec.LookPath("git"); err != nil { + return fmt.Errorf("git must be available and on the PATH") + } + + // The port number must be parseable as an integer. If not, the user + // was probably trying to use a scp-style address, in which case the + // ssh:// prefix must be removed to indicate that. + // + // This is not necessary in versions of Go which have patched + // CVE-2019-14809 (e.g. Go 1.12.8+) + if portStr := u.Port(); portStr != "" { + if _, err := strconv.ParseUint(portStr, 10, 16); err != nil { + return fmt.Errorf("invalid port number %q; if using the \"scp-like\" git address scheme where a colon introduces the path instead, remove the ssh:// portion and use just the git:: prefix", portStr) + } + } + + // Extract some query parameters we use + var ref, sshKey string + depth := 0 // 0 means "don't use shallow clone" + q := u.Query() + if len(q) > 0 { + ref = q.Get("ref") + q.Del("ref") + + sshKey = q.Get("sshkey") + q.Del("sshkey") + + if n, err := strconv.Atoi(q.Get("depth")); err == nil { + depth = n + } + q.Del("depth") + + // Copy the URL + var newU url.URL = *u + u = &newU + u.RawQuery = q.Encode() + } + + var sshKeyFile string + if sshKey != "" { + // Check that the git version is sufficiently new. + if err := checkGitVersion(ctx, "2.3"); err != nil { + return fmt.Errorf("Error using ssh key: %v", err) + } + + // We have an SSH key - decode it. + raw, err := base64.StdEncoding.DecodeString(sshKey) + if err != nil { + return err + } + + // Create a temp file for the key and ensure it is removed. + fh, err := ioutil.TempFile("", "go-getter") + if err != nil { + return err + } + sshKeyFile = fh.Name() + defer os.Remove(sshKeyFile) + + // Set the permissions prior to writing the key material. + if err := os.Chmod(sshKeyFile, 0600); err != nil { + return err + } + + // Write the raw key into the temp file. + _, err = fh.Write(raw) + fh.Close() + if err != nil { + return err + } + } + + // Clone or update the repository + _, err := os.Stat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + if err == nil { + err = g.update(ctx, dst, sshKeyFile, ref, depth) + } else { + err = g.clone(ctx, dst, sshKeyFile, u, ref, depth) + } + if err != nil { + return err + } + + // Next: check out the proper tag/branch if it is specified, and checkout + if ref != "" { + if err := g.checkout(ctx, dst, ref); err != nil { + return err + } + } + + // Lastly, download any/all submodules. + return g.fetchSubmodules(ctx, dst, sshKeyFile, depth) +} + +// GetFile for Git doesn't support updating at this time. It will download +// the file every time. +func (g *GitGetter) GetFile(dst string, u *url.URL) error { + td, tdcloser, err := safetemp.Dir("", "getter") + if err != nil { + return err + } + defer tdcloser.Close() + + // Get the filename, and strip the filename from the URL so we can + // just get the repository directly. + filename := filepath.Base(u.Path) + u.Path = filepath.Dir(u.Path) + + // Get the full repository + if err := g.Get(td, u); err != nil { + return err + } + + // Copy the single file + u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) + if err != nil { + return err + } + + fg := &FileGetter{Copy: true} + return fg.GetFile(dst, u) +} + +func (g *GitGetter) checkout(ctx context.Context, dst string, ref string) error { + cmd := exec.CommandContext(ctx, "git", "checkout", ref) + cmd.Dir = dst + return getRunCommand(cmd) +} + +// gitCommitIDRegex is a pattern intended to match strings that seem +// "likely to be" git commit IDs, rather than named refs. This cannot be +// an exact decision because it's valid to name a branch or tag after a series +// of hexadecimal digits too. +// +// We require at least 7 digits here because that's the smallest size git +// itself will typically generate, and so it'll reduce the risk of false +// positives on short branch names that happen to also be "hex words". +var gitCommitIDRegex = regexp.MustCompile("^[0-9a-fA-F]{7,40}$") + +func (g *GitGetter) clone(ctx context.Context, dst, sshKeyFile string, u *url.URL, ref string, depth int) error { + args := []string{"clone"} + + originalRef := ref // we handle an unspecified ref differently than explicitly selecting the default branch below + if ref == "" { + ref = findRemoteDefaultBranch(ctx, u) + } + if depth > 0 { + args = append(args, "--depth", strconv.Itoa(depth)) + args = append(args, "--branch", ref) + } + args = append(args, u.String(), dst) + + cmd := exec.CommandContext(ctx, "git", args...) + setupGitEnv(cmd, sshKeyFile) + err := getRunCommand(cmd) + if err != nil { + if depth > 0 && originalRef != "" { + // If we're creating a shallow clone then the given ref must be + // a named ref (branch or tag) rather than a commit directly. + // We can't accurately recognize the resulting error here without + // hard-coding assumptions about git's human-readable output, but + // we can at least try a heuristic. + if gitCommitIDRegex.MatchString(originalRef) { + return fmt.Errorf("%w (note that setting 'depth' requires 'ref' to be a branch or tag name)", err) + } + } + return err + } + + if depth < 1 && originalRef != "" { + // If we didn't add --depth and --branch above then we will now be + // on the remote repository's default branch, rather than the selected + // ref, so we'll need to fix that before we return. + return g.checkout(ctx, dst, originalRef) + } + return nil +} + +func (g *GitGetter) update(ctx context.Context, dst, sshKeyFile, ref string, depth int) error { + // Determine if we're a branch. If we're NOT a branch, then we just + // switch to master prior to checking out + cmd := exec.CommandContext(ctx, "git", "show-ref", "-q", "--verify", "refs/heads/"+ref) + cmd.Dir = dst + + if getRunCommand(cmd) != nil { + // Not a branch, switch to default branch. This will also catch + // non-existent branches, in which case we want to switch to default + // and then checkout the proper branch later. + ref = findDefaultBranch(ctx, dst) + } + + // We have to be on a branch to pull + if err := g.checkout(ctx, dst, ref); err != nil { + return err + } + + if depth > 0 { + cmd = exec.CommandContext(ctx, "git", "pull", "--depth", strconv.Itoa(depth), "--ff-only") + } else { + cmd = exec.CommandContext(ctx, "git", "pull", "--ff-only") + } + + cmd.Dir = dst + setupGitEnv(cmd, sshKeyFile) + return getRunCommand(cmd) +} + +// fetchSubmodules downloads any configured submodules recursively. +func (g *GitGetter) fetchSubmodules(ctx context.Context, dst, sshKeyFile string, depth int) error { + args := []string{"submodule", "update", "--init", "--recursive"} + if depth > 0 { + args = append(args, "--depth", strconv.Itoa(depth)) + } + cmd := exec.CommandContext(ctx, "git", args...) + cmd.Dir = dst + setupGitEnv(cmd, sshKeyFile) + return getRunCommand(cmd) +} + +// findDefaultBranch checks the repo's origin remote for its default branch +// (generally "master"). "master" is returned if an origin default branch +// can't be determined. +func findDefaultBranch(ctx context.Context, dst string) string { + var stdoutbuf bytes.Buffer + cmd := exec.CommandContext(ctx, "git", "branch", "-r", "--points-at", "refs/remotes/origin/HEAD") + cmd.Dir = dst + cmd.Stdout = &stdoutbuf + err := cmd.Run() + matches := defaultBranchRegexp.FindStringSubmatch(stdoutbuf.String()) + if err != nil || matches == nil { + return "master" + } + return matches[len(matches)-1] +} + +// findRemoteDefaultBranch checks the remote repo's HEAD symref to return the remote repo's +// default branch. "master" is returned if no HEAD symref exists. +func findRemoteDefaultBranch(ctx context.Context, u *url.URL) string { + var stdoutbuf bytes.Buffer + cmd := exec.CommandContext(ctx, "git", "ls-remote", "--symref", u.String(), "HEAD") + cmd.Stdout = &stdoutbuf + err := cmd.Run() + matches := lsRemoteSymRefRegexp.FindStringSubmatch(stdoutbuf.String()) + if err != nil || matches == nil { + return "master" + } + return matches[len(matches)-1] +} + +// setupGitEnv sets up the environment for the given command. This is used to +// pass configuration data to git and ssh and enables advanced cloning methods. +func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) { + const gitSSHCommand = "GIT_SSH_COMMAND=" + var sshCmd []string + + // If we have an existing GIT_SSH_COMMAND, we need to append our options. + // We will also remove our old entry to make sure the behavior is the same + // with versions of Go < 1.9. + env := os.Environ() + for i, v := range env { + if strings.HasPrefix(v, gitSSHCommand) && len(v) > len(gitSSHCommand) { + sshCmd = []string{v} + + env[i], env[len(env)-1] = env[len(env)-1], env[i] + env = env[:len(env)-1] + break + } + } + + if len(sshCmd) == 0 { + sshCmd = []string{gitSSHCommand + "ssh"} + } + + if sshKeyFile != "" { + // We have an SSH key temp file configured, tell ssh about this. + if runtime.GOOS == "windows" { + sshKeyFile = strings.Replace(sshKeyFile, `\`, `/`, -1) + } + sshCmd = append(sshCmd, "-i", sshKeyFile) + } + + env = append(env, strings.Join(sshCmd, " ")) + cmd.Env = env +} + +// checkGitVersion is used to check the version of git installed on the system +// against a known minimum version. Returns an error if the installed version +// is older than the given minimum. +func checkGitVersion(ctx context.Context, min string) error { + want, err := version.NewVersion(min) + if err != nil { + return err + } + + out, err := exec.CommandContext(ctx, "git", "version").Output() + if err != nil { + return err + } + + fields := strings.Fields(string(out)) + if len(fields) < 3 { + return fmt.Errorf("Unexpected 'git version' output: %q", string(out)) + } + v := fields[2] + if runtime.GOOS == "windows" && strings.Contains(v, ".windows.") { + // on windows, git version will return for example: + // git version 2.20.1.windows.1 + // Which does not follow the semantic versionning specs + // https://semver.org. We remove that part in order for + // go-version to not error. + v = v[:strings.Index(v, ".windows.")] + } + + have, err := version.NewVersion(v) + if err != nil { + return err + } + + if have.LessThan(want) { + return fmt.Errorf("Required git version = %s, have %s", want, have) + } + + return nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go new file mode 100644 index 0000000000..df6ad03906 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go @@ -0,0 +1,913 @@ +package getter + +import ( + "bytes" + "context" + "encoding/base64" + "errors" + "fmt" + "io/ioutil" + "net/url" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" + + urlhelper "github.com/hashicorp/go-getter/helper/url" +) + +var testHasGit bool + +func init() { + if _, err := exec.LookPath("git"); err == nil { + testHasGit = true + } +} + +func TestGitGetter_impl(t *testing.T) { + var _ Getter = new(GitGetter) +} + +func TestGitGetter(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "basic") + repo.commitFile("foo.txt", "hello") + + // With a dir that doesn't exist + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "foo.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_branch(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "branch") + repo.git("checkout", "-b", "test-branch") + repo.commitFile("branch.txt", "branch") + + q := repo.url.Query() + q.Add("ref", "test-branch") + repo.url.RawQuery = q.Encode() + + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "branch.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + + // Get again should work + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath = filepath.Join(dst, "branch.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_commitID(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + // We're going to create different content on the main branch vs. + // another branch here, so that below we can recognize if we + // correctly cloned the commit actually requested (from the + // "other branch"), not the one at HEAD. + repo := testGitRepo(t, "commit_id") + repo.git("checkout", "-b", "main-branch") + repo.commitFile("wrong.txt", "Nope") + repo.git("checkout", "-b", "other-branch") + repo.commitFile("hello.txt", "Yep") + commitID, err := repo.latestCommit() + if err != nil { + t.Fatal(err) + } + // Return to the main branch so that HEAD of this repository + // will be that, rather than "test-branch". + repo.git("checkout", "main-branch") + + q := repo.url.Query() + q.Add("ref", commitID) + repo.url.RawQuery = q.Encode() + + t.Logf("Getting %s", repo.url) + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "hello.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + + // Get again should work + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath = filepath.Join(dst, "hello.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_remoteWithoutMaster(t *testing.T) { + if !testHasGit { + t.Log("git not found, skipping") + t.Skip() + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "branch") + repo.git("checkout", "-b", "test-branch") + repo.commitFile("branch.txt", "branch") + + q := repo.url.Query() + repo.url.RawQuery = q.Encode() + + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "branch.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + + // Get again should work + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath = filepath.Join(dst, "branch.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_shallowClone(t *testing.T) { + if !testHasGit { + t.Log("git not found, skipping") + t.Skip() + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "upstream") + repo.commitFile("upstream.txt", "0") + repo.commitFile("upstream.txt", "1") + + // Specifiy a clone depth of 1 + q := repo.url.Query() + q.Add("depth", "1") + repo.url.RawQuery = q.Encode() + + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Assert rev-list count is '1' + cmd := exec.Command("git", "rev-list", "HEAD", "--count") + cmd.Dir = dst + b, err := cmd.Output() + if err != nil { + t.Fatalf("err: %s", err) + } + + out := strings.TrimSpace(string(b)) + if out != "1" { + t.Fatalf("expected rev-list count to be '1' but got %v", out) + } +} + +func TestGitGetter_shallowCloneWithTag(t *testing.T) { + if !testHasGit { + t.Log("git not found, skipping") + t.Skip() + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "upstream") + repo.commitFile("v1.0.txt", "0") + repo.git("tag", "v1.0") + repo.commitFile("v1.1.txt", "1") + + // Specifiy a clone depth of 1 with a tag + q := repo.url.Query() + q.Add("ref", "v1.0") + q.Add("depth", "1") + repo.url.RawQuery = q.Encode() + + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Assert rev-list count is '1' + cmd := exec.Command("git", "rev-list", "HEAD", "--count") + cmd.Dir = dst + b, err := cmd.Output() + if err != nil { + t.Fatalf("err: %s", err) + } + + out := strings.TrimSpace(string(b)) + if out != "1" { + t.Fatalf("expected rev-list count to be '1' but got %v", out) + } + + // Verify the v1.0 file exists + mainPath := filepath.Join(dst, "v1.0.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the v1.1 file does not exists + mainPath = filepath.Join(dst, "v1.1.txt") + if _, err := os.Stat(mainPath); err == nil { + t.Fatalf("expected v1.1 file to not exist") + } +} + +func TestGitGetter_shallowCloneWithCommitID(t *testing.T) { + if !testHasGit { + t.Log("git not found, skipping") + t.Skip() + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "upstream") + repo.commitFile("v1.0.txt", "0") + repo.git("tag", "v1.0") + repo.commitFile("v1.1.txt", "1") + + commitID, err := repo.latestCommit() + if err != nil { + t.Fatal(err) + } + + // Specify a clone depth of 1 with a naked commit ID + // This is intentionally invalid: shallow clone always requires a named ref. + q := repo.url.Query() + q.Add("ref", commitID[:8]) + q.Add("depth", "1") + repo.url.RawQuery = q.Encode() + + t.Logf("Getting %s", repo.url) + err = g.Get(dst, repo.url) + if err == nil { + t.Fatalf("success; want error") + } + // We use a heuristic to generate an extra hint in the error message if + // it looks like the user was trying to combine ref=COMMIT with depth. + if got, want := err.Error(), "(note that setting 'depth' requires 'ref' to be a branch or tag name)"; !strings.Contains(got, want) { + t.Errorf("missing error message hint\ngot: %s\nwant substring: %s", got, want) + } +} + +func TestGitGetter_branchUpdate(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + // First setup the state with a fresh branch + repo := testGitRepo(t, "branch-update") + repo.git("checkout", "-b", "test-branch") + repo.commitFile("branch.txt", "branch") + + // Get the "test-branch" branch + q := repo.url.Query() + q.Add("ref", "test-branch") + repo.url.RawQuery = q.Encode() + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "branch.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + + // Commit an update to the branch + repo.commitFile("branch-update.txt", "branch-update") + + // Get again should work + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath = filepath.Join(dst, "branch-update.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_tag(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "tag") + repo.commitFile("tag.txt", "tag") + repo.git("tag", "v1.0") + + q := repo.url.Query() + q.Add("ref", "v1.0") + repo.url.RawQuery = q.Encode() + + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "tag.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + + // Get again should work + if err := g.Get(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath = filepath.Join(dst, "tag.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_GetFile(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + repo := testGitRepo(t, "file") + repo.commitFile("file.txt", "hello") + + // Download the file + repo.url.Path = filepath.Join(repo.url.Path, "file.txt") + if err := g.GetFile(dst, repo.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + if _, err := os.Stat(dst); err != nil { + t.Fatalf("err: %s", err) + } + assertContents(t, dst, "hello") +} + +func TestGitGetter_gitVersion(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + if runtime.GOOS == "windows" { + t.Skip("skipping on windows since the test requires sh") + } + dir, err := ioutil.TempDir("", "go-getter") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(dir) + + script := filepath.Join(dir, "git") + err = ioutil.WriteFile( + script, + []byte("#!/bin/sh\necho \"git version 2.0 (Some Metadata Here)\n\""), + 0700) + if err != nil { + t.Fatal(err) + } + + defer func(v string) { + os.Setenv("PATH", v) + }(os.Getenv("PATH")) + + os.Setenv("PATH", dir) + + // Asking for a higher version throws an error + if err := checkGitVersion(context.Background(), "2.3"); err == nil { + t.Fatal("expect git version error") + } + + // Passes when version is satisfied + if err := checkGitVersion(context.Background(), "1.9"); err != nil { + t.Fatal(err) + } +} + +func TestGitGetter_sshKey(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) + + // avoid getting locked by a github authenticity validation prompt + os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") + defer os.Setenv("GIT_SSH_COMMAND", "") + + u, err := urlhelper.Parse("ssh://git@github.com/hashicorp/test-private-repo" + + "?sshkey=" + encodedKey) + if err != nil { + t.Fatal(err) + } + + if err := g.Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + readmePath := filepath.Join(dst, "README.md") + if _, err := os.Stat(readmePath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_sshSCPStyle(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) + + // avoid getting locked by a github authenticity validation prompt + os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") + defer os.Setenv("GIT_SSH_COMMAND", "") + + // This test exercises the combination of the git detector and the + // git getter, to make sure that together they make scp-style URLs work. + client := &Client{ + Src: "git@github.com:hashicorp/test-private-repo?sshkey=" + encodedKey, + Dst: dst, + Pwd: ".", + + Mode: ClientModeDir, + + Detectors: []Detector{ + new(GitDetector), + }, + Getters: map[string]Getter{ + "git": g, + }, + } + + if err := client.Get(); err != nil { + t.Fatalf("client.Get failed: %s", err) + } + + readmePath := filepath.Join(dst, "README.md") + if _, err := os.Stat(readmePath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_sshExplicitPort(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) + + // avoid getting locked by a github authenticity validation prompt + os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") + defer os.Setenv("GIT_SSH_COMMAND", "") + + // This test exercises the combination of the git detector and the + // git getter, to make sure that together they make scp-style URLs work. + client := &Client{ + Src: "git::ssh://git@github.com:22/hashicorp/test-private-repo?sshkey=" + encodedKey, + Dst: dst, + Pwd: ".", + + Mode: ClientModeDir, + + Detectors: []Detector{ + new(GitDetector), + }, + Getters: map[string]Getter{ + "git": g, + }, + } + + if err := client.Get(); err != nil { + t.Fatalf("client.Get failed: %s", err) + } + + readmePath := filepath.Join(dst, "README.md") + if _, err := os.Stat(readmePath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGitGetter_sshSCPStyleInvalidScheme(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) + + // avoid getting locked by a github authenticity validation prompt + os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") + defer os.Setenv("GIT_SSH_COMMAND", "") + + // This test exercises the combination of the git detector and the + // git getter, to make sure that together they make scp-style URLs work. + client := &Client{ + Src: "git::ssh://git@github.com:hashicorp/test-private-repo?sshkey=" + encodedKey, + Dst: dst, + Pwd: ".", + + Mode: ClientModeDir, + + Detectors: []Detector{ + new(GitDetector), + }, + Getters: map[string]Getter{ + "git": g, + }, + } + + err := client.Get() + if err == nil { + t.Fatalf("get succeeded; want error") + } + + got := err.Error() + want1, want2 := `invalid source string`, `invalid port number "hashicorp"` + if !(strings.Contains(got, want1) || strings.Contains(got, want2)) { + t.Fatalf("wrong error\ngot: %s\nwant: %q or %q", got, want1, want2) + } +} + +func TestGitGetter_submodule(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + relpath := func(basepath, targpath string) string { + relpath, err := filepath.Rel(basepath, targpath) + if err != nil { + t.Fatal(err) + } + return strings.Replace(relpath, `\`, `/`, -1) + // on windows git still prefers relatives paths + // containing `/` for submodules + } + + // Set up the grandchild + gc := testGitRepo(t, "grandchild") + gc.commitFile("grandchild.txt", "grandchild") + + // Set up the child + c := testGitRepo(t, "child") + c.commitFile("child.txt", "child") + c.git("submodule", "add", "-f", relpath(c.dir, gc.dir)) + c.git("commit", "-m", "Add grandchild submodule") + + // Set up the parent + p := testGitRepo(t, "parent") + p.commitFile("parent.txt", "parent") + p.git("submodule", "add", "-f", relpath(p.dir, c.dir)) + p.git("commit", "-m", "Add child submodule") + + // Clone the root repository + if err := g.Get(dst, p.url); err != nil { + t.Fatalf("err: %s", err) + } + + // Check that the files exist + for _, path := range []string{ + filepath.Join(dst, "parent.txt"), + filepath.Join(dst, "child", "child.txt"), + filepath.Join(dst, "child", "grandchild", "grandchild.txt"), + } { + if _, err := os.Stat(path); err != nil { + t.Fatalf("err: %s", err) + } + } +} + +func TestGitGetter_setupGitEnv_sshKey(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("skipping on windows since the test requires sh") + } + + cmd := exec.Command("/bin/sh", "-c", "echo $GIT_SSH_COMMAND") + setupGitEnv(cmd, "/tmp/foo.pem") + out, err := cmd.Output() + if err != nil { + t.Fatal(err) + } + + actual := strings.TrimSpace(string(out)) + if actual != "ssh -i /tmp/foo.pem" { + t.Fatalf("unexpected GIT_SSH_COMMAND: %q", actual) + } +} + +func TestGitGetter_setupGitEnvWithExisting_sshKey(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skipf("skipping on windows since the test requires sh") + return + } + + // start with an existing ssh command configuration + os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") + defer os.Setenv("GIT_SSH_COMMAND", "") + + cmd := exec.Command("/bin/sh", "-c", "echo $GIT_SSH_COMMAND") + setupGitEnv(cmd, "/tmp/foo.pem") + out, err := cmd.Output() + if err != nil { + t.Fatal(err) + } + + actual := strings.TrimSpace(string(out)) + if actual != "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /tmp/foo.pem" { + t.Fatalf("unexpected GIT_SSH_COMMAND: %q", actual) + } +} + +func TestGitGetter_subdirectory_symlink(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + target, err := ioutil.TempFile("", "link-target") + if err != nil { + t.Fatal(err) + } + defer os.Remove(target.Name()) + + repo := testGitRepo(t, "repo-with-symlink") + innerDir := filepath.Join(repo.dir, "this-directory-contains-a-symlink") + if err := os.Mkdir(innerDir, 0700); err != nil { + t.Fatal(err) + } + path := filepath.Join(innerDir, "this-is-a-symlink") + if err := os.Symlink(target.Name(), path); err != nil { + t.Fatal(err) + } + + repo.git("add", path) + repo.git("commit", "-m", "Adding "+path) + + u, err := url.Parse(fmt.Sprintf("git::%s//this-directory-contains-a-symlink", repo.url.String())) + if err != nil { + t.Fatal(err) + } + + client := &Client{ + Src: u.String(), + Dst: dst, + Pwd: ".", + Mode: ClientModeDir, + DisableSymlinks: true, + Detectors: []Detector{ + new(GitDetector), + }, + Getters: map[string]Getter{ + "git": g, + }, + } + + err = client.Get() + + if runtime.GOOS == "windows" { + // Windows doesn't handle symlinks as one might expect with git. + // + // https://github.com/git-for-windows/git/wiki/Symbolic-Links + filepath.Walk(dst, func(path string, info os.FileInfo, err error) error { + if strings.Contains(path, "this-is-a-symlink") { + if info.Mode()&os.ModeSymlink == os.ModeSymlink { + // If you see this test fail in the future, you've probably enabled + // symlinks within git on your Windows system. Our CI/CD system does + // not do this, so this is this is the only way we can make this test + // make any sense. + t.Fatalf("windows git should not have cloned a symlink") + } + } + return nil + }) + } else { + // We can rely on POSIX compliant systems running git to do the right thing. + if err == nil { + t.Fatalf("expected client get to fail") + } + if !errors.Is(err, ErrSymlinkCopy) { + t.Fatalf("unexpected error: %v", err) + } + } + +} + +func TestGitGetter_subdirectory(t *testing.T) { + if !testHasGit { + t.Skip("git not found, skipping") + } + + g := new(GitGetter) + dst := tempDir(t) + + repo := testGitRepo(t, "empty-repo") + u, err := url.Parse(fmt.Sprintf("git::%s//../../../../../../etc/passwd", repo.url.String())) + if err != nil { + t.Fatal(err) + } + + client := &Client{ + Src: u.String(), + Dst: dst, + Pwd: ".", + + Mode: ClientModeDir, + + Detectors: []Detector{ + new(GitDetector), + }, + Getters: map[string]Getter{ + "git": g, + }, + } + + err = client.Get() + if err == nil { + t.Fatalf("expected client get to fail") + } + if !strings.Contains(err.Error(), "subdirectory component contain path traversal out of the repository") { + t.Fatalf("unexpected error: %v", err) + } +} + +// gitRepo is a helper struct which controls a single temp git repo. +type gitRepo struct { + t *testing.T + url *url.URL + dir string +} + +// testGitRepo creates a new test git repository. +func testGitRepo(t *testing.T, name string) *gitRepo { + dir, err := ioutil.TempDir("", "go-getter") + if err != nil { + t.Fatal(err) + } + dir = filepath.Join(dir, name) + if err := os.Mkdir(dir, 0700); err != nil { + t.Fatal(err) + } + + r := &gitRepo{ + t: t, + dir: dir, + } + + url, err := urlhelper.Parse("file://" + r.dir) + if err != nil { + t.Fatal(err) + } + r.url = url + + t.Logf("initializing git repo in %s", dir) + r.git("init") + r.git("config", "user.name", "go-getter") + r.git("config", "user.email", "go-getter@hashicorp.com") + + return r +} + +// git runs a git command against the repo. +func (r *gitRepo) git(args ...string) { + cmd := exec.Command("git", args...) + cmd.Dir = r.dir + bfr := bytes.NewBuffer(nil) + cmd.Stderr = bfr + if err := cmd.Run(); err != nil { + r.t.Fatal(err, bfr.String()) + } +} + +// commitFile writes and commits a text file to the repo. +func (r *gitRepo) commitFile(file, content string) { + path := filepath.Join(r.dir, file) + if err := ioutil.WriteFile(path, []byte(content), 0600); err != nil { + r.t.Fatal(err) + } + r.git("add", file) + r.git("commit", "-m", "Adding "+file) +} + +// latestCommit returns the full commit id of the latest commit on the current +// branch. +func (r *gitRepo) latestCommit() (string, error) { + cmd := exec.Command("git", "rev-parse", "HEAD") + cmd.Dir = r.dir + rawOut, err := cmd.Output() + if err != nil { + return "", err + } + rawOut = bytes.TrimSpace(rawOut) + return string(rawOut), nil +} + +// This is a read-only deploy key for an empty test repository. +// Note: This is split over multiple lines to avoid being disabled by key +// scanners automatically. +var testGitToken = `-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA9cHsxCl3Jjgu9DHpwvmfFOl1XEdY+ShHDR/cMnzJ5ddk5/oV +Wy6EWatvyHZfRSZMwzv4PtKeUPm6iXjqWp4xdWU9khlPzozyj+U9Fq70TRVUW9E5 +T1XdQVwJE421yffr4VMMwu60wBqjI1epapH2i2inYvw9Zl9X2MXq0+jTvFvDerbT +mDtfStDPljenELAIZtWVETSvbI46gALwbxbM2292ZUIL4D6jRz0aZMmyy/twYv8r +9WGJLwmYzU518Ie7zqKW/mCTdTrV0WRiDj0MeRaPgrGY9amuHE4r9iG/cJkwpKAO +Ccz0Hs6i89u9vZnTqZU9V7weJqRAQcMjXXR6yQIDAQABAoIBAQDBzICKnGxiTlHw +rd+6qqChnAy5jWYDbZjCJ8q8YZ3RS08+g/8NXZxvHftTqM0uOaq1FviHig3gq15H +hHvCpBc6jXDFYoKFzq6FfO/0kFkE5HoWweIgxwRow0xBCDJAJ+ryUEyy+Ay/pQHb +IAjwilRS0V+WdnVw4mTjBAhPvb4jPOo97Yfy3PYUyx2F3newkqXOZy+zx3G/ANoa +ncypfMGyy76sfCWKqw4J1gVkVQLwbB6gQkXUFGYwY9sRrxbG93kQw76Flc/E/s52 +62j4v1IM0fq0t/St+Y/+s6Lkw` + `aqt3ft1nsqWcRaVDdqvMfkzgJGXlw0bGzJG5MEQ +AIBq3dHRAoGBAP8OeG/DKG2Z1VmSfzuz1pas1fbZ+F7venOBrjez3sKlb3Pyl2aH +mt2wjaTUi5v10VrHgYtOEdqyhQeUSYydWXIBKNMag0NLLrfFUKZK+57wrHWFdFjn +VgpsdkLSNTOZpC8gA5OaJ+36IcOPfGqyyP9wuuRoaYnVT1KEzqLa9FEFAoGBAPaq +pglwhil2rxjJE4zq0afQLNpAfi7Xqcrepij+xvJIcIj7nawxXuPxqRFxONE/h3yX +zkybO8wLdbHX9Iw/wc1j50Uf1Z5gHdLf7/hQJoWKpz1RnkWRy6CYON8v1tpVp0tb +OAajR/kZnzebq2mfa7pyy5zDCX++2kp/dcFwHf31AoGAE8oupBVTZLWj7TBFuP8q +LkS40U92Sv9v09iDCQVmylmFvUxcXPM2m+7f/qMTNgWrucxzC7kB/6MMWVszHbrz +vrnCTibnemgx9sZTjKOSxHFOIEw7i85fSa3Cu0qOIDPSnmlwfZpfcMKQrhjLAYhf +uhooFiLX1X78iZ2OXup4PHUCgYEAsmBrm83sp1V1gAYBBlnVbXakyNv0pCk/Vz61 +iFXeRt1NzDGxLxGw3kQnED8BaIh5kQcyn8Fud7sdzJMv/LAqlT4Ww60mzNYTGyjo +H3jOsqm3ESfRvduWFreeAQBWbiOczGjV1i8D4EbAFfWT+tjXjchwKBf+6Yt5zn/o +Bw/uEHUCgYAFs+JPOR25oRyBs7ujrMo/OY1z/eXTVVgZxY+tYGe1FJqDeFyR7ytK ++JBB1MuDwQKGm2wSIXdCzTNoIx2B9zTseiPTwT8G7vqNFhXoIaTBp4P2xIQb45mJ +7GkTsMBHwpSMOXgX9Weq3v5xOJ2WxVtjENmd6qzxcYCO5lP15O17hA== +-----END RSA PRIVATE KEY-----` diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go new file mode 100644 index 0000000000..afa3bde818 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go @@ -0,0 +1,147 @@ +package getter + +import ( + "context" + "fmt" + "net/url" + "os" + "os/exec" + "path/filepath" + "runtime" + "time" + + urlhelper "github.com/hashicorp/go-getter/helper/url" + safetemp "github.com/hashicorp/go-safetemp" +) + +// HgGetter is a Getter implementation that will download a module from +// a Mercurial repository. +type HgGetter struct { + getter + + // Timeout sets a deadline which all hg CLI operations should + // complete within. Zero value means no timeout. + Timeout time.Duration +} + +func (g *HgGetter) ClientMode(_ *url.URL) (ClientMode, error) { + return ClientModeDir, nil +} + +func (g *HgGetter) Get(dst string, u *url.URL) error { + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + if _, err := exec.LookPath("hg"); err != nil { + return fmt.Errorf("hg must be available and on the PATH") + } + + newURL, err := urlhelper.Parse(u.String()) + if err != nil { + return err + } + if fixWindowsDrivePath(newURL) { + // See valid file path form on http://www.selenic.com/hg/help/urls + newURL.Path = fmt.Sprintf("/%s", newURL.Path) + } + + // Extract some query parameters we use + var rev string + q := newURL.Query() + if len(q) > 0 { + rev = q.Get("rev") + q.Del("rev") + + newURL.RawQuery = q.Encode() + } + + _, err = os.Stat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + if err != nil { + if err := g.clone(ctx, dst, newURL); err != nil { + return err + } + } + + if err := g.pull(ctx, dst, newURL); err != nil { + return err + } + + return g.update(ctx, dst, newURL, rev) +} + +// GetFile for Hg doesn't support updating at this time. It will download +// the file every time. +func (g *HgGetter) GetFile(dst string, u *url.URL) error { + // Create a temporary directory to store the full source. This has to be + // a non-existent directory. + td, tdcloser, err := safetemp.Dir("", "getter") + if err != nil { + return err + } + defer tdcloser.Close() + + // Get the filename, and strip the filename from the URL so we can + // just get the repository directly. + filename := filepath.Base(u.Path) + u.Path = filepath.ToSlash(filepath.Dir(u.Path)) + + // If we're on Windows, we need to set the host to "localhost" for hg + if runtime.GOOS == "windows" { + u.Host = "localhost" + } + + // Get the full repository + if err := g.Get(td, u); err != nil { + return err + } + + // Copy the single file + u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) + if err != nil { + return err + } + + fg := &FileGetter{Copy: true, getter: g.getter} + return fg.GetFile(dst, u) +} + +func (g *HgGetter) clone(ctx context.Context, dst string, u *url.URL) error { + cmd := exec.CommandContext(ctx, "hg", "clone", "-U", "--", u.String(), dst) + return getRunCommand(cmd) +} + +func (g *HgGetter) pull(ctx context.Context, dst string, u *url.URL) error { + cmd := exec.CommandContext(ctx, "hg", "pull") + cmd.Dir = dst + return getRunCommand(cmd) +} + +func (g *HgGetter) update(ctx context.Context, dst string, u *url.URL, rev string) error { + args := []string{"update"} + if rev != "" { + args = append(args, "--", rev) + } + + cmd := exec.CommandContext(ctx, "hg", args...) + cmd.Dir = dst + return getRunCommand(cmd) +} + +func fixWindowsDrivePath(u *url.URL) bool { + // hg assumes a file:/// prefix for Windows drive letter file paths. + // (e.g. file:///c:/foo/bar) + // If the URL Path does not begin with a '/' character, the resulting URL + // path will have a file:// prefix. (e.g. file://c:/foo/bar) + // See http://www.selenic.com/hg/help/urls and the examples listed in + // http://selenic.com/repo/hg-stable/file/1265a3a71d75/mercurial/util.py#l1936 + return runtime.GOOS == "windows" && u.Scheme == "file" && + len(u.Path) > 1 && u.Path[0] != '/' && u.Path[1] == ':' +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go new file mode 100644 index 0000000000..7ed4466913 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go @@ -0,0 +1,143 @@ +package getter + +import ( + "net/url" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" +) + +var testHasHg bool + +func init() { + if _, err := exec.LookPath("hg"); err == nil { + testHasHg = true + } +} + +func TestHgGetter_impl(t *testing.T) { + var _ Getter = new(HgGetter) +} + +func TestHgGetter(t *testing.T) { + if !testHasHg { + t.Log("hg not found, skipping") + t.Skip() + } + + g := new(HgGetter) + dst := tempDir(t) + + // With a dir that doesn't exist + if err := g.Get(dst, testModuleURL("basic-hg")); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestHgGetter_branch(t *testing.T) { + if !testHasHg { + t.Log("hg not found, skipping") + t.Skip() + } + + g := new(HgGetter) + dst := tempDir(t) + + url := testModuleURL("basic-hg") + q := url.Query() + q.Add("rev", "test-branch") + url.RawQuery = q.Encode() + + if err := g.Get(dst, url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main_branch.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + + // Get again should work + if err := g.Get(dst, url); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath = filepath.Join(dst, "main_branch.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestHgGetter_GetFile(t *testing.T) { + if !testHasHg { + t.Log("hg not found, skipping") + t.Skip() + } + + g := new(HgGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + if err := g.GetFile(dst, testModuleURL("basic-hg/foo.txt")); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + if _, err := os.Stat(dst); err != nil { + t.Fatalf("err: %s", err) + } + assertContents(t, dst, "Hello\n") +} + +func TestHgGetter_HgArgumentsNotAllowed(t *testing.T) { + if !testHasHg { + t.Log("hg not found, skipping") + t.Skip() + } + + g := new(HgGetter) + + // If arguments are allowed in the destination, this Get call will fail + dst := "--config=alias.clone=!false" + defer os.RemoveAll(dst) + err := g.Get(dst, testModuleURL("basic-hg")) + if err != nil { + t.Fatalf("Expected no err, got: %s", err) + } + + dst = tempDir(t) + // Test arguments passed into the `rev` parameter + // This clone call will fail regardless, but an exit code of 1 indicates + // that the `false` command executed + // We are expecting an hg parse error + err = g.Get(dst, testModuleURL("basic-hg?rev=--config=alias.update=!false")) + if err != nil { + if !strings.Contains(err.Error(), "hg: parse error") { + t.Fatalf("Expected no err, got: %s", err) + } + } + + dst = tempDir(t) + // Test arguments passed in the repository URL + // This Get call will fail regardless, but it should fail + // because the repository can't be found. + // Other failures indicate that hg interpretted the argument passed in the URL + err = g.Get(dst, &url.URL{Path: "--config=alias.clone=false"}) + if err != nil { + if !strings.Contains(err.Error(), "repository --config=alias.clone=false not found") { + t.Fatalf("Expected no err, got: %s", err) + } + } + +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_http.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_http.go new file mode 100644 index 0000000000..a4d273f14f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_http.go @@ -0,0 +1,622 @@ +package getter + +import ( + "context" + "crypto/tls" + "encoding/xml" + "fmt" + "io" + "net/http" + "net/url" + "os" + "path/filepath" + "regexp" + "strings" + "time" + + "github.com/hashicorp/go-cleanhttp" + safetemp "github.com/hashicorp/go-safetemp" +) + +// HttpGetter is a Getter implementation that will download from an HTTP +// endpoint. +// +// For file downloads, HTTP is used directly. +// +// The protocol for downloading a directory from an HTTP endpoint is as follows: +// +// An HTTP GET request is made to the URL with the additional GET parameter +// "terraform-get=1". This lets you handle that scenario specially if you +// wish. The response must be a 2xx. +// +// First, a header is looked for "X-Terraform-Get" which should contain +// a source URL to download. This source must use one of the configured +// protocols and getters for the client, or "http"/"https" if using +// the HttpGetter directly. +// +// If the header is not present, then a meta tag is searched for named +// "terraform-get" and the content should be a source URL. +// +// The source URL, whether from the header or meta tag, must be a fully +// formed URL. The shorthand syntax of "github.com/foo/bar" or relative +// paths are not allowed. +type HttpGetter struct { + getter + + // Netrc, if true, will lookup and use auth information found + // in the user's netrc file if available. + Netrc bool + + // Client is the http.Client to use for Get requests. + // This defaults to a cleanhttp.DefaultClient if left unset. + Client *http.Client + + // Header contains optional request header fields that should be included + // with every HTTP request. Note that the zero value of this field is nil, + // and as such it needs to be initialized before use, via something like + // make(http.Header). + Header http.Header + + // DoNotCheckHeadFirst configures the client to NOT check if the server + // supports HEAD requests. + DoNotCheckHeadFirst bool + + // HeadFirstTimeout configures the client to enforce a timeout when + // the server supports HEAD requests. + // + // The zero value means no timeout. + HeadFirstTimeout time.Duration + + // ReadTimeout configures the client to enforce a timeout when + // making a request to an HTTP server and reading its response body. + // + // The zero value means no timeout. + ReadTimeout time.Duration + + // MaxBytes limits the number of bytes that will be ready from an HTTP + // response body returned from a server. The zero value means no limit. + MaxBytes int64 + + // XTerraformGetLimit configures how many times the client with follow + // the " X-Terraform-Get" header value. + // + // The zero value means no limit. + XTerraformGetLimit int + + // XTerraformGetDisabled disables the client's usage of the "X-Terraform-Get" + // header value. + XTerraformGetDisabled bool +} + +func (g *HttpGetter) ClientMode(u *url.URL) (ClientMode, error) { + if strings.HasSuffix(u.Path, "/") { + return ClientModeDir, nil + } + return ClientModeFile, nil +} + +type contextKey int + +const ( + xTerraformGetDisable contextKey = 0 + xTerraformGetLimit contextKey = 1 + xTerraformGetLimitCurrentValue contextKey = 2 + httpClientValue contextKey = 3 + httpMaxBytesValue contextKey = 4 +) + +func xTerraformGetDisabled(ctx context.Context) bool { + value, ok := ctx.Value(xTerraformGetDisable).(bool) + if !ok { + return false + } + return value +} + +func xTerraformGetLimitCurrentValueFromContext(ctx context.Context) int { + value, ok := ctx.Value(xTerraformGetLimitCurrentValue).(int) + if !ok { + return 1 + } + return value +} + +func xTerraformGetLimiConfiguredtFromContext(ctx context.Context) int { + value, ok := ctx.Value(xTerraformGetLimit).(int) + if !ok { + return 0 + } + return value +} + +func httpClientFromContext(ctx context.Context) *http.Client { + value, ok := ctx.Value(httpClientValue).(*http.Client) + if !ok { + return nil + } + return value +} + +func httpMaxBytesFromContext(ctx context.Context) int64 { + value, ok := ctx.Value(httpMaxBytesValue).(int64) + if !ok { + return 0 // no limit + } + return value +} + +type limitedWrappedReaderCloser struct { + underlying io.Reader + closeFn func() error +} + +func (l *limitedWrappedReaderCloser) Read(p []byte) (n int, err error) { + return l.underlying.Read(p) +} + +func (l *limitedWrappedReaderCloser) Close() (err error) { + return l.closeFn() +} + +func newLimitedWrappedReaderCloser(r io.ReadCloser, limit int64) io.ReadCloser { + return &limitedWrappedReaderCloser{ + underlying: io.LimitReader(r, limit), + closeFn: r.Close, + } +} + +func (g *HttpGetter) Get(dst string, u *url.URL) error { + ctx := g.Context() + + // Optionally disable any X-Terraform-Get redirects. This is reccomended for usage of + // this client outside of Terraform's. This feature is likely not required if the + // source server can provider normal HTTP redirects. + if g.XTerraformGetDisabled { + ctx = context.WithValue(ctx, xTerraformGetDisable, g.XTerraformGetDisabled) + } + + // Optionally enforce a limit on X-Terraform-Get redirects. We check this for every + // invocation of this function, because the value is not passed down to subsequent + // client Get function invocations. + if g.XTerraformGetLimit > 0 { + ctx = context.WithValue(ctx, xTerraformGetLimit, g.XTerraformGetLimit) + } + + // If there was a limit on X-Terraform-Get redirects, check what the current count value. + // + // If the value is greater than the limit, return an error. Otherwise, increment the value, + // and include it in the the context to be passed along in all the subsequent client + // Get function invocations. + if limit := xTerraformGetLimiConfiguredtFromContext(ctx); limit > 0 { + currentValue := xTerraformGetLimitCurrentValueFromContext(ctx) + + if currentValue > limit { + return fmt.Errorf("too many X-Terraform-Get redirects: %d", currentValue) + } + + currentValue++ + + ctx = context.WithValue(ctx, xTerraformGetLimitCurrentValue, currentValue) + } + + // Optionally enforce a maxiumum HTTP response body size. + if g.MaxBytes > 0 { + ctx = context.WithValue(ctx, httpMaxBytesValue, g.MaxBytes) + } + + // Copy the URL so we can modify it + var newU url.URL = *u + u = &newU + + if g.Netrc { + // Add auth from netrc if we can + if err := addAuthFromNetrc(u); err != nil { + return err + } + } + + // If the HTTP client is nil, check if there is one available in the context, + // otherwise create one using cleanhttp's default transport. + if g.Client == nil { + if client := httpClientFromContext(ctx); client != nil { + g.Client = client + } else { + client := httpClient + if g.client != nil && g.client.Insecure { + insecureTransport := cleanhttp.DefaultTransport() + insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} + client.Transport = insecureTransport + } + g.Client = client + } + } + + // Pass along the configured HTTP client in the context for usage with the X-Terraform-Get feature. + ctx = context.WithValue(ctx, httpClientValue, g.Client) + + // Add terraform-get to the parameter. + q := u.Query() + q.Add("terraform-get", "1") + u.RawQuery = q.Encode() + + readCtx := ctx + + if g.ReadTimeout > 0 { + var cancel context.CancelFunc + readCtx, cancel = context.WithTimeout(ctx, g.ReadTimeout) + defer cancel() + } + + // Get the URL + req, err := http.NewRequestWithContext(readCtx, "GET", u.String(), nil) + if err != nil { + return err + } + + if g.Header != nil { + req.Header = g.Header.Clone() + } + + resp, err := g.Client.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + + body := resp.Body + + if maxBytes := httpMaxBytesFromContext(ctx); maxBytes > 0 { + body = newLimitedWrappedReaderCloser(body, maxBytes) + } + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return fmt.Errorf("bad response code: %d", resp.StatusCode) + } + + if disabled := xTerraformGetDisabled(ctx); disabled { + return nil + } + + // Extract the source URL, + var source string + if v := resp.Header.Get("X-Terraform-Get"); v != "" { + source = v + } else { + source, err = g.parseMeta(readCtx, body) + if err != nil { + return err + } + } + if source == "" { + return fmt.Errorf("no source URL was returned") + } + + // If there is a subdir component, then we download the root separately + // into a temporary directory, then copy over the proper subdir. + source, subDir := SourceDirSubdir(source) + + var opts []ClientOption + + // Check if the protocol was switched to one which was not configured. + if g.client != nil && g.client.Getters != nil { + // We must first use the Detectors provided, because `X-Terraform-Get does + // not necessarily return a valid URL. We can replace the source string + // here, since the detectors would have been called immediately during the + // next Get anyway. + source, err = Detect(source, g.client.Pwd, g.client.Detectors) + if err != nil { + return err + } + + protocol := "" + // X-Terraform-Get allows paths relative to the previous request too, + // which won't have a protocol. + if !relativeGet(source) { + protocol = strings.Split(source, ":")[0] + } + + // Otherwise, all default getters are allowed. + if protocol != "" { + _, allowed := g.client.Getters[protocol] + if !allowed { + return fmt.Errorf("no getter available for X-Terraform-Get source protocol: %q", protocol) + } + } + } + + // Add any getter client options. + if g.client != nil { + opts = g.client.Options + } + + // If the client is nil, we know we're using the HttpGetter directly. In + // this case, we don't know exactly which protocols are configured, but we + // can make a good guess. + // + // This prevents all default getters from being allowed when only using the + // HttpGetter directly. To enable protocol switching, a client "wrapper" must + // be used. + if g.client == nil { + switch { + case subDir != "": + // If there's a subdirectory, we will also need a file getter to + // unpack it. + opts = append(opts, WithGetters(map[string]Getter{ + "file": new(FileGetter), + "http": g, + "https": g, + })) + default: + opts = append(opts, WithGetters(map[string]Getter{ + "http": g, + "https": g, + })) + } + } + + // Ensure we pass along the context we constructed in this function. + // + // This is especially important to enforce a limit on X-Terraform-Get redirects + // which could be setup, if configured, at the top of this function. + opts = append(opts, WithContext(ctx)) + + if subDir != "" { + // We have a subdir, time to jump some hoops + return g.getSubdir(ctx, dst, source, subDir, opts...) + } + + // Note: this allows the protocol to be switched to another configured getters. + return Get(dst, source, opts...) +} + +// GetFile fetches the file from src and stores it at dst. +// If the server supports Accept-Range, HttpGetter will attempt a range +// request. This means it is the caller's responsibility to ensure that an +// older version of the destination file does not exist, else it will be either +// falsely identified as being replaced, or corrupted with extra bytes +// appended. +func (g *HttpGetter) GetFile(dst string, src *url.URL) error { + ctx := g.Context() + + // Optionally enforce a maxiumum HTTP response body size. + if g.MaxBytes > 0 { + ctx = context.WithValue(ctx, httpMaxBytesValue, g.MaxBytes) + } + + if g.Netrc { + // Add auth from netrc if we can + if err := addAuthFromNetrc(src); err != nil { + return err + } + } + // Create all the parent directories if needed + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + f, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE, g.client.mode(0666)) + if err != nil { + return err + } + defer f.Close() + + if g.Client == nil { + g.Client = httpClient + if g.client != nil && g.client.Insecure { + insecureTransport := cleanhttp.DefaultTransport() + insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} + g.Client.Transport = insecureTransport + } + } + + var ( + currentFileSize int64 + req *http.Request + ) + + if !g.DoNotCheckHeadFirst { + headCtx := ctx + + if g.HeadFirstTimeout > 0 { + var cancel context.CancelFunc + + headCtx, cancel = context.WithTimeout(ctx, g.HeadFirstTimeout) + defer cancel() + } + + // We first make a HEAD request so we can check + // if the server supports range queries. If the server/URL doesn't + // support HEAD requests, we just fall back to GET. + req, err = http.NewRequestWithContext(headCtx, "HEAD", src.String(), nil) + if err != nil { + return err + } + if g.Header != nil { + req.Header = g.Header.Clone() + } + headResp, err := g.Client.Do(req) + if err == nil { + headResp.Body.Close() + if headResp.StatusCode == 200 { + // If the HEAD request succeeded, then attempt to set the range + // query if we can. + if headResp.Header.Get("Accept-Ranges") == "bytes" && headResp.ContentLength >= 0 { + if fi, err := f.Stat(); err == nil { + if _, err = f.Seek(0, io.SeekEnd); err == nil { + currentFileSize = fi.Size() + if currentFileSize >= headResp.ContentLength { + // file already present + return nil + } + } + } + } + } + } + } + + readCtx := ctx + + if g.ReadTimeout > 0 { + var cancel context.CancelFunc + readCtx, cancel = context.WithTimeout(ctx, g.ReadTimeout) + defer cancel() + } + + req, err = http.NewRequestWithContext(readCtx, "GET", src.String(), nil) + if err != nil { + return err + } + if g.Header != nil { + req.Header = g.Header.Clone() + } + if currentFileSize > 0 { + req.Header.Set("Range", fmt.Sprintf("bytes=%d-", currentFileSize)) + } + + resp, err := g.Client.Do(req) + if err != nil { + return err + } + switch resp.StatusCode { + case http.StatusOK, http.StatusPartialContent: + // all good + default: + resp.Body.Close() + return fmt.Errorf("bad response code: %d", resp.StatusCode) + } + + body := resp.Body + + if maxBytes := httpMaxBytesFromContext(ctx); maxBytes > 0 { + body = newLimitedWrappedReaderCloser(body, maxBytes) + } + + if g.client != nil && g.client.ProgressListener != nil { + // track download + fn := filepath.Base(src.EscapedPath()) + body = g.client.ProgressListener.TrackProgress(fn, currentFileSize, currentFileSize+resp.ContentLength, resp.Body) + } + defer body.Close() + + n, err := Copy(readCtx, f, body) + if err == nil && n < resp.ContentLength { + err = io.ErrShortWrite + } + return err +} + +// getSubdir downloads the source into the destination, but with +// the proper subdir. +func (g *HttpGetter) getSubdir(ctx context.Context, dst, source, subDir string, opts ...ClientOption) error { + // Create a temporary directory to store the full source. This has to be + // a non-existent directory. + td, tdcloser, err := safetemp.Dir("", "getter") + if err != nil { + return err + } + defer tdcloser.Close() + + // Download that into the given directory + if err := Get(td, source, opts...); err != nil { + return err + } + + // Process any globbing + sourcePath, err := SubdirGlob(td, subDir) + if err != nil { + return err + } + + // Make sure the subdir path actually exists + if _, err := os.Stat(sourcePath); err != nil { + return fmt.Errorf( + "Error downloading %s: %s", source, err) + } + + // Copy the subdirectory into our actual destination. + if err := os.RemoveAll(dst); err != nil { + return err + } + + // Make the final destination + if err := os.MkdirAll(dst, g.client.mode(0755)); err != nil { + return err + } + + var disableSymlinks bool + + if g.client != nil && g.client.DisableSymlinks { + disableSymlinks = true + } + + return copyDir(ctx, dst, sourcePath, false, disableSymlinks, g.client.umask()) +} + +// parseMeta looks for the first meta tag in the given reader that +// will give us the source URL. +func (g *HttpGetter) parseMeta(ctx context.Context, r io.Reader) (string, error) { + d := xml.NewDecoder(r) + d.CharsetReader = charsetReader + d.Strict = false + var err error + var t xml.Token + for { + if ctx.Err() != nil { + return "", fmt.Errorf("context error while parsing meta tag: %w", ctx.Err()) + } + + t, err = d.Token() + if err != nil { + if err == io.EOF { + err = nil + } + return "", err + } + if e, ok := t.(xml.StartElement); ok && strings.EqualFold(e.Name.Local, "body") { + return "", nil + } + if e, ok := t.(xml.EndElement); ok && strings.EqualFold(e.Name.Local, "head") { + return "", nil + } + e, ok := t.(xml.StartElement) + if !ok || !strings.EqualFold(e.Name.Local, "meta") { + continue + } + if attrValue(e.Attr, "name") != "terraform-get" { + continue + } + if f := attrValue(e.Attr, "content"); f != "" { + return f, nil + } + } +} + +// X-Terraform-Get allows paths relative to the previous request +var relativeGet = regexp.MustCompile(`^\.{0,2}/`).MatchString + +// attrValue returns the attribute value for the case-insensitive key +// `name', or the empty string if nothing is found. +func attrValue(attrs []xml.Attr, name string) string { + for _, a := range attrs { + if strings.EqualFold(a.Name.Local, name) { + return a.Value + } + } + return "" +} + +// charsetReader returns a reader for the given charset. Currently +// it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful +// error which is printed by go get, so the user can find why the package +// wasn't downloaded if the encoding is not supported. Note that, in +// order to reduce potential errors, ASCII is treated as UTF-8 (i.e. characters +// greater than 0x7f are not rejected). +func charsetReader(charset string, input io.Reader) (io.Reader, error) { + switch strings.ToLower(charset) { + case "ascii": + return input, nil + default: + return nil, fmt.Errorf("can't decode XML document using charset %q", charset) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go new file mode 100644 index 0000000000..8e46530e29 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go @@ -0,0 +1,1111 @@ +package getter + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "errors" + "fmt" + "io/ioutil" + "net" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "strconv" + "strings" + "testing" + + "github.com/hashicorp/go-cleanhttp" +) + +func TestHttpGetter_impl(t *testing.T) { + var _ Getter = new(HttpGetter) +} + +func TestHttpGetter_header(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/header" + + // Get it, which should error because it uses the file protocol. + err := g.Get(dst, &u) + + if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { + t.Fatalf("unexpected error: %v", err) + } + + // But, using a wrapper client with a file getter will work. + c := &Client{ + Getters: map[string]Getter{ + "http": g, + "file": new(FileGetter), + }, + Src: u.String(), + Dst: dst, + Mode: ClientModeDir, + } + + err = c.Get() + + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + +} + +func TestHttpGetter_requestHeader(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + g.Header = make(http.Header) + g.Header.Add("X-Foobar", "foobar") + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/expect-header" + u.RawQuery = "expected=X-Foobar" + + // Get it! + if err := g.GetFile(dst, &u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + if _, err := os.Stat(dst); err != nil { + t.Fatalf("err: %s", err) + } + assertContents(t, dst, "Hello\n") +} + +func TestHttpGetter_meta(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/meta" + + // Get it, which should error because it uses the file protocol. + err := g.Get(dst, &u) + + if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { + t.Fatalf("unexpected error: %v", err) + } + + // But, using a wrapper client with a file getter will work. + c := &Client{ + Getters: map[string]Getter{ + "http": g, + "file": new(FileGetter), + }, + Src: u.String(), + Dst: dst, + Mode: ClientModeDir, + } + + err = c.Get() + + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestHttpGetter_metaSubdir(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/meta-subdir" + + // Get it! + if err := g.Get(dst, &u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "sub.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestHttpGetter_metaSubdirGlob(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/meta-subdir-glob" + + // Get it! + if err := g.Get(dst, &u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "sub.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestHttpGetter_none(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/none" + + // Get it! + if err := g.Get(dst, &u); err == nil { + t.Fatal("should error") + } +} + +func TestHttpGetter_resume(t *testing.T) { + load := []byte(testHttpMetaStr) + sha := sha256.New() + if n, err := sha.Write(load); n != len(load) || err != nil { + t.Fatalf("sha write failed: %d, %s", n, err) + } + checksum := hex.EncodeToString(sha.Sum(nil)) + downloadFrom := len(load) / 2 + + ln := testHttpServer(t) + defer ln.Close() + + dst := tempDir(t) + defer os.RemoveAll(dst) + + dst = filepath.Join(dst, "..", "range") + f, err := os.Create(dst) + if err != nil { + t.Fatalf("create: %v", err) + } + if n, err := f.Write(load[:downloadFrom]); n != downloadFrom || err != nil { + t.Fatalf("partial file write failed: %d, %s", n, err) + } + if err := f.Close(); err != nil { + t.Fatalf("close failed: %s", err) + } + + u := url.URL{ + Scheme: "http", + Host: ln.Addr().String(), + Path: "/range", + RawQuery: "checksum=" + checksum, + } + t.Logf("url: %s", u.String()) + + // Finish getting it! + if err := GetFile(dst, u.String()); err != nil { + t.Fatalf("finishing download should not error: %v", err) + } + + b, err := ioutil.ReadFile(dst) + if err != nil { + t.Fatalf("readfile failed: %v", err) + } + + if string(b) != string(load) { + t.Fatalf("file differs: got:\n%s\n expected:\n%s\n", string(b), string(load)) + } + + // Get it again + if err := GetFile(dst, u.String()); err != nil { + t.Fatalf("should not error: %v", err) + } +} + +// The server may support Byte-Range, but has no size for the requested object +func TestHttpGetter_resumeNoRange(t *testing.T) { + load := []byte(testHttpMetaStr) + sha := sha256.New() + if n, err := sha.Write(load); n != len(load) || err != nil { + t.Fatalf("sha write failed: %d, %s", n, err) + } + checksum := hex.EncodeToString(sha.Sum(nil)) + downloadFrom := len(load) / 2 + + ln := testHttpServer(t) + defer ln.Close() + + dst := tempDir(t) + defer os.RemoveAll(dst) + + dst = filepath.Join(dst, "..", "range") + f, err := os.Create(dst) + if err != nil { + t.Fatalf("create: %v", err) + } + if n, err := f.Write(load[:downloadFrom]); n != downloadFrom || err != nil { + t.Fatalf("partial file write failed: %d, %s", n, err) + } + if err := f.Close(); err != nil { + t.Fatalf("close failed: %s", err) + } + + u := url.URL{ + Scheme: "http", + Host: ln.Addr().String(), + Path: "/no-range", + RawQuery: "checksum=" + checksum, + } + t.Logf("url: %s", u.String()) + + // Finish getting it! + if err := GetFile(dst, u.String()); err != nil { + t.Fatalf("finishing download should not error: %v", err) + } + + b, err := ioutil.ReadFile(dst) + if err != nil { + t.Fatalf("readfile failed: %v", err) + } + + if string(b) != string(load) { + t.Fatalf("file differs: got:\n%s\n expected:\n%s\n", string(b), string(load)) + } +} + +func TestHttpGetter_file(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/file" + + // Get it! + if err := g.GetFile(dst, &u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + if _, err := os.Stat(dst); err != nil { + t.Fatalf("err: %s", err) + } + assertContents(t, dst, "Hello\n") +} + +// TestHttpGetter_http2server tests that http.Request is not reused +// between HEAD & GET, which would lead to race condition in HTTP/2. +// This test is only meaningful for the race detector (go test -race). +func TestHttpGetter_http2server(t *testing.T) { + g := new(HttpGetter) + src, err := url.Parse("https://releases.hashicorp.com/terraform/0.14.0/terraform_0.14.0_SHA256SUMS") + if err != nil { + t.Fatal(err) + } + dst := tempTestFile(t) + + err = g.GetFile(dst, src) + if err != nil { + t.Fatal(err) + } +} + +func TestHttpGetter_auth(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/meta-auth" + u.User = url.UserPassword("foo", "bar") + + // Get it, which should error because it uses the file protocol. + err := g.Get(dst, &u) + + if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { + t.Fatalf("unexpected error: %v", err) + } + + // But, using a wrapper client with a file getter will work. + c := &Client{ + Getters: map[string]Getter{ + "http": g, + "file": new(FileGetter), + }, + Src: u.String(), + Dst: dst, + Mode: ClientModeDir, + } + + err = c.Get() + + if err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestHttpGetter_authNetrc(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/meta" + + // Write the netrc file + path, closer := tempFileContents(t, fmt.Sprintf(testHttpNetrc, ln.Addr().String())) + defer closer() + defer tempEnv(t, "NETRC", path)() + + // Get it, which should error because it uses the file protocol. + err := g.Get(dst, &u) + + if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { + t.Fatalf("unexpected error: %v", err) + } + + // But, using a wrapper client with a file getter will work. + c := &Client{ + Getters: map[string]Getter{ + "http": g, + "file": new(FileGetter), + }, + Src: u.String(), + Dst: dst, + Mode: ClientModeDir, + } + + err = c.Get() + + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +// test round tripper that only returns an error +type errRoundTripper struct{} + +func (errRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { + return nil, errors.New("test round tripper") +} + +// verify that the default httpClient no longer comes from http.DefaultClient +func TestHttpGetter_cleanhttp(t *testing.T) { + ln := testHttpServer(t) + defer ln.Close() + + // break the default http client + http.DefaultClient.Transport = errRoundTripper{} + defer func() { + http.DefaultClient.Transport = http.DefaultTransport + }() + + g := new(HttpGetter) + dst := tempDir(t) + defer os.RemoveAll(dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/header" + + // Get it, which should error because it uses the file protocol. + err := g.Get(dst, &u) + + if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { + t.Fatalf("unexpected error: %v", err) + } + + // But, using a wrapper client with a file getter will work. + c := &Client{ + Getters: map[string]Getter{ + "http": g, + "file": new(FileGetter), + }, + Src: u.String(), + Dst: dst, + Mode: ClientModeDir, + } + + err = c.Get() + + if err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestHttpGetter__RespectsContextCanceled(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + cancel() // cancel immediately + + ln := testHttpServer(t) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/file" + dst := tempDir(t) + + rt := hookableHTTPRoundTripper{ + before: func(req *http.Request) { + err := req.Context().Err() + if !errors.Is(err, context.Canceled) { + t.Fatalf("Expected http.Request with canceled.Context, got: %v", err) + } + }, + RoundTripper: http.DefaultTransport, + } + + g := new(HttpGetter) + g.client = &Client{ + Ctx: ctx, + } + g.Client = &http.Client{ + Transport: &rt, + } + + err := g.Get(dst, &u) + if !errors.Is(err, context.Canceled) { + t.Fatalf("expected context.Canceled, got: %v", err) + } +} + +func TestHttpGetter__XTerraformGetLimit(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ln := testHttpServerWithXTerraformGetLoop(t) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/loop" + dst := tempDir(t) + + g := new(HttpGetter) + g.XTerraformGetLimit = 10 + g.client = &Client{ + Ctx: ctx, + } + g.Client = &http.Client{} + + err := g.Get(dst, &u) + if !strings.Contains(err.Error(), "too many X-Terraform-Get redirects") { + t.Fatalf("too many X-Terraform-Get redirects, got: %v", err) + } +} + +func TestHttpGetter__XTerraformGetDisabled(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ln := testHttpServerWithXTerraformGetLoop(t) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/loop" + dst := tempDir(t) + + g := new(HttpGetter) + g.XTerraformGetDisabled = true + g.client = &Client{ + Ctx: ctx, + } + g.Client = &http.Client{} + + err := g.Get(dst, &u) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } +} + +type testCustomDetector struct{} + +func (testCustomDetector) Detect(src, _ string) (string, bool, error) { + if strings.HasPrefix(src, "custom|") { + return "http://" + src[7:], true, nil + } + return "", false, nil +} + +// test a source url with no protocol +func TestHttpGetter__XTerraformGetDetected(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ln := testHttpServerWithXTerraformGetDetected(t) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/first" + dst := tempDir(t) + + c := &Client{ + Ctx: ctx, + Src: u.String(), + Dst: dst, + Mode: ClientModeDir, + Options: []ClientOption{ + func(c *Client) error { + c.Detectors = append(c.Detectors, testCustomDetector{}) + return nil + }, + }, + } + + err := c.Get() + if err != nil { + t.Fatal(err) + } +} + +func TestHttpGetter__XTerraformGetProxyBypass(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ln := testHttpServerWithXTerraformGetProxyBypass(t) + + proxyLn := testHttpServerProxy(t, ln.Addr().String()) + + t.Logf("starting malicious server on: %v", ln.Addr().String()) + t.Logf("starting proxy on: %v", proxyLn.Addr().String()) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/start" + dst := tempDir(t) + + proxy, err := url.Parse(fmt.Sprintf("http://%s/", proxyLn.Addr().String())) + if err != nil { + t.Fatalf("failed to parse proxy URL: %v", err) + } + + transport := cleanhttp.DefaultTransport() + transport.Proxy = http.ProxyURL(proxy) + + httpGetter := new(HttpGetter) + httpGetter.XTerraformGetLimit = 10 + httpGetter.Client = &http.Client{ + Transport: transport, + } + + client := &Client{ + Ctx: ctx, + Getters: map[string]Getter{ + "http": httpGetter, + }, + } + + client.Src = u.String() + client.Dst = dst + + err = client.Get() + if err != nil { + t.Logf("client get error: %v", err) + } +} + +func TestHttpGetter__XTerraformGetConfiguredGettersBypass(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ln := testHttpServerWithXTerraformGetConfiguredGettersBypass(t) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/start" + dst := tempDir(t) + + rt := hookableHTTPRoundTripper{ + before: func(req *http.Request) { + t.Logf("making request") + }, + RoundTripper: http.DefaultTransport, + } + + httpGetter := new(HttpGetter) + httpGetter.XTerraformGetLimit = 10 + httpGetter.Client = &http.Client{ + Transport: &rt, + } + + client := &Client{ + Ctx: ctx, + Mode: ClientModeDir, + Getters: map[string]Getter{ + "http": httpGetter, + }, + } + + t.Logf("%v", u.String()) + + client.Src = u.String() + client.Dst = dst + + err := client.Get() + if err != nil { + if !strings.Contains(err.Error(), "no getter available for X-Terraform-Get source protocol") { + t.Fatalf("expected no getter available for X-Terraform-Get source protocol, got: %v", err) + } + } +} + +func TestHttpGetter__endless_body(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + ln := testHttpServerWithEndlessBody(t) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/" + dst := tempDir(t) + + httpGetter := new(HttpGetter) + httpGetter.MaxBytes = 10 + httpGetter.DoNotCheckHeadFirst = true + + client := &Client{ + Ctx: ctx, + Mode: ClientModeFile, + Getters: map[string]Getter{ + "http": httpGetter, + }, + } + + t.Logf("%v", u.String()) + + client.Src = u.String() + client.Dst = dst + + err := client.Get() + if err != nil { + t.Fatalf("unexpected error: %v", err) + } +} + +func TestHttpGetter_subdirLink(t *testing.T) { + ln := testHttpServerSubDir(t) + defer ln.Close() + + httpGetter := new(HttpGetter) + dst, err := ioutil.TempDir("", "tf") + if err != nil { + t.Fatalf("err: %s", err) + } + + t.Logf("dst: %q", dst) + + var u url.URL + u.Scheme = "http" + u.Host = ln.Addr().String() + u.Path = "/regular-subdir//meta-subdir" + + t.Logf("url: %q", u.String()) + + client := &Client{ + Src: u.String(), + Dst: dst, + Mode: ClientModeAny, + Getters: map[string]Getter{ + "http": httpGetter, + }, + } + + err = client.Get() + if err != nil { + t.Fatalf("get err: %v", err) + } +} + +func testHttpServerWithXTerraformGetLoop(t *testing.T) net.Listener { + t.Helper() + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + header := fmt.Sprintf("http://%v:%v", ln.Addr().String(), "/loop") + + mux := http.NewServeMux() + mux.HandleFunc("/loop", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("X-Terraform-Get", header) + t.Logf("serving loop") + }) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +func testHttpServerWithXTerraformGetDetected(t *testing.T) net.Listener { + t.Helper() + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + // This location requires a custom detector to work. + first := fmt.Sprintf("custom|%s/archive.tar.gz", ln.Addr()) + + mux := http.NewServeMux() + mux.HandleFunc("/first", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("X-Terraform-Get", first) + }) + mux.HandleFunc("/archive.tar.gz", func(w http.ResponseWriter, r *http.Request) { + f, err := ioutil.ReadFile("testdata/archive.tar.gz") + if err != nil { + t.Fatal(err) + } + w.Write(f) + }) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +func testHttpServerWithXTerraformGetProxyBypass(t *testing.T) net.Listener { + t.Helper() + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + header := fmt.Sprintf("http://%v/bypass", ln.Addr().String()) + + mux := http.NewServeMux() + mux.HandleFunc("/start/start", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("X-Terraform-Get", header) + t.Logf("serving start") + }) + + mux.HandleFunc("/bypass", func(w http.ResponseWriter, r *http.Request) { + t.Fail() + t.Logf("bypassed proxy") + }) + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + t.Logf("serving HTTP server path: %v", r.URL.Path) + }) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +func testHttpServerWithXTerraformGetConfiguredGettersBypass(t *testing.T) net.Listener { + t.Helper() + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + header := fmt.Sprintf("git::http://%v/some/repository.git", ln.Addr().String()) + + mux := http.NewServeMux() + mux.HandleFunc("/start", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("X-Terraform-Get", header) + t.Logf("serving start") + }) + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + t.Logf("serving git HTTP server path: %v", r.URL.Path) + }) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +func testHttpServerProxy(t *testing.T, upstreamHost string) net.Listener { + t.Helper() + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + mux := http.NewServeMux() + + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + t.Logf("serving proxy: %v: %#+v", r.URL.Path, r.Header) + // create the reverse proxy + proxy := httputil.NewSingleHostReverseProxy(r.URL) + // Note that ServeHttp is non blocking & uses a go routine under the hood + proxy.ServeHTTP(w, r) + }) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +func testHttpServer(t *testing.T) net.Listener { + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + mux := http.NewServeMux() + mux.HandleFunc("/expect-header", testHttpHandlerExpectHeader) + mux.HandleFunc("/file", testHttpHandlerFile) + mux.HandleFunc("/header", testHttpHandlerHeader) + mux.HandleFunc("/meta", testHttpHandlerMeta) + mux.HandleFunc("/meta-auth", testHttpHandlerMetaAuth) + mux.HandleFunc("/meta-subdir", testHttpHandlerMetaSubdir) + mux.HandleFunc("/meta-subdir-glob", testHttpHandlerMetaSubdirGlob) + mux.HandleFunc("/range", testHttpHandlerRange) + mux.HandleFunc("/no-range", testHttpHandlerNoRange) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +func testHttpHandlerExpectHeader(w http.ResponseWriter, r *http.Request) { + if expected, ok := r.URL.Query()["expected"]; ok { + if r.Header.Get(expected[0]) != "" { + w.Write([]byte("Hello\n")) + return + } + } + + w.WriteHeader(400) +} + +func testHttpHandlerFile(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Hello\n")) +} + +func testHttpHandlerHeader(w http.ResponseWriter, r *http.Request) { + w.Header().Add("X-Terraform-Get", testModuleURL("basic").String()) + w.WriteHeader(200) +} + +func testHttpHandlerMeta(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic").String()))) +} + +func testHttpHandlerMetaAuth(w http.ResponseWriter, r *http.Request) { + user, pass, ok := r.BasicAuth() + if !ok { + w.WriteHeader(401) + return + } + + if user != "foo" || pass != "bar" { + w.WriteHeader(401) + return + } + + w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic").String()))) +} + +func testHttpServerWithEndlessBody(t *testing.T) net.Listener { + t.Helper() + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + for { + w.Write([]byte(".\n")) + } + }) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +func testHttpHandlerMetaSubdir(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic//subdir").String()))) +} + +func testHttpHandlerMetaSubdirGlob(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic//sub*").String()))) +} + +func testHttpHandlerNone(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(testHttpNoneStr)) +} + +func testHttpHandlerRange(w http.ResponseWriter, r *http.Request) { + load := []byte(testHttpMetaStr) + switch r.Method { + case "HEAD": + w.Header().Add("accept-ranges", "bytes") + w.Header().Add("content-length", strconv.Itoa(len(load))) + default: + // request should have header "Range: bytes=0-1023" + // or "Range: bytes=123-" + rangeHeaderValue := strings.Split(r.Header.Get("Range"), "=")[1] + rng, _ := strconv.Atoi(strings.Split(rangeHeaderValue, "-")[0]) + if rng < 1 || rng > len(load) { + http.Error(w, "", http.StatusBadRequest) + } + w.Write(load[rng:]) + } +} + +func testHttpHandlerNoRange(w http.ResponseWriter, r *http.Request) { + load := []byte(testHttpMetaStr) + switch r.Method { + case "HEAD": + // we support range, but the object size isn't known + w.Header().Add("accept-ranges", "bytes") + default: + if r.Header.Get("Range") != "" { + http.Error(w, "range not supported", http.StatusBadRequest) + } + w.Write(load) + } +} + +func testHttpServerSubDir(t *testing.T) net.Listener { + t.Helper() + + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("err: %s", err) + } + + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + t.Logf("serving: %v: %v: %#+[1]v", r.Method, r.URL.String(), r.Header) + } + }) + + var server http.Server + server.Handler = mux + go server.Serve(ln) + + return ln +} + +const testHttpMetaStr = ` + + + + + +` + +const testHttpNoneStr = ` + + + + +` + +const testHttpNetrc = ` +machine %s +login foo +password bar +` + +type hookableHTTPRoundTripper struct { + before func(req *http.Request) + http.RoundTripper +} + +func (m *hookableHTTPRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + if m.before != nil { + m.before(req) + } + return m.RoundTripper.RoundTrip(req) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go new file mode 100644 index 0000000000..e2a98ea284 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go @@ -0,0 +1,54 @@ +package getter + +import ( + "net/url" +) + +// MockGetter is an implementation of Getter that can be used for tests. +type MockGetter struct { + getter + + // Proxy, if set, will be called after recording the calls below. + // If it isn't set, then the *Err values will be returned. + Proxy Getter + + GetCalled bool + GetDst string + GetURL *url.URL + GetErr error + + GetFileCalled bool + GetFileDst string + GetFileURL *url.URL + GetFileErr error +} + +func (g *MockGetter) Get(dst string, u *url.URL) error { + g.GetCalled = true + g.GetDst = dst + g.GetURL = u + + if g.Proxy != nil { + return g.Proxy.Get(dst, u) + } + + return g.GetErr +} + +func (g *MockGetter) GetFile(dst string, u *url.URL) error { + g.GetFileCalled = true + g.GetFileDst = dst + g.GetFileURL = u + + if g.Proxy != nil { + return g.Proxy.GetFile(dst, u) + } + return g.GetFileErr +} + +func (g *MockGetter) ClientMode(u *url.URL) (ClientMode, error) { + if l := len(u.Path); l > 0 && u.Path[l-1:] == "/" { + return ClientModeDir, nil + } + return ClientModeFile, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go new file mode 100644 index 0000000000..7e0d853ba2 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go @@ -0,0 +1,344 @@ +package getter + +import ( + "context" + "fmt" + "net/url" + "os" + "path/filepath" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3" +) + +// S3Getter is a Getter implementation that will download a module from +// a S3 bucket. +type S3Getter struct { + getter + + // Timeout sets a deadline which all S3 operations should + // complete within. Zero value means no timeout. + Timeout time.Duration +} + +func (g *S3Getter) ClientMode(u *url.URL) (ClientMode, error) { + // Parse URL + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + region, bucket, path, _, creds, err := g.parseUrl(u) + if err != nil { + return 0, err + } + + // Create client config + client, err := g.newS3Client(region, u, creds) + if err != nil { + return 0, err + } + + // List the object(s) at the given prefix + req := &s3.ListObjectsInput{ + Bucket: aws.String(bucket), + Prefix: aws.String(path), + } + resp, err := client.ListObjectsWithContext(ctx, req) + if err != nil { + return 0, err + } + + for _, o := range resp.Contents { + // Use file mode on exact match. + if *o.Key == path { + return ClientModeFile, nil + } + + // Use dir mode if child keys are found. + if strings.HasPrefix(*o.Key, path+"/") { + return ClientModeDir, nil + } + } + + // There was no match, so just return file mode. The download is going + // to fail but we will let S3 return the proper error later. + return ClientModeFile, nil +} + +func (g *S3Getter) Get(dst string, u *url.URL) error { + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + // Parse URL + region, bucket, path, _, creds, err := g.parseUrl(u) + if err != nil { + return err + } + + // Remove destination if it already exists + _, err = os.Stat(dst) + if err != nil && !os.IsNotExist(err) { + return err + } + + if err == nil { + // Remove the destination + if err := os.RemoveAll(dst); err != nil { + return err + } + } + + // Create all the parent directories + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + client, err := g.newS3Client(region, u, creds) + if err != nil { + return err + } + + // List files in path, keep listing until no more objects are found + lastMarker := "" + hasMore := true + for hasMore { + req := &s3.ListObjectsInput{ + Bucket: aws.String(bucket), + Prefix: aws.String(path), + } + if lastMarker != "" { + req.Marker = aws.String(lastMarker) + } + + resp, err := client.ListObjectsWithContext(ctx, req) + if err != nil { + return err + } + + hasMore = aws.BoolValue(resp.IsTruncated) + + // Get each object storing each file relative to the destination path + for _, object := range resp.Contents { + lastMarker = aws.StringValue(object.Key) + objPath := aws.StringValue(object.Key) + + // If the key ends with a backslash assume it is a directory and ignore + if strings.HasSuffix(objPath, "/") { + continue + } + + // Get the object destination path + objDst, err := filepath.Rel(path, objPath) + if err != nil { + return err + } + objDst = filepath.Join(dst, objDst) + + if err := g.getObject(ctx, client, objDst, bucket, objPath, ""); err != nil { + return err + } + } + } + + return nil +} + +func (g *S3Getter) GetFile(dst string, u *url.URL) error { + ctx := g.Context() + + if g.Timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, g.Timeout) + defer cancel() + } + + region, bucket, path, version, creds, err := g.parseUrl(u) + if err != nil { + return err + } + + client, err := g.newS3Client(region, u, creds) + if err != nil { + return err + } + + return g.getObject(ctx, client, dst, bucket, path, version) +} + +func (g *S3Getter) getObject(ctx context.Context, client *s3.S3, dst, bucket, key, version string) error { + req := &s3.GetObjectInput{ + Bucket: aws.String(bucket), + Key: aws.String(key), + } + if version != "" { + req.VersionId = aws.String(version) + } + + resp, err := client.GetObjectWithContext(ctx, req) + if err != nil { + return err + } + + // Create all the parent directories + if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { + return err + } + + body := resp.Body + + if g.client != nil && g.client.ProgressListener != nil { + fn := filepath.Base(key) + body = g.client.ProgressListener.TrackProgress(fn, 0, *resp.ContentLength, resp.Body) + } + defer body.Close() + + return copyReader(dst, body, 0666, g.client.umask()) +} + +func (g *S3Getter) getAWSConfig(region string, url *url.URL, creds *credentials.Credentials) *aws.Config { + conf := &aws.Config{} + metadataURLOverride := os.Getenv("AWS_METADATA_URL") + if creds == nil && metadataURLOverride != "" { + creds = credentials.NewChainCredentials( + []credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, + &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(session.New(&aws.Config{ + Endpoint: aws.String(metadataURLOverride), + })), + }, + }) + } + + if creds != nil { + conf.Endpoint = &url.Host + conf.S3ForcePathStyle = aws.Bool(true) + if url.Scheme == "http" { + conf.DisableSSL = aws.Bool(true) + } + } + + conf.Credentials = creds + if region != "" { + conf.Region = aws.String(region) + } + + return conf.WithCredentialsChainVerboseErrors(true) +} + +func (g *S3Getter) parseUrl(u *url.URL) (region, bucket, path, version string, creds *credentials.Credentials, err error) { + // This just check whether we are dealing with S3 or + // any other S3 compliant service. S3 has a predictable + // url as others do not + if strings.Contains(u.Host, "amazonaws.com") { + // Amazon S3 supports both virtual-hosted–style and path-style URLs to access a bucket, although path-style is deprecated + // In both cases few older regions supports dash-style region indication (s3-Region) even if AWS discourages their use. + // The same bucket could be reached with: + // bucket.s3.region.amazonaws.com/path + // bucket.s3-region.amazonaws.com/path + // s3.amazonaws.com/bucket/path + // s3-region.amazonaws.com/bucket/path + + hostParts := strings.Split(u.Host, ".") + switch len(hostParts) { + // path-style + case 3: + // Parse the region out of the first part of the host + region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") + if region == "" { + region = "us-east-1" + } + pathParts := strings.SplitN(u.Path, "/", 3) + bucket = pathParts[1] + path = pathParts[2] + // vhost-style, dash region indication + case 4: + // Parse the region out of the first part of the host + region = strings.TrimPrefix(strings.TrimPrefix(hostParts[1], "s3-"), "s3") + if region == "" { + err = fmt.Errorf("URL is not a valid S3 URL") + return + } + pathParts := strings.SplitN(u.Path, "/", 2) + bucket = hostParts[0] + path = pathParts[1] + //vhost-style, dot region indication + case 5: + region = hostParts[2] + pathParts := strings.SplitN(u.Path, "/", 2) + bucket = hostParts[0] + path = pathParts[1] + + } + if len(hostParts) < 3 && len(hostParts) > 5 { + err = fmt.Errorf("URL is not a valid S3 URL") + return + } + version = u.Query().Get("version") + + } else { + pathParts := strings.SplitN(u.Path, "/", 3) + if len(pathParts) != 3 { + err = fmt.Errorf("URL is not a valid S3 compliant URL") + return + } + bucket = pathParts[1] + path = pathParts[2] + version = u.Query().Get("version") + region = u.Query().Get("region") + if region == "" { + region = "us-east-1" + } + } + + _, hasAwsId := u.Query()["aws_access_key_id"] + _, hasAwsSecret := u.Query()["aws_access_key_secret"] + _, hasAwsToken := u.Query()["aws_access_token"] + if hasAwsId || hasAwsSecret || hasAwsToken { + creds = credentials.NewStaticCredentials( + u.Query().Get("aws_access_key_id"), + u.Query().Get("aws_access_key_secret"), + u.Query().Get("aws_access_token"), + ) + } + + return +} + +func (g *S3Getter) newS3Client( + region string, url *url.URL, creds *credentials.Credentials, +) (*s3.S3, error) { + var sess *session.Session + + if profile := url.Query().Get("aws_profile"); profile != "" { + var err error + sess, err = session.NewSessionWithOptions(session.Options{ + Profile: profile, + SharedConfigState: session.SharedConfigEnable, + }) + if err != nil { + return nil, err + } + } else { + config := g.getAWSConfig(region, url, creds) + sess = session.New(config) + } + + return s3.New(sess), nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go new file mode 100644 index 0000000000..25ce483679 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go @@ -0,0 +1,269 @@ +package getter + +import ( + "net/url" + "os" + "path/filepath" + "testing" + + "github.com/aws/aws-sdk-go/aws/awserr" +) + +func init() { + // These are well known restricted IAM keys to a HashiCorp-managed bucket + // in a private AWS account that only has access to the open source test + // resources. + // + // We do the string concat below to avoid AWS autodetection of a key. This + // key is locked down an IAM policy that is read-only so we're purposely + // exposing it. + os.Setenv("AWS_ACCESS_KEY", "AKIAITTDR"+"WY2STXOZE2A") + os.Setenv("AWS_SECRET_KEY", "oMwSyqdass2kPF"+"/7ORZA9dlb/iegz+89B0Cy01Ea") +} + +func TestS3Getter_impl(t *testing.T) { + var _ Getter = new(S3Getter) +} + +func TestS3Getter(t *testing.T) { + g := new(S3Getter) + dst := tempDir(t) + + // With a dir that doesn't exist + err := g.Get( + dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestS3Getter_subdir(t *testing.T) { + g := new(S3Getter) + dst := tempDir(t) + + // With a dir that doesn't exist + err := g.Get( + dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/subfolder")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + subPath := filepath.Join(dst, "sub.tf") + if _, err := os.Stat(subPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestS3Getter_GetFile(t *testing.T) { + g := new(S3Getter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + err := g.GetFile( + dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/main.tf")) + if err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + if _, err := os.Stat(dst); err != nil { + t.Fatalf("err: %s", err) + } + assertContents(t, dst, "# Main\n") +} + +func TestS3Getter_GetFile_badParams(t *testing.T) { + g := new(S3Getter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + err := g.GetFile( + dst, + testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/main.tf?aws_access_key_id=foo&aws_access_key_secret=bar&aws_access_token=baz")) + if err == nil { + t.Fatalf("expected error, got none") + } + + if reqerr, ok := err.(awserr.RequestFailure); !ok || reqerr.StatusCode() != 403 { + t.Fatalf("expected InvalidAccessKeyId error") + } +} + +func TestS3Getter_GetFile_notfound(t *testing.T) { + g := new(S3Getter) + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + + // Download + err := g.GetFile( + dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/404.tf")) + if err == nil { + t.Fatalf("expected error, got none") + } +} + +func TestS3Getter_ClientMode_dir(t *testing.T) { + g := new(S3Getter) + + // Check client mode on a key prefix with only a single key. + mode, err := g.ClientMode( + testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeDir { + t.Fatal("expect ClientModeDir") + } +} + +func TestS3Getter_ClientMode_file(t *testing.T) { + g := new(S3Getter) + + // Check client mode on a key prefix which contains sub-keys. + mode, err := g.ClientMode( + testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/main.tf")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeFile { + t.Fatal("expect ClientModeFile") + } +} + +func TestS3Getter_ClientMode_notfound(t *testing.T) { + g := new(S3Getter) + + // Check the client mode when a non-existent key is looked up. This does not + // return an error, but rather should just return the file mode so that S3 + // can return an appropriate error later on. This also checks that the + // prefix is handled properly (e.g., "/fold" and "/folder" don't put the + // client mode into "dir". + mode, err := g.ClientMode( + testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/fold")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeFile { + t.Fatal("expect ClientModeFile") + } +} + +func TestS3Getter_ClientMode_collision(t *testing.T) { + g := new(S3Getter) + + // Check that the client mode is "file" if there is both an object and a + // folder with a common prefix (i.e., a "collision" in the namespace). + mode, err := g.ClientMode( + testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/collision/foo")) + if err != nil { + t.Fatalf("err: %s", err) + } + if mode != ClientModeFile { + t.Fatal("expect ClientModeFile") + } +} + +func TestS3Getter_Url(t *testing.T) { + var s3tests = []struct { + name string + url string + region string + bucket string + path string + version string + }{ + { + name: "AWSv1234", + url: "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz?version=1234", + region: "eu-west-1", + bucket: "bucket", + path: "foo/bar.baz", + version: "1234", + }, + { + name: "AWSVhostDot", + url: "s3::https://bucket.s3.eu-west-1.amazonaws.com/foo/bar.baz?version=1234", + region: "eu-west-1", + bucket: "bucket", + path: "foo/bar.baz", + version: "1234", + }, + { + name: "AWSVhostDash", + url: "s3::https://bucket.s3-eu-west-1.amazonaws.com/foo/bar.baz?version=1234", + region: "eu-west-1", + bucket: "bucket", + path: "foo/bar.baz", + version: "1234", + }, + { + name: "localhost-1", + url: "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=TESTID&aws_access_key_secret=TestSecret®ion=us-east-2&version=1", + region: "us-east-2", + bucket: "test-bucket", + path: "hello.txt", + version: "1", + }, + { + name: "localhost-2", + url: "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=TESTID&aws_access_key_secret=TestSecret&version=1", + region: "us-east-1", + bucket: "test-bucket", + path: "hello.txt", + version: "1", + }, + { + name: "localhost-3", + url: "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=TESTID&aws_access_key_secret=TestSecret", + region: "us-east-1", + bucket: "test-bucket", + path: "hello.txt", + version: "", + }, + } + + for i, pt := range s3tests { + t.Run(pt.name, func(t *testing.T) { + g := new(S3Getter) + forced, src := getForcedGetter(pt.url) + u, err := url.Parse(src) + + if err != nil { + t.Errorf("test %d: unexpected error: %s", i, err) + } + if forced != "s3" { + t.Fatalf("expected forced protocol to be s3") + } + + region, bucket, path, version, creds, err := g.parseUrl(u) + + if err != nil { + t.Fatalf("err: %s", err) + } + if region != pt.region { + t.Fatalf("expected %s, got %s", pt.region, region) + } + if bucket != pt.bucket { + t.Fatalf("expected %s, got %s", pt.bucket, bucket) + } + if path != pt.path { + t.Fatalf("expected %s, got %s", pt.path, path) + } + if version != pt.version { + t.Fatalf("expected %s, got %s", pt.version, version) + } + if &creds == nil { + t.Fatalf("expected to not be nil") + } + }) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_test.go new file mode 100644 index 0000000000..34f9e87b92 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/get_test.go @@ -0,0 +1,545 @@ +package getter + +import ( + "os" + "path/filepath" + "strings" + "testing" +) + +func TestGet_badSchema(t *testing.T) { + dst := tempDir(t) + u := testModule("basic") + u = strings.Replace(u, "file", "nope", -1) + + if err := Get(dst, u); err == nil { + t.Fatal("should error") + } +} + +func TestGet_file(t *testing.T) { + dst := tempDir(t) + u := testModule("basic") + + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +// https://github.com/hashicorp/terraform/issues/11438 +func TestGet_fileDecompressorExt(t *testing.T) { + dst := tempDir(t) + u := testModule("basic-tgz") + + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +// https://github.com/hashicorp/terraform/issues/8418 +func TestGet_filePercent2F(t *testing.T) { + dst := tempDir(t) + u := testModule("basic%2Ftest") + + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGet_fileDetect(t *testing.T) { + dst := tempDir(t) + u := filepath.Join(".", "testdata", "basic") + pwd, err := os.Getwd() + if err != nil { + t.Fatalf("err: %s", err) + } + + client := &Client{ + Src: u, + Dst: dst, + Pwd: pwd, + Dir: true, + } + + if err := client.Configure(); err != nil { + t.Fatalf("configure: %s", err) + } + + if err := client.Get(); err != nil { + t.Fatalf("get: %s", err) + } + + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("stat: %s", err) + } +} + +func TestGet_fileForced(t *testing.T) { + dst := tempDir(t) + u := testModule("basic") + u = "file::" + u + + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGet_fileSubdir(t *testing.T) { + dst := tempDir(t) + u := testModule("basic//subdir") + + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "sub.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGet_archive(t *testing.T) { + dst := tempDir(t) + u := filepath.Join("./testdata", "archive.tar.gz") + u, _ = filepath.Abs(u) + + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGetAny_archive(t *testing.T) { + dst := tempDir(t) + u := filepath.Join("./testdata", "archive.tar.gz") + u, _ = filepath.Abs(u) + + if err := GetAny(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "main.tf") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGet_archiveRooted(t *testing.T) { + dst := tempDir(t) + u := testModule("archive-rooted/archive.tar.gz") + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "root", "hello.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGet_archiveSubdirWild(t *testing.T) { + dst := tempDir(t) + u := testModule("archive-rooted/archive.tar.gz") + u += "//*" + if err := Get(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "hello.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGet_archiveSubdirWildMultiMatch(t *testing.T) { + dst := tempDir(t) + u := testModule("archive-rooted-multi/archive.tar.gz") + u += "//*" + if err := Get(dst, u); err == nil { + t.Fatal("should error") + } else if !strings.Contains(err.Error(), "multiple") { + t.Fatalf("err: %s", err) + } +} + +func TestGetAny_file(t *testing.T) { + dst := tempDir(t) + u := testModule("basic-file/foo.txt") + + if err := GetAny(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "foo.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGetAny_dir(t *testing.T) { + dst := tempDir(t) + u := filepath.Join("./testdata", "basic") + u, _ = filepath.Abs(u) + + if err := GetAny(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + check := []string{ + "main.tf", + "foo/main.tf", + } + + for _, name := range check { + mainPath := filepath.Join(dst, name) + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } + } +} + +func TestGetFile(t *testing.T) { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + u := testModule("basic-file/foo.txt") + + if err := GetFile(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + assertContents(t, dst, "Hello\n") +} + +func TestGetFile_archive(t *testing.T) { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + u := testModule("basic-file-archive/archive.tar.gz") + + if err := GetFile(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + assertContents(t, dst, "Hello\n") +} + +func TestGetFile_archiveChecksum(t *testing.T) { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + u := testModule( + "basic-file-archive/archive.tar.gz?checksum=md5:fbd90037dacc4b1ab40811d610dde2f0") + + if err := GetFile(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + assertContents(t, dst, "Hello\n") +} + +func TestGetFile_archiveNoUnarchive(t *testing.T) { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + u := testModule("basic-file-archive/archive.tar.gz") + u += "?archive=false" + + if err := GetFile(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + // Verify the main file exists + actual := testMD5(t, dst) + expected := "fbd90037dacc4b1ab40811d610dde2f0" + if actual != expected { + t.Fatalf("bad: %s", actual) + } +} + +func TestGetFile_checksum(t *testing.T) { + cases := []struct { + Append string + Err bool + }{ + { + "", + false, + }, + + // MD5 + { + "?checksum=09f7e02f1290be211da707a266f153b3", + false, + }, + { + "?checksum=md5:09f7e02f1290be211da707a266f153b3", + false, + }, + { + "?checksum=md5:09f7e02f1290be211da707a266f153b4", + true, + }, + + // SHA1 + { + "?checksum=1d229271928d3f9e2bb0375bd6ce5db6c6d348d9", + false, + }, + { + "?checksum=sha1:1d229271928d3f9e2bb0375bd6ce5db6c6d348d9", + false, + }, + { + "?checksum=sha1:1d229271928d3f9e2bb0375bd6ce5db6c6d348d0", + true, + }, + + // SHA256 + { + "?checksum=66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18", + false, + }, + { + "?checksum=sha256:66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18", + false, + }, + { + "?checksum=sha256:66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f19", + true, + }, + + // SHA512 + { + "?checksum=c2bad2223811194582af4d1508ac02cd69eeeeedeeb98d54fcae4dcefb13cc882e7640328206603d3fb9cd5f949a9be0db054dd34fbfa190c498a5fe09750cef", + false, + }, + { + "?checksum=sha512:c2bad2223811194582af4d1508ac02cd69eeeeedeeb98d54fcae4dcefb13cc882e7640328206603d3fb9cd5f949a9be0db054dd34fbfa190c498a5fe09750cef", + false, + }, + { + "?checksum=sha512:c2bad2223811194582af4d1508ac02cd69eeeeedeeb98d54fcae4dcefb13cc882e7640328206603d3fb9cd5f949a9be0db054dd34fbfa190c498a5fe09750ced", + true, + }, + } + + for _, tc := range cases { + u := testModule("basic-file/foo.txt") + tc.Append + + func() { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + if err := GetFile(dst, u); (err != nil) != tc.Err { + t.Fatalf("append: %s\n\nerr: %s", tc.Append, err) + } + + // Verify the main file exists + assertContents(t, dst, "Hello\n") + }() + } +} + +func TestGetFile_checksum_from_file(t *testing.T) { + checksums := testModule("checksum-file") + httpChecksums := httpTestModule("checksum-file") + defer httpChecksums.Close() + + cases := []struct { + Append string + WantTransfer bool + WantErr bool + }{ + { + "", + true, + false, + }, + + // md5 + { + "?checksum=file:" + checksums + "/md5-p.sum", + true, + false, + }, + { + "?checksum=file:" + httpChecksums.URL + "/md5-bsd.sum", + true, + false, + }, + { + "?checksum=file:" + checksums + "/md5-bsd-bad.sum", + false, + true, + }, + { + "?checksum=file:" + httpChecksums.URL + "/md5-bsd-wrong.sum", + true, + true, + }, + + // sha1 + { + "?checksum=file:" + checksums + "/sha1-p.sum", + true, + false, + }, + { + "?checksum=file:" + httpChecksums.URL + "/sha1.sum", + true, + false, + }, + + // sha256 + { + "?checksum=file:" + checksums + "/sha256-p.sum", + true, + false, + }, + + // sha512 + { + "?checksum=file:" + httpChecksums.URL + "/sha512-p.sum", + true, + false, + }, + { + // checksum file does not have EOL, ends line with EOF + "?checksum=file:" + httpChecksums.URL + "/sha512-p-EOF.sum", + true, + false, + }, + } + + for _, tc := range cases { + u := checksums + "/content.txt" + tc.Append + t.Run(tc.Append, func(t *testing.T) { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + if err := GetFile(dst, u); (err != nil) != tc.WantErr { + t.Fatalf("append: %s\n\nerr: %s", tc.Append, err) + } + + if tc.WantTransfer { + // Verify the main file exists + assertContents(t, dst, "I am a file with some content\n") + } + }) + } +} + +func TestGetFile_checksumURL(t *testing.T) { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + u := testModule("basic-file/foo.txt") + "?checksum=md5:09f7e02f1290be211da707a266f153b3" + + getter := &MockGetter{Proxy: new(FileGetter)} + client := &Client{ + Src: u, + Dst: dst, + Dir: false, + Getters: map[string]Getter{ + "file": getter, + }, + } + + if err := client.Get(); err != nil { + t.Fatalf("err: %s", err) + } + + if v := getter.GetFileURL.Query().Get("checksum"); v != "" { + t.Fatalf("bad: %s", v) + } +} + +func TestGetFile_filename(t *testing.T) { + dst := tempDir(t) + u := testModule("basic-file/foo.txt") + + u += "?filename=bar.txt" + + if err := GetAny(dst, u); err != nil { + t.Fatalf("err: %s", err) + } + + mainPath := filepath.Join(dst, "bar.txt") + if _, err := os.Stat(mainPath); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestGetFile_filename_path_traversal(t *testing.T) { + dst := tempDir(t) + u := testModule("basic-file/foo.txt") + + u += "?filename=../../../../../../../../../../../../../tmp/bar.txt" + + err := GetAny(dst, u) + if err == nil { + t.Fatalf("expected error") + } + if !strings.Contains(err.Error(), "filename query parameter contain path traversal") { + t.Fatalf("unexpected err: %s", err) + } +} + +func TestGetFile_checksumSkip(t *testing.T) { + dst := tempTestFile(t) + defer os.RemoveAll(filepath.Dir(dst)) + u := testModule("basic-file/foo.txt") + "?checksum=md5:09f7e02f1290be211da707a266f153b3" + + getter := &MockGetter{Proxy: new(FileGetter)} + client := &Client{ + Src: u, + Dst: dst, + Dir: false, + Getters: map[string]Getter{ + "file": getter, + }, + } + + // get the file + if err := client.Get(); err != nil { + t.Fatalf("err: %s", err) + } + + if v := getter.GetFileURL.Query().Get("checksum"); v != "" { + t.Fatalf("bad: %s", v) + } + + // remove proxy file getter and reset GetFileCalled so that we can re-test. + getter.Proxy = nil + getter.GetFileCalled = false + + if err := client.Get(); err != nil { + t.Fatalf("err: %s", err) + } + + if getter.GetFileCalled { + t.Fatalf("get should not have been called") + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/go.mod b/test/integration/licenses/github.com/hashicorp/go-getter/go.mod new file mode 100644 index 0000000000..a3726a9214 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/go.mod @@ -0,0 +1,28 @@ +module github.com/hashicorp/go-getter + +require ( + cloud.google.com/go v0.45.1 + github.com/aws/aws-sdk-go v1.15.78 + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d + github.com/cheggaaa/pb v1.0.27 + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fatih/color v1.7.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 + github.com/hashicorp/go-safetemp v1.0.0 + github.com/hashicorp/go-version v1.1.0 + github.com/klauspost/compress v1.11.2 + github.com/mattn/go-colorable v0.0.9 // indirect + github.com/mattn/go-isatty v0.0.4 // indirect + github.com/mattn/go-runewidth v0.0.4 // indirect + github.com/mitchellh/go-homedir v1.0.0 + github.com/mitchellh/go-testing-interface v1.0.0 + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.2.2 // indirect + github.com/ulikunitz/xz v0.5.8 + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e // indirect + google.golang.org/api v0.9.0 + gopkg.in/cheggaaa/pb.v1 v1.0.27 // indirect +) + +go 1.13 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/go.sum b/test/integration/licenses/github.com/hashicorp/go-getter/go.sum new file mode 100644 index 0000000000..dc9ecf9ef6 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/go.sum @@ -0,0 +1,162 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/aws/aws-sdk-go v1.15.78 h1:LaXy6lWR0YK7LKyuU0QWy2ws/LWTPfYV/UgfiBu4tvY= +github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +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 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e h1:w36l2Uw3dRan1K3TyXriXvY+6T56GNmlKGcqiQUJDfM= +golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go new file mode 100644 index 0000000000..02497c2543 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go @@ -0,0 +1,14 @@ +package url + +import ( + "net/url" +) + +// Parse parses rawURL into a URL structure. +// The rawURL may be relative or absolute. +// +// Parse is a wrapper for the Go stdlib net/url Parse function, but returns +// Windows "safe" URLs on Windows platforms. +func Parse(rawURL string) (*url.URL, error) { + return parse(rawURL) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go new file mode 100644 index 0000000000..1015f4afc5 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go @@ -0,0 +1,88 @@ +package url + +import ( + "runtime" + "testing" +) + +type parseTest struct { + rawURL string + scheme string + host string + path string + str string + err bool +} + +var parseTests = []parseTest{ + { + rawURL: "/foo/bar", + scheme: "", + host: "", + path: "/foo/bar", + str: "/foo/bar", + err: false, + }, + { + rawURL: "file:///dir/", + scheme: "file", + host: "", + path: "/dir/", + str: "file:///dir/", + err: false, + }, +} + +var winParseTests = []parseTest{ + { + rawURL: `C:\`, + scheme: `file`, + host: ``, + path: `C:/`, + str: `file://C:/`, + err: false, + }, + { + rawURL: `file://C:\`, + scheme: `file`, + host: ``, + path: `C:/`, + str: `file://C:/`, + err: false, + }, + { + rawURL: `file:///C:\`, + scheme: `file`, + host: ``, + path: `C:/`, + str: `file://C:/`, + err: false, + }, +} + +func TestParse(t *testing.T) { + if runtime.GOOS == "windows" { + parseTests = append(parseTests, winParseTests...) + } + for i, pt := range parseTests { + url, err := Parse(pt.rawURL) + if err != nil && !pt.err { + t.Errorf("test %d: unexpected error: %s", i, err) + } + if err == nil && pt.err { + t.Errorf("test %d: expected an error", i) + } + if url.Scheme != pt.scheme { + t.Errorf("test %d: expected Scheme = %q, got %q", i, pt.scheme, url.Scheme) + } + if url.Host != pt.host { + t.Errorf("test %d: expected Host = %q, got %q", i, pt.host, url.Host) + } + if url.Path != pt.path { + t.Errorf("test %d: expected Path = %q, got %q", i, pt.path, url.Path) + } + if url.String() != pt.str { + t.Errorf("test %d: expected url.String() = %q, got %q", i, pt.str, url.String()) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go new file mode 100644 index 0000000000..ed1352a917 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go @@ -0,0 +1,11 @@ +// +build !windows + +package url + +import ( + "net/url" +) + +func parse(rawURL string) (*url.URL, error) { + return url.Parse(rawURL) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go new file mode 100644 index 0000000000..4280ec59a8 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go @@ -0,0 +1,39 @@ +package url + +import ( + "fmt" + "net/url" + "path/filepath" + "strings" +) + +func parse(rawURL string) (*url.URL, error) { + // Make sure we're using "/" since URLs are "/"-based. + rawURL = filepath.ToSlash(rawURL) + + if len(rawURL) > 1 && rawURL[1] == ':' { + // Assume we're dealing with a drive letter. In which case we + // force the 'file' scheme to avoid "net/url" URL.String() prepending + // our url with "./". + rawURL = "file://" + rawURL + } + + u, err := url.Parse(rawURL) + if err != nil { + return nil, err + } + + if len(u.Host) > 1 && u.Host[1] == ':' && strings.HasPrefix(rawURL, "file://") { + // Assume we're dealing with a drive letter file path where the drive + // letter has been parsed into the URL Host. + u.Path = fmt.Sprintf("%s%s", u.Host, u.Path) + u.Host = "" + } + + // Remove leading slash for absolute file paths. + if len(u.Path) > 2 && u.Path[0] == '/' && u.Path[2] == ':' { + u.Path = u.Path[1:] + } + + return u, err +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/module_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/module_test.go new file mode 100644 index 0000000000..244c1cf2d4 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/module_test.go @@ -0,0 +1,89 @@ +package getter + +import ( + "io/ioutil" + "net/http" + "net/http/httptest" + "net/url" + "os" + "path/filepath" + "reflect" + "testing" + + urlhelper "github.com/hashicorp/go-getter/helper/url" +) + +const fixtureDir = "./testdata" + +func tempDir(t *testing.T) string { + dir, err := ioutil.TempDir("", "tf") + if err != nil { + t.Fatalf("err: %s", err) + } + if err := os.RemoveAll(dir); err != nil { + t.Fatalf("err: %s", err) + } + + return dir +} + +func tempTestFile(t *testing.T) string { + dir := tempDir(t) + return filepath.Join(dir, "foo") +} + +func testModule(n string) string { + p := filepath.Join(fixtureDir, n) + p, err := filepath.Abs(p) + if err != nil { + panic(err) + } + return fmtFileURL(p) +} +func httpTestModule(n string) *httptest.Server { + p := filepath.Join(fixtureDir, n) + p, err := filepath.Abs(p) + if err != nil { + panic(err) + } + + return httptest.NewServer(http.FileServer(http.Dir(p))) +} + +func testModuleURL(n string) *url.URL { + n, subDir := SourceDirSubdir(n) + u, err := urlhelper.Parse(testModule(n)) + if err != nil { + panic(err) + } + if subDir != "" { + u.Path += "//" + subDir + u.RawPath = u.Path + } + + return u +} + +func testURL(s string) *url.URL { + u, err := urlhelper.Parse(s) + if err != nil { + panic(err) + } + + return u +} + +func testStorage(t *testing.T) Storage { + return &FolderStorage{StorageDir: tempDir(t)} +} + +func assertContents(t *testing.T, path string, contents string) { + data, err := ioutil.ReadFile(path) + if err != nil { + t.Fatalf("err: %s", err) + } + + if !reflect.DeepEqual(data, []byte(contents)) { + t.Fatalf("bad. expected:\n\n%s\n\nGot:\n\n%s", contents, string(data)) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/netrc.go b/test/integration/licenses/github.com/hashicorp/go-getter/netrc.go new file mode 100644 index 0000000000..c7f6a3fb3f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/netrc.go @@ -0,0 +1,67 @@ +package getter + +import ( + "fmt" + "net/url" + "os" + "runtime" + + "github.com/bgentry/go-netrc/netrc" + "github.com/mitchellh/go-homedir" +) + +// addAuthFromNetrc adds auth information to the URL from the user's +// netrc file if it can be found. This will only add the auth info +// if the URL doesn't already have auth info specified and the +// the username is blank. +func addAuthFromNetrc(u *url.URL) error { + // If the URL already has auth information, do nothing + if u.User != nil && u.User.Username() != "" { + return nil + } + + // Get the netrc file path + path := os.Getenv("NETRC") + if path == "" { + filename := ".netrc" + if runtime.GOOS == "windows" { + filename = "_netrc" + } + + var err error + path, err = homedir.Expand("~/" + filename) + if err != nil { + return err + } + } + + // If the file is not a file, then do nothing + if fi, err := os.Stat(path); err != nil { + // File doesn't exist, do nothing + if os.IsNotExist(err) { + return nil + } + + // Some other error! + return err + } else if fi.IsDir() { + // File is directory, ignore + return nil + } + + // Load up the netrc file + net, err := netrc.ParseFile(path) + if err != nil { + return fmt.Errorf("Error parsing netrc file at %q: %s", path, err) + } + + machine := net.FindMachine(u.Host) + if machine == nil { + // Machine not found, no problem + return nil + } + + // Set the user info + u.User = url.UserPassword(machine.Login, machine.Password) + return nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go new file mode 100644 index 0000000000..618367619e --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go @@ -0,0 +1,63 @@ +package getter + +import ( + "net/url" + "testing" +) + +func TestAddAuthFromNetrc(t *testing.T) { + defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() + + u, err := url.Parse("http://example.com") + if err != nil { + t.Fatalf("err: %s", err) + } + + if err := addAuthFromNetrc(u); err != nil { + t.Fatalf("err: %s", err) + } + + expected := "http://foo:bar@example.com" + actual := u.String() + if expected != actual { + t.Fatalf("Mismatch: %q != %q", actual, expected) + } +} + +func TestAddAuthFromNetrc_hasAuth(t *testing.T) { + defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() + + u, err := url.Parse("http://username:password@example.com") + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := u.String() + if err := addAuthFromNetrc(u); err != nil { + t.Fatalf("err: %s", err) + } + + actual := u.String() + if expected != actual { + t.Fatalf("Mismatch: %q != %q", actual, expected) + } +} + +func TestAddAuthFromNetrc_hasUsername(t *testing.T) { + defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() + + u, err := url.Parse("http://username@example.com") + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := u.String() + if err := addAuthFromNetrc(u); err != nil { + t.Fatalf("err: %s", err) + } + + actual := u.String() + if expected != actual { + t.Fatalf("Mismatch: %q != %q", actual, expected) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/source.go b/test/integration/licenses/github.com/hashicorp/go-getter/source.go new file mode 100644 index 0000000000..48ac9234ed --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/source.go @@ -0,0 +1,77 @@ +package getter + +import ( + "fmt" + "path/filepath" + "strings" +) + +// SourceDirSubdir takes a source URL and returns a tuple of the URL without +// the subdir and the subdir. +// +// ex: +// dom.com/path/?q=p => dom.com/path/?q=p, "" +// proto://dom.com/path//*?q=p => proto://dom.com/path?q=p, "*" +// proto://dom.com/path//path2?q=p => proto://dom.com/path?q=p, "path2" +// +func SourceDirSubdir(src string) (string, string) { + + // URL might contains another url in query parameters + stop := len(src) + if idx := strings.Index(src, "?"); idx > -1 { + stop = idx + } + + // Calculate an offset to avoid accidentally marking the scheme + // as the dir. + var offset int + if idx := strings.Index(src[:stop], "://"); idx > -1 { + offset = idx + 3 + } + + // First see if we even have an explicit subdir + idx := strings.Index(src[offset:stop], "//") + if idx == -1 { + return src, "" + } + + idx += offset + subdir := src[idx+2:] + src = src[:idx] + + // Next, check if we have query parameters and push them onto the + // URL. + if idx = strings.Index(subdir, "?"); idx > -1 { + query := subdir[idx:] + subdir = subdir[:idx] + src += query + } + + return src, subdir +} + +// SubdirGlob returns the actual subdir with globbing processed. +// +// dst should be a destination directory that is already populated (the +// download is complete) and subDir should be the set subDir. If subDir +// is an empty string, this returns an empty string. +// +// The returned path is the full absolute path. +func SubdirGlob(dst, subDir string) (string, error) { + pattern := filepath.Join(dst, subDir) + + matches, err := filepath.Glob(pattern) + if err != nil { + return "", err + } + + if len(matches) == 0 { + return "", fmt.Errorf("subdir %q not found", subDir) + } + + if len(matches) > 1 { + return "", fmt.Errorf("subdir %q matches multiple paths", subDir) + } + + return matches[0], nil +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/source_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/source_test.go new file mode 100644 index 0000000000..c65f50f1b1 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/source_test.go @@ -0,0 +1,106 @@ +package getter + +import ( + "io/ioutil" + "os" + "path/filepath" + "testing" +) + +func TestSourceDirSubdir(t *testing.T) { + cases := []struct { + Input string + Dir, Sub string + }{ + { + "hashicorp.com", + "hashicorp.com", "", + }, + { + "hashicorp.com//foo", + "hashicorp.com", "foo", + }, + { + "hashicorp.com//foo?bar=baz", + "hashicorp.com?bar=baz", "foo", + }, + { + "https://hashicorp.com/path//*?archive=foo", + "https://hashicorp.com/path?archive=foo", "*", + }, + { + "https://hashicorp.com/path?checksum=file:http://url.com/....iso.sha256", + "https://hashicorp.com/path?checksum=file:http://url.com/....iso.sha256", "", + }, + { + "https://hashicorp.com/path//*?checksum=file:http://url.com/....iso.sha256", + "https://hashicorp.com/path?checksum=file:http://url.com/....iso.sha256", "*", + }, + { + "file://foo//bar", + "file://foo", "bar", + }, + } + + for i, tc := range cases { + adir, asub := SourceDirSubdir(tc.Input) + if adir != tc.Dir { + t.Fatalf("%d: bad dir: %#v", i, adir) + } + if asub != tc.Sub { + t.Fatalf("%d: bad sub: %#v", i, asub) + } + } +} + +func TestSourceSubdirGlob(t *testing.T) { + td, err := ioutil.TempDir("", "subdir-glob") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(td) + + if err := os.Mkdir(filepath.Join(td, "subdir"), 0755); err != nil { + t.Fatal(err) + } + + if err := os.Mkdir(filepath.Join(td, "subdir/one"), 0755); err != nil { + t.Fatal(err) + } + + if err := os.Mkdir(filepath.Join(td, "subdir/two"), 0755); err != nil { + t.Fatal(err) + } + + subdir := filepath.Join(td, "subdir") + + // match the exact directory + res, err := SubdirGlob(td, "subdir") + if err != nil { + t.Fatal(err) + } + if res != subdir { + t.Fatalf(`expected "subdir", got: %q`, subdir) + } + + // single match from a wildcard + res, err = SubdirGlob(td, "*") + if err != nil { + t.Fatal(err) + } + if res != subdir { + t.Fatalf(`expected "subdir", got: %q`, subdir) + } + + // multiple matches + res, err = SubdirGlob(td, "subdir/*") + if err == nil { + t.Fatalf("expected multiple matches, got %q", res) + } + + // non-existent + res, err = SubdirGlob(td, "foo") + if err == nil { + t.Fatalf("expected no matches, got %q", res) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/storage.go b/test/integration/licenses/github.com/hashicorp/go-getter/storage.go new file mode 100644 index 0000000000..2bc6b9ec33 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/storage.go @@ -0,0 +1,13 @@ +package getter + +// Storage is an interface that knows how to lookup downloaded directories +// as well as download and update directories from their sources into the +// proper location. +type Storage interface { + // Dir returns the directory on local disk where the directory source + // can be loaded from. + Dir(string) (string, bool, error) + + // Get will download and optionally update the given directory. + Get(string, string, bool) error +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-tar/permissions.tar b/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-tar/permissions.tar new file mode 100644 index 0000000000000000000000000000000000000000..0c594eaa7e7ab851852532cb04543cc19bda8001 GIT binary patch literal 3584 zcmeH|-425w4269Z-e9#*cpf)#Au*frXW8C<#hGa|nO;D$3wl$iq$%gi!P2$%(%;+H zDT@{WV2DKKv({qA0n58B++Pt0&Z4~!sBlkn^Kl`7^c>aLN|GVr$9GLlcwjW#> iqUX8?fI9a7_wT>X$M@f0^8Z@Lv`-2o1(E_G6?g+DMSD#E literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/permissions.zip b/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/permissions.zip new file mode 100644 index 0000000000000000000000000000000000000000..40db777325da7ac539eacef2854999d3c10a0227 GIT binary patch literal 808 zcmWIWW@h1H00F@Wet$3nN^mjAFr;J_r6!l;7gg$qhHx@4PbvD5_Zi1MSt#3W7ishT+y-#aw~TztQjxTnl6-4PFroHHbN?6q&x_hwX4zn7EXO^<$4L{ zrf%Ej%YBcguG@v@d>%?<=roHW<^Mi;SA=KC@s9XCytPaD`&s@@*_gk~(ahYR=RX90 z+`9|xCH?<8>jGFY|E)59nEw^?e-l&wITyf+`9J3G;v!)FZ-My_0000000000006(? M1-c8Wy8tKv0H{@EKmY&$ literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted/archive.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted/archive.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..038bdf847a401deaee21693ead822452c37fe2c6 GIT binary patch literal 173 zcmb2|=3r1zTNTN`{Pv-cch_>M@+bc}&gFiU5BppFw&;J5@|j!nzuSxN W|6R((fDG literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..999e5fc9d6974cb108aa94abadac6e2aecfac0dc GIT binary patch literal 141 zcmb2|=3qGQG&PKY`RxTqu4V_G*2L?!u6_YV$#X3GJ=j^-Ug-NCzIsRYLT=60|F>wZ`SUo>_I@-|6W0$D QtU3%5&rQtC(0BXk*g#Z8m literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt new file mode 100644 index 0000000000..86df9aae0f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt @@ -0,0 +1,2 @@ +add file + diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires new file mode 100644 index 0000000000..f634f664bf --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires @@ -0,0 +1,4 @@ +dotencode +fncache +revlogv1 +store diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00changelog.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00changelog.i new file mode 100644 index 0000000000000000000000000000000000000000..6da1bc1e97dc6dad8799cbab64e2ea8a9273e438 GIT binary patch literal 528 zcmZQzWME`~fC3;@4P`U@hk`rnu9x~osQK(%Ix$Ifsf%*CLG?wL8W3GE$Mm!#7qcRd z!^OSJKd?;72omwqEV=B=^>}vhYRG!~=>ejxFxg7V^;JV-L`jXd&PhOer=+rTh@j}%%hBW{9?W+v?SN{IR z{@{bE57=&yOBoo7fp{vI#Q^aG$jQgzX7-lU|K9k|T86DEAkBO8@7N_!HDIb@PI3YR zv#)^P79V5JjV5N>P0anhjJ6qgZ}Zq_;$`M-WN75M$-vNWlaJ394$K# z%*;#-O*U-UU|?zE~8+H~68-ISJn6r11$%Jn~3hUUC z%+xn%FqHDjM}qBr3?_4dWDyWEK`}U(XR5ITRG&>V=l&_hGdC#bY_o~bez0mNQ87pK zgf$N@+y2{m{(Q$;`N}?Z3m1{Z?3)#zt~H&jT(g%UNz*NQ Kz5P)IrG)?+$-hnj literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00manifest.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00manifest.i new file mode 100644 index 0000000000000000000000000000000000000000..48ce4c674b153195539f398ff1e1eb6aea7bda89 GIT binary patch literal 376 zcmZQzWME`~03#q}2xT+;hXRIf+oy9R`GtjZS|7jmaf#B=uR&8JsyZaZ;PC)>%p#d_9?E$&b?Fbd>K5VinW9-mZ{n3tRZc7ugMN~&p! zp|ORzsfDSDVX|qOfvJ(1X<~|@iAiFTWm=+zS&Csw62uKC|%t=mYU_QL%PtD#*T|#Wao1Z*!=}z(P-jZ_J srFo0UX_aE<#UkBHRGLGKPpbrbE0~yU@GyMNl*#nSXF?u>nHJwY03C2?ssI20 literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/foo.txt.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/foo.txt.i new file mode 100644 index 0000000000000000000000000000000000000000..974eb7aede8a04f08905786459e9c21251b121d3 GIT binary patch literal 71 zcmZQzWME`~0Cph724yq-hXS`VD^B(wUGR5yp>FqvXR{+C139ik)qtr|kJOx;d@caL CG!@7I literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main.tf.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main.tf.i new file mode 100644 index 0000000000000000000000000000000000000000..f45ddc33f19db6ef2a8f723ce4e36e10db12a436 GIT binary patch literal 112 zcmZQzWME`~00SVU4`nm_hk{)i%ZqQMPS2Zr>zb=wCx2OxuW=Ym4TvsPR`5v8$;s#9 n%FRzH%}G^IO3TkzQmE!q0D|KD(xT*41zQCrJ$;ZcS1lI+ym=or literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main__branch.tf.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main__branch.tf.i new file mode 100644 index 0000000000000000000000000000000000000000..a6bdf46f1091be151835fda73ea8ccb9f8c70c21 GIT binary patch literal 64 ocmZQzWME{#1dRWoUQPrLGn6+WD*P;%#K*02?S1MgRZ+ literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache new file mode 100644 index 0000000000..b634e1f3ab --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache @@ -0,0 +1,3 @@ +data/main.tf.i +data/foo.txt.i +data/main_branch.tf.i diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots new file mode 100644 index 0000000000..a08565294c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots @@ -0,0 +1 @@ +1 dcaed7754d58264cb9a5916215a5442377307bd1 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo new file mode 100644 index 0000000000000000000000000000000000000000..4fae5607035311eebbdaf33e347ec9edcda6e465 GIT binary patch literal 52 zcmYdEEJ@T)%g@&xT(e P9R`W#CT8a8m81ax#aSAk literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt @@ -0,0 +1 @@ +Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf new file mode 100644 index 0000000000..3830637158 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf @@ -0,0 +1,5 @@ +# Hello + +module "foo" { + source = "./foo" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf new file mode 100644 index 0000000000..b9b44f4640 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf @@ -0,0 +1,3 @@ +module "b" { + source = "../c" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf new file mode 100644 index 0000000000..fec56017dc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf @@ -0,0 +1 @@ +# Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf new file mode 100644 index 0000000000..2326ee22ac --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf @@ -0,0 +1,3 @@ +module "a" { + source = "./a" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/baz/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/baz/main.tf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf new file mode 100644 index 0000000000..22905dd531 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf @@ -0,0 +1,3 @@ +module "bar" { + source = "./baz" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf new file mode 100644 index 0000000000..19fb5dde7f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf @@ -0,0 +1,3 @@ +module "foo" { + source = "./foo//sub" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf new file mode 100644 index 0000000000..fec56017dc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf @@ -0,0 +1 @@ +# Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf new file mode 100644 index 0000000000..fec56017dc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf @@ -0,0 +1 @@ +# Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf new file mode 100644 index 0000000000..3830637158 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf @@ -0,0 +1,5 @@ +# Hello + +module "foo" { + source = "./foo" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/subdir/sub.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/subdir/sub.tf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt new file mode 100644 index 0000000000..13c6d88677 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt @@ -0,0 +1 @@ +I am a file with some content diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum new file mode 100644 index 0000000000..807f6aa162 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum @@ -0,0 +1 @@ +MD5 (content.txt) = bad diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum new file mode 100644 index 0000000000..8cc6007f14 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum @@ -0,0 +1 @@ +MD5 (content.txt) = 074729f0ccb41a391fb646c38f86ea53 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum new file mode 100644 index 0000000000..bc1c6ad3e4 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum @@ -0,0 +1 @@ +MD5 (content.txt) = 074729f0ccb41a391fb646c38f86ea54 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum new file mode 100644 index 0000000000..d6c61d90fa --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum @@ -0,0 +1 @@ +074729f0ccb41a391fb646c38f86ea54 content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum new file mode 100644 index 0000000000..5212fddbe3 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum @@ -0,0 +1 @@ +e2c7dc83ac8aa7f181314387f6dfb132cd117e3a ?content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum new file mode 100644 index 0000000000..0910848521 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum @@ -0,0 +1 @@ +e2c7dc83ac8aa7f181314387f6dfb132cd117e3a diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum new file mode 100644 index 0000000000..f782865716 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum @@ -0,0 +1 @@ +47afcdfff05a6e5d9db5f6c6df2140f04a6e7422d7ad7f6a7006a4f5a78570e4 ?content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum new file mode 100644 index 0000000000..2c72e88172 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum @@ -0,0 +1 @@ +060a8cc41c501e41b4537029661090597aeb4366702ac3cae8959f24b2c49005d6bd339833ebbeb481b127ac822d70b937c1637c8d0eaf81b6979d4c1d75d0e1 \ No newline at end of file diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum new file mode 100644 index 0000000000..c99a7dc3b0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum @@ -0,0 +1 @@ +060a8cc41c501e41b4537029661090597aeb4366702ac3cae8959f24b2c49005d6bd339833ebbeb481b127ac822d70b937c1637c8d0eaf81b6979d4c1d75d0e1 ?content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf new file mode 100644 index 0000000000..df59275018 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf @@ -0,0 +1,2 @@ +# Hello + diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf new file mode 100644 index 0000000000..548d21b99d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf @@ -0,0 +1,5 @@ +# Hello + +module "bar" { + source = "./bar" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf new file mode 100644 index 0000000000..3830637158 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf @@ -0,0 +1,5 @@ +# Hello + +module "foo" { + source = "./foo" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-bz2/single.bz2 b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-bz2/single.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..63d21a073723dfe5f5c1a12066087fe670213ab9 GIT binary patch literal 40 wcmZ>Y%CIzaj8qGbEc>?kDFXw;K?Vi^Mur6piZdizBw|mBJalrree3)b00(*wbpQYW literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-gz/single.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-gz/single.gz new file mode 100644 index 0000000000000000000000000000000000000000..00754d02d1b766c6fe83562c04e4a1a3c389596d GIT binary patch literal 29 kcmb2|=HL+Yn;OQzoR*oB%HVza{BtIT6{$vbEDQ_`0DQX$Hvj+t literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/extended_header.tar b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/extended_header.tar new file mode 100644 index 0000000000000000000000000000000000000000..aed74f06a99600f4368bf0f93ab297d081ce74d8 GIT binary patch literal 10240 zcmeIyOK!s;5C&k@Jw5uwHyVHV zuk~h|gWs-SlaHye+c!?l7{h8$t?enOn2^#ct?HHHLg~S>&Fw$sbjQ#Ay0i+cS3{6ap z3>g#*XyF)iGfRt05{rON%SuWtO3BPamxl9!%F@!{JWK}EA0STxfdZz2!6}l068}jw eaU?K2NRNM`(fFrHWQ-a*8UmvsFd72T5C8xrgEKz> literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/unix_time_0.tar b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/unix_time_0.tar new file mode 100644 index 0000000000000000000000000000000000000000..67cb72e1aa3fb85ed20b5bbdeb6b79135d99584f GIT binary patch literal 10240 zcmeIy(F(#K7=~dl#XHEMZr9_|gCGjr26gxChZeSz7|ft}{}bIDPM%MVr<{)CHQx`a zTA8^z@73Hioi}AGLsIf?DP_UhwxVL;Pis2^YX z4^v-h4@j`v@^{ua^8dy*de1*p`K9FFI#-_iwmC z3TK~333zkY%CIzaj8qGbjI7@Agn>aMfZ+fG3j+g(0)xRBR?TI?N$TA@mF8%8=kY5~ literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/multiple.tar.bz2 b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/multiple.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..1d59e6ad2ce760bf7ff834cee8570812ae501c24 GIT binary patch literal 166 zcmV;X09pS+T4*^jL0KkKS*=**^Z)>``;gHP2#`Pke}Di8Yi6DR1ONaiFaWqlG{j*V zU;qHdn2aM#000G2H8h%;lru)7C#jS5O`9*CnlxbJKvO7z7UyBRg2+OM-B@PTMx>`H zWZ)vlH64^mMhc_9WTiTM;^eF)#j7-}RthNzu1dCASsqclX3q}yyBF&hr=||A9vHbi UuDR^Hq9EA2k}1N3g=)typwQSw`2YX_ literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/ordering.tar.bz2 b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/ordering.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..46f0d814a6e18920c439ff7eef39b7bedc5fb548 GIT binary patch literal 248 zcmVOD-F4K(#MXu!&8#Bv_bi;JH=ZKGGC^f)Isdsi{!^-KYv^%{>s%x`!D*mO0S#*Wbg{9VZu;X*<)AdK{;By2NC#0hYyhCR~w{Pwah*C7LewukF%UHc4vzO8hz+9IHtv3LJQ!E(`&M))_)b(-tu-EZ2c*ZQKSU{X&+{@V9FCik+x?$Cc89r@HscY5K8 z$~!Z(lUK#RTPbfi--cuE^UL?F6YQgYy_eemG5Y`STmL=&|8M-q%zywgw}qcRy!Dnr HgMk46B&J9$ literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple_dir.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple_dir.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..452e6bef19f6217c11449ce77a70a432a9190076 GIT binary patch literal 194 zcmV;z06qU7iwFSozTH*;1MSpJ3c@fDhT*O~MNZJ>XPREYYlybAP!ZaAe`8xj1Pd-= z5#MJsn~+TMG0BTlHxyY?TI;GT)l~glwUxOpl(F7d&Q(rCY2%EQOqFTdnq9|m7-B2u zE*#ss@7p));#SKcmDqWJL{SMZ(#lb0000000000008)XH_0s6MgS-P0PK!n(*OVf literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/ordering.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/ordering.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..4f6dcc3b66bfe30061b47b5e07144afdbb7e4573 GIT binary patch literal 187 zcmV;s07U;EiwFSs_25_l1MQQ`3c@fDMZ5MZ0`BePG0Eoy7g-e1)+Ac|`;JJp3m*s# zMVzy_kOy;z%kA5^3o+IEW9@x&XtMX4?o!PP09a!LsdNZa9kD`cuudTwX$45D04o9W z+IY?>yNO`A?4N5E|{h0AN?;jgZkhQ-}N7^{daV%92)As pp%0b7VvZ*KdH=`!OV0Qvf8`YAuMKL>pJ5oLBm>PK6tVye0067xT!{bx literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/outside_parent.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/outside_parent.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..52cb14d0f88e3c1f9c67dfcf73c937936407535f GIT binary patch literal 192 zcmb2|=HQrSx-*LDe?fk-UP)pR!`sVy`I-zw+8&;ZaqYF9BKAtRg8keHe=nvh4EOf4 z#>(&rtIhfzxo=^7QPHe97JjRCegAlNdXm1@2Cuc1n|{vnN8 jr&}fb-%W8(Id3m`{Nu;hd<@8-;dPo|NzQQw4F(1PJX<=r literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/empty.tar.xz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/empty.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..94451c0687f5871d650ec1e6dfc9fd00c032f6ac GIT binary patch literal 108 zcmV-y0F(dyH+ooF000E$*0e?f03iVu0001VFXf})C;tE}T>t=Y{r~@?xBo{zNELE9 zVNtk}DCVPv2l?*g9)i;^#X39zOR;{*id-@qWB>rK7!tEDRm?L00Z4#Q0002&vv0N!GYZUQ($2I#_b} z>oC8b$t$R`$L5H0txlV3Gj>X*7jOQ&v-S~xRZ+I?mmU+DN_)jdidSaZK1JO;z@xQ6 zu)zRW3@yQs#S#iJfyqh*8@T0;IH#3@>7JxKW^2e6i_G18X1Mw%c*eEd?^=Yx^VZPs zIgTybN-2N@X)m+k!1Ul#i>B5f0002BTz1gOS!vM#0jB|gPyhh1M9F)x#Ao{g00000 G1X)^tK3-M; literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple_dir.tar.xz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple_dir.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..8de936c932d62d1c21daddf504ef15e6fcb76ab9 GIT binary patch literal 232 zcmVuvg$p>;GD6-*?fXk_4 zLp)$A(3sti>x9gailfrxDUVh_C+0rWf^Q#*N}bkddwrw?iLm)N7qK#9i{dPy&7kxWEjKG;S~A9T75{2rPr~))vmEO}%p@rTR$Bv|q%Bx?eo6L#%ohPT1 z__aqTq|yGI?x~}Sn?PGj=GnGjd@FD+5yzBm!qk6MKo%bQe^Z>xjevjhp^{@vp@_Vt z(omRw;C61&VoCeO3n43`_gjq5s4>DAQI*};4Y4sJsfMrM#Yx4+h<4-V-3OIy5C$ix zGBjv7pc+QVQO32_#&hFqUD;SnJm>%JA7)QEvv0N!GSFA+G`1uT>U5 za7vQNgao|r!+F=n80t5DLLSeS0L|^9a?Y2%4qgdJt07g7g7G~mxKA%W?prH*UZqb2u;#buVN=izs`L$R1r1;JvwLlPBx2j2n zhut#(5(@klm{bh>@-Q3r${&s+m}iA}Ct3cx5c9w7EYc7luv6Os{oljbdNA+8y{#*klBug9tVu{5BYy4ld<9LwjYSK{Tpom3OUD%zqb#WKa+R79b!4 zqqxuk{oRAHT%7~R1jz^gw`KNJH<)U=iy28%2QUN)r!XwAl!10p3Be?sg$Hx@GCDaU HjbMqH8T3J+ literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/ordering.tar.zst b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/ordering.tar.zst new file mode 100644 index 0000000000000000000000000000000000000000..d9cbbeeefc3ac468495999a5dec089e17fa593d9 GIT binary patch literal 164 zcmV;V09*ekwJ-eyV7&wYf=3q_fT;~Y*zQIxL)?oKGNB}WZjz5G95$Pg0_9rJmzzKP zTG6N9T=e>1+h%~J&EE5g^cO?froVV=CDW2N*+6oN(1iC=?j3T__P++=N||N&-`5 FVvE3mK#c$Z literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/single.tar.zst b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/single.tar.zst new file mode 100644 index 0000000000000000000000000000000000000000..551371c387edb9e965aee440d95469b7fe2b434e GIT binary patch literal 104 zcmV-u0GIzLwJ-eyVBG=$(u5BbkO2nJ Kr=SH^v;eulpD`f- literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-xz/single.xz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-xz/single.xz new file mode 100644 index 0000000000000000000000000000000000000000..33d92e2b8bfd8fda39305b2754ecaa80383c4f58 GIT binary patch literal 60 zcmexsUKJ6=z`*kC+7>q^21Q0O1_p)_{ill=8JN@Z^SK!QUtbetU^wR!1EUN}zRsM3 Q^4mVwG6K~wutY`y07|YBvj6}9 literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/empty.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/empty.zip new file mode 100644 index 0000000000000000000000000000000000000000..15cb0ecb3e219d1701294bfdf0fe3f5cb5d208e7 GIT binary patch literal 22 NcmWIWW@Tf*000g10H*)| literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/multiple.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/multiple.zip new file mode 100644 index 0000000000000000000000000000000000000000..a032181d43b89865241dd9e1d05dc5712706267d GIT binary patch literal 306 zcmWIWW@h1H0D%o5Ivy)hjp|r{Y!GH;kYPy6%tzw+5H!Mwun~+*a?H5gApx|AfdObG!;(f23+gIXh^x?C6yQy)QO;1KfUd)3 S6e}CZJ|-ZX2Bh0S90mY1;x;}2 literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/outside_parent.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/outside_parent.zip new file mode 100644 index 0000000000000000000000000000000000000000..bafd7d6f361b997b579bdda1feb4c1269a78ff47 GIT binary patch literal 237 zcmWIWW@Zs#0D&!$RX%Erf*#U9HVAVAv7VlON@{MtUO|4cvZ8)cW}bd=23KlwM!tea zYEDkRLU?{rP6}55iWxv{aKH{^6N4fcr!AIFypogrl+A1#6q$dT_a2(hz6Mt Z0}YKXKqlNaRyL3X6AY!-u%r>hf|$q(F%iwQ0B=?{kQzoH^a9dOAPxfna#|Ph literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir.zip new file mode 100644 index 0000000000000000000000000000000000000000..9fafb407d5aadff1697c141514b8042eab118b4f GIT binary patch literal 466 zcmWIWW@h1H0D-kdr5*|fR%UEKHVCsa$S|a3=A;^ihHx@4UrYTE_7#XrE4UdLS-vtd zFtCUK6=kI6V-N;xL~{iX!hqzA z%$yXkDffU50bw*#V2)vAl4Hi@Cke3AfX-)F(gGeFia#fkA-b wt)nZ@D7Zg?hGF$1!Z1u%VHniUKoha}H^7?}6j2P!K==wsUjlI$0OR^sn*aa+ literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_empty.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_empty.zip new file mode 100644 index 0000000000000000000000000000000000000000..d95cb90d2a3cc524cfafedcf83bb38b60ca0b43a GIT binary patch literal 308 zcmWIWW@h1H0D-kdr5*|fR%UEKHVCsa$S|a3=A;^ihHx@4UrYTEmXr1&th9ogfsy4a zBLf4A2vAW*YEDi*R{-3Q-#|lv!f?P2G^DsRDJ8Q=A8bq}(1>D8V*zabkcsD=26fn1FCDke&$Q GFaQ8720M)a literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zst/single.zst b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zst/single.zst new file mode 100644 index 0000000000000000000000000000000000000000..5a56316bf434503831e56eb69600d6f0392eb521 GIT binary patch literal 17 YcmdPcs{dDoMUjCaEkB=2H&jIe04*m3UjP6A literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/detect-file-symlink-pwd/real/hello.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/detect-file-symlink-pwd/real/hello.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/foo/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/foo/main.tf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf new file mode 100644 index 0000000000..98efd6e4ff --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf @@ -0,0 +1,7 @@ +module "foo" { + source = "./foo" +} + +module "foo" { + source = "./foo" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic new file mode 100644 index 0000000000..574dd49ac5 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic @@ -0,0 +1,3 @@ +machine example.com +login foo +password bar diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf new file mode 100644 index 0000000000..4d68c80b3e --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf @@ -0,0 +1 @@ +variable "memory" { default = "foo" } diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf new file mode 100644 index 0000000000..4b627bbe57 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf @@ -0,0 +1,8 @@ +module "child" { + source = "./child" +} + +module "child2" { + source = "./child" + memory = "${module.child.memory_max}" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/child/main.tf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf new file mode 100644 index 0000000000..a19233e12d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf @@ -0,0 +1,7 @@ +module "child" { + source = "./child" +} + +resource "aws_instance" "foo" { + memory = "${module.child.memory}" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/child/main.tf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf new file mode 100644 index 0000000000..7cc785d178 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf @@ -0,0 +1,5 @@ +module "child" { + source = "./child" + + memory = "foo" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf new file mode 100644 index 0000000000..93b3654033 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf @@ -0,0 +1,3 @@ +# Duplicate resources +resource "aws_instance" "foo" {} +resource "aws_instance" "foo" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf new file mode 100644 index 0000000000..813f7ef8ec --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf @@ -0,0 +1,3 @@ +module "foo" { + source = "./child" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf new file mode 100644 index 0000000000..2cfd2a80f5 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf @@ -0,0 +1,3 @@ +variable "memory" {} + +output "result" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf new file mode 100644 index 0000000000..5f3ad8da5b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf @@ -0,0 +1,8 @@ +module "child" { + source = "./child" + memory = "1G" +} + +resource "aws_instance" "foo" { + memory = "${module.child.result}" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf new file mode 100644 index 0000000000..618ae3c42e --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf @@ -0,0 +1 @@ +variable "memory" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf new file mode 100644 index 0000000000..0f6991c536 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf @@ -0,0 +1,3 @@ +module "child" { + source = "./child" +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf new file mode 100644 index 0000000000..93b3654033 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf @@ -0,0 +1,3 @@ +# Duplicate resources +resource "aws_instance" "foo" {} +resource "aws_instance" "foo" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/url.go b/test/integration/licenses/github.com/hashicorp/go-getter/url.go new file mode 100644 index 0000000000..a9aed7f508 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/url.go @@ -0,0 +1,25 @@ +package getter + +import "net/url" + +// RedactURL is a port of url.Redacted from the standard library, +// which is like url.String but replaces any password with "redacted". +// Only the password in u.URL is redacted. This allows the library +// to maintain compatibility with go1.14. +// This port was also extended to redact SSH key from URL query parameter. +func RedactURL(u *url.URL) string { + if u == nil { + return "" + } + + ru := *u + if _, has := ru.User.Password(); has { + ru.User = url.UserPassword(ru.User.Username(), "redacted") + } + q := ru.Query() + if q.Get("sshkey") != "" { + q.Set("sshkey", "redacted") + ru.RawQuery = q.Encode() + } + return ru.String() +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/url_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/url_test.go new file mode 100644 index 0000000000..720359e5c7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/url_test.go @@ -0,0 +1,95 @@ +package getter + +import ( + "net/url" + "testing" +) + +func TestRedactURL(t *testing.T) { + cases := []struct { + name string + url *url.URL + want string + }{ + { + name: "non-blank Password", + url: &url.URL{ + Scheme: "http", + Host: "host.tld", + Path: "this:that", + User: url.UserPassword("user", "password"), + }, + want: "http://user:redacted@host.tld/this:that", + }, + { + name: "blank Password", + url: &url.URL{ + Scheme: "http", + Host: "host.tld", + Path: "this:that", + User: url.User("user"), + }, + want: "http://user@host.tld/this:that", + }, + { + name: "nil User", + url: &url.URL{ + Scheme: "http", + Host: "host.tld", + Path: "this:that", + User: url.UserPassword("", "password"), + }, + want: "http://:redacted@host.tld/this:that", + }, + { + name: "blank Username, blank Password", + url: &url.URL{ + Scheme: "http", + Host: "host.tld", + Path: "this:that", + }, + want: "http://host.tld/this:that", + }, + { + name: "empty URL", + url: &url.URL{}, + want: "", + }, + { + name: "nil URL", + url: nil, + want: "", + }, + { + name: "non-blank SSH key in URL query parameter", + url: &url.URL{ + Scheme: "ssh", + User: url.User("git"), + Host: "github.com", + Path: "hashicorp/go-getter-test-private.git", + RawQuery: "sshkey=LS0tLS1CRUdJTiBPUE", + }, + want: "ssh://git@github.com/hashicorp/go-getter-test-private.git?sshkey=redacted", + }, + { + name: "blank SSH key in URL query parameter", + url: &url.URL{ + Scheme: "ssh", + User: url.User("git"), + Host: "github.com", + Path: "hashicorp/go-getter-test-private.git", + RawQuery: "sshkey=", + }, + want: "ssh://git@github.com/hashicorp/go-getter-test-private.git?sshkey=", + }, + } + + for _, tt := range cases { + t := t + t.Run(tt.name, func(t *testing.T) { + if g, w := RedactURL(tt.url), tt.want; g != w { + t.Fatalf("got: %q\nwant: %q", g, w) + } + }) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/util_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/util_test.go new file mode 100644 index 0000000000..a3e7d829cb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-getter/util_test.go @@ -0,0 +1,49 @@ +package getter + +import ( + "io" + "io/ioutil" + "os" + "strings" + "testing" +) + +// tempEnv sets the env var temporarily and returns a function that should +// be deferred to clean it up. +func tempEnv(t *testing.T, k, v string) func() { + old := os.Getenv(k) + + // Set env + if err := os.Setenv(k, v); err != nil { + t.Fatalf("err: %s", err) + } + + // Easy cleanup + return func() { + if err := os.Setenv(k, old); err != nil { + t.Fatalf("err: %s", err) + } + } +} + +// tempFileContents writes a temporary file and returns the path and a function +// to clean it up. +func tempFileContents(t *testing.T, contents string) (string, func()) { + tf, err := ioutil.TempFile("", "getter") + if err != nil { + t.Fatalf("err: %s", err) + } + + if _, err := io.Copy(tf, strings.NewReader(contents)); err != nil { + t.Fatalf("err: %s", err) + } + + tf.Close() + + path := tf.Name() + return path, func() { + if err := os.Remove(path); err != nil { + t.Fatalf("err: %s", err) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE b/test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE new file mode 100644 index 0000000000..be2cc4dfb6 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE @@ -0,0 +1,362 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the terms of + a Secondary License. + +1.6. "Executable Form" + + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a + separate file or files, that is not Covered Software. + +1.8. "License" + + means this document. + +1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether + at the time of the initial grant or subsequently, any and all of the + rights conveyed by this License. + +1.10. "Modifications" + + means any of the following: + + a. any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the License, + by the making, using, selling, offering for sale, having made, import, + or transfer of either its Contributions or its Contributor Version. + +1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution + become effective for each Contribution on the date the Contributor first + distributes such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under + this License. No additional rights or licenses will be implied from the + distribution or licensing of Covered Software under this License. + Notwithstanding Section 2.1(b) above, no patent license is granted by a + Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of + its Contributions. + + This License does not grant any rights in the trademarks, service marks, + or logos of any Contributor (except as may be necessary to comply with + the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this + License (see Section 10.2) or under the terms of a Secondary License (if + permitted under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its + Contributions are its original creation(s) or it has sufficient rights to + grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under + applicable copyright doctrines of fair use, fair dealing, or other + equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under + the terms of this License. You must inform recipients that the Source + Code Form of the Covered Software is governed by the terms of this + License, and how they can obtain a copy of this License. You may not + attempt to alter or restrict the recipients' rights in the Source Code + Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter the + recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for + the Covered Software. If the Larger Work is a combination of Covered + Software with a work governed by one or more Secondary Licenses, and the + Covered Software is not Incompatible With Secondary Licenses, this + License permits You to additionally distribute such Covered Software + under the terms of such Secondary License(s), so that the recipient of + the Larger Work may, at their option, further distribute the Covered + Software under the terms of either this License or such Secondary + License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices + (including copyright notices, patent notices, disclaimers of warranty, or + limitations of liability) contained within the Source Code Form of the + Covered Software, except that You may alter any license notices to the + extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on + behalf of any Contributor. You must make it absolutely clear that any + such warranty, support, indemnity, or liability obligation is offered by + You alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, + judicial order, or regulation then You must: (a) comply with the terms of + this License to the maximum extent possible; and (b) describe the + limitations and the code they affect. Such description must be placed in a + text file included with all distributions of the Covered Software under + this License. Except to the extent prohibited by statute or regulation, + such description must be sufficiently detailed for a recipient of ordinary + skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing + basis, if such Contributor fails to notify You of the non-compliance by + some reasonable means prior to 60 days after You have come back into + compliance. Moreover, Your grants from a particular Contributor are + reinstated on an ongoing basis if such Contributor notifies You of the + non-compliance by some reasonable means, this is the first time You have + received notice of non-compliance with this License from such + Contributor, and You become compliant prior to 30 days after Your receipt + of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, + counter-claims, and cross-claims) alleging that a Contributor Version + directly or indirectly infringes any patent, then the rights granted to + You by any and all Contributors for the Covered Software under Section + 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, + without warranty of any kind, either expressed, implied, or statutory, + including, without limitation, warranties that the Covered Software is free + of defects, merchantable, fit for a particular purpose or non-infringing. + The entire risk as to the quality and performance of the Covered Software + is with You. Should any Covered Software prove defective in any respect, + You (not any Contributor) assume the cost of any necessary servicing, + repair, or correction. This disclaimer of warranty constitutes an essential + part of this License. No use of any Covered Software is authorized under + this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from + such party's negligence to the extent applicable law prohibits such + limitation. Some jurisdictions do not allow the exclusion or limitation of + incidental or consequential damages, so this exclusion and limitation may + not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts + of a jurisdiction where the defendant maintains its principal place of + business and such litigation shall be governed by laws of that + jurisdiction, without reference to its conflict-of-law provisions. Nothing + in this Section shall prevent a party's ability to bring cross-claims or + counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. Any law or regulation which provides that + the language of a contract shall be construed against the drafter shall not + be used to construe this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version + of the License under which You originally received the Covered Software, + or under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a + modified version of this License if you rename the license and remove + any references to the name of the license steward (except to note that + such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses If You choose to distribute Source Code Form that is + Incompatible With Secondary Licenses under the terms of this version of + the License, the notice described in Exhibit B of this License must be + attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, +then You may include the notice in a location (such as a LICENSE file in a +relevant directory) where a recipient would be likely to look for such a +notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible + With Secondary Licenses", as defined by + the Mozilla Public License, v. 2.0. diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/README.md b/test/integration/licenses/github.com/hashicorp/go-safetemp/README.md new file mode 100644 index 0000000000..02ece33171 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-safetemp/README.md @@ -0,0 +1,10 @@ +# go-safetemp +[![Godoc](https://godoc.org/github.com/hashcorp/go-safetemp?status.svg)](https://godoc.org/github.com/hashicorp/go-safetemp) + +Functions for safely working with temporary directories and files. + +## Why? + +The Go standard library provides the excellent `ioutil` package for +working with temporary directories and files. This library builds on top +of that to provide safe abstractions above that. diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod b/test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod new file mode 100644 index 0000000000..02bc5f5bb5 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod @@ -0,0 +1 @@ +module github.com/hashicorp/go-safetemp diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go b/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go new file mode 100644 index 0000000000..c4ae72b789 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go @@ -0,0 +1,40 @@ +package safetemp + +import ( + "io" + "io/ioutil" + "os" + "path/filepath" +) + +// Dir creates a new temporary directory that isn't yet created. This +// can be used with calls that expect a non-existent directory. +// +// The directory is created as a child of a temporary directory created +// within the directory dir starting with prefix. The temporary directory +// returned is always named "temp". The parent directory has the specified +// prefix. +// +// The returned io.Closer should be used to clean up the returned directory. +// This will properly remove the returned directory and any other temporary +// files created. +// +// If an error is returned, the Closer does not need to be called (and will +// be nil). +func Dir(dir, prefix string) (string, io.Closer, error) { + // Create the temporary directory + td, err := ioutil.TempDir(dir, prefix) + if err != nil { + return "", nil, err + } + + return filepath.Join(td, "temp"), pathCloser(td), nil +} + +// pathCloser implements io.Closer to remove the given path on Close. +type pathCloser string + +// Close deletes this path. +func (p pathCloser) Close() error { + return os.RemoveAll(string(p)) +} diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go b/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go new file mode 100644 index 0000000000..6f7155c647 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go @@ -0,0 +1,46 @@ +package safetemp + +import ( + "os" + "path/filepath" + "testing" +) + +func TestDir(t *testing.T) { + d, c, err := Dir("", "test") + if err != nil { + t.Fatalf("err: %s", err) + } + + if _, err := os.Stat(d); err == nil || !os.IsNotExist(err) { + t.Fatalf("directory %q should not exist", d) + } + + parent := filepath.Dir(d) + fi, err := os.Stat(parent) + if err != nil { + t.Fatalf("parent directory error: %s", err) + } + if v := fi.Mode().Perm();v != 0700 { + t.Fatalf("parent directory should be 0700: %s", v) + } + + // Create the directory + if err := os.MkdirAll(d, 0755); err != nil { + t.Fatalf("err: %s", err) + } + if _, err := os.Stat(d); err != nil { + t.Fatalf("directory %q should exist", d) + } + + // Close should remove it + if err := c.Close(); err != nil { + t.Fatalf("err: %s", err) + } + if _, err := os.Stat(d); err == nil || !os.IsNotExist(err) { + t.Fatalf("directory %q should not exist", d) + } + if _, err := os.Stat(parent); err == nil || !os.IsNotExist(err) { + t.Fatalf("directory %q should not exist", parent) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml b/test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml new file mode 100644 index 0000000000..7289c6b0a9 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml @@ -0,0 +1,60 @@ +version: 2.1 + +references: + images: + go: &GOLANG_IMAGE circleci/golang:latest + environments: + tmp: &TEST_RESULTS_PATH /tmp/test-results # path to where test results are saved + +# reusable 'executor' object for jobs +executors: + go: + docker: + - image: *GOLANG_IMAGE + environment: + - TEST_RESULTS: *TEST_RESULTS_PATH + +jobs: + go-test: + executor: go + steps: + - checkout + - run: mkdir -p $TEST_RESULTS + + - restore_cache: # restore cache from dev-build job + keys: + - go-version-modcache-v1-{{ checksum "go.mod" }} + + - run: go mod download + + # Save go module cache if the go.mod file has changed + - save_cache: + key: go-version-modcache-v1-{{ checksum "go.mod" }} + paths: + - "/go/pkg/mod" + + # check go fmt output because it does not report non-zero when there are fmt changes + - run: + name: check go fmt + command: | + files=$(go fmt ./...) + if [ -n "$files" ]; then + echo "The following file(s) do not conform to go fmt:" + echo "$files" + exit 1 + fi + + # run go tests with gotestsum + - run: | + PACKAGE_NAMES=$(go list ./...) + gotestsum --format=short-verbose --junitfile $TEST_RESULTS/gotestsum-report.xml -- $PACKAGE_NAMES + - store_test_results: + path: *TEST_RESULTS_PATH + - store_artifacts: + path: *TEST_RESULTS_PATH + +workflows: + version: 2 + test-and-build: + jobs: + - go-test diff --git a/test/integration/licenses/github.com/hashicorp/go-version/LICENSE b/test/integration/licenses/github.com/hashicorp/go-version/LICENSE new file mode 100644 index 0000000000..c33dcc7c92 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/test/integration/licenses/github.com/hashicorp/go-version/README.md b/test/integration/licenses/github.com/hashicorp/go-version/README.md new file mode 100644 index 0000000000..851a337beb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/README.md @@ -0,0 +1,66 @@ +# Versioning Library for Go +[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/master) +[![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version) + +go-version is a library for parsing versions and version constraints, +and verifying versions against a set of constraints. go-version +can sort a collection of versions properly, handles prerelease/beta +versions, can increment versions, etc. + +Versions used with go-version must follow [SemVer](http://semver.org/). + +## Installation and Usage + +Package documentation can be found on +[GoDoc](http://godoc.org/github.com/hashicorp/go-version). + +Installation can be done with a normal `go get`: + +``` +$ go get github.com/hashicorp/go-version +``` + +#### Version Parsing and Comparison + +```go +v1, err := version.NewVersion("1.2") +v2, err := version.NewVersion("1.5+metadata") + +// Comparison example. There is also GreaterThan, Equal, and just +// a simple Compare that returns an int allowing easy >=, <=, etc. +if v1.LessThan(v2) { + fmt.Printf("%s is less than %s", v1, v2) +} +``` + +#### Version Constraints + +```go +v1, err := version.NewVersion("1.2") + +// Constraints example. +constraints, err := version.NewConstraint(">= 1.0, < 1.4") +if constraints.Check(v1) { + fmt.Printf("%s satisfies constraints %s", v1, constraints) +} +``` + +#### Version Sorting + +```go +versionsRaw := []string{"1.1", "0.7.1", "1.4-beta", "1.4", "2"} +versions := make([]*version.Version, len(versionsRaw)) +for i, raw := range versionsRaw { + v, _ := version.NewVersion(raw) + versions[i] = v +} + +// After this, the versions are properly sorted +sort.Sort(version.Collection(versions)) +``` + +## Issues and Contributing + +If you find an issue with this library, please report an issue. If you'd +like, we welcome any contributions. Fork this library and submit a pull +request. diff --git a/test/integration/licenses/github.com/hashicorp/go-version/constraint.go b/test/integration/licenses/github.com/hashicorp/go-version/constraint.go new file mode 100644 index 0000000000..d055759611 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/constraint.go @@ -0,0 +1,204 @@ +package version + +import ( + "fmt" + "reflect" + "regexp" + "strings" +) + +// Constraint represents a single constraint for a version, such as +// ">= 1.0". +type Constraint struct { + f constraintFunc + check *Version + original string +} + +// Constraints is a slice of constraints. We make a custom type so that +// we can add methods to it. +type Constraints []*Constraint + +type constraintFunc func(v, c *Version) bool + +var constraintOperators map[string]constraintFunc + +var constraintRegexp *regexp.Regexp + +func init() { + constraintOperators = map[string]constraintFunc{ + "": constraintEqual, + "=": constraintEqual, + "!=": constraintNotEqual, + ">": constraintGreaterThan, + "<": constraintLessThan, + ">=": constraintGreaterThanEqual, + "<=": constraintLessThanEqual, + "~>": constraintPessimistic, + } + + ops := make([]string, 0, len(constraintOperators)) + for k := range constraintOperators { + ops = append(ops, regexp.QuoteMeta(k)) + } + + constraintRegexp = regexp.MustCompile(fmt.Sprintf( + `^\s*(%s)\s*(%s)\s*$`, + strings.Join(ops, "|"), + VersionRegexpRaw)) +} + +// NewConstraint will parse one or more constraints from the given +// constraint string. The string must be a comma-separated list of +// constraints. +func NewConstraint(v string) (Constraints, error) { + vs := strings.Split(v, ",") + result := make([]*Constraint, len(vs)) + for i, single := range vs { + c, err := parseSingle(single) + if err != nil { + return nil, err + } + + result[i] = c + } + + return Constraints(result), nil +} + +// Check tests if a version satisfies all the constraints. +func (cs Constraints) Check(v *Version) bool { + for _, c := range cs { + if !c.Check(v) { + return false + } + } + + return true +} + +// Returns the string format of the constraints +func (cs Constraints) String() string { + csStr := make([]string, len(cs)) + for i, c := range cs { + csStr[i] = c.String() + } + + return strings.Join(csStr, ",") +} + +// Check tests if a constraint is validated by the given version. +func (c *Constraint) Check(v *Version) bool { + return c.f(v, c.check) +} + +func (c *Constraint) String() string { + return c.original +} + +func parseSingle(v string) (*Constraint, error) { + matches := constraintRegexp.FindStringSubmatch(v) + if matches == nil { + return nil, fmt.Errorf("Malformed constraint: %s", v) + } + + check, err := NewVersion(matches[2]) + if err != nil { + return nil, err + } + + return &Constraint{ + f: constraintOperators[matches[1]], + check: check, + original: v, + }, nil +} + +func prereleaseCheck(v, c *Version) bool { + switch vPre, cPre := v.Prerelease() != "", c.Prerelease() != ""; { + case cPre && vPre: + // A constraint with a pre-release can only match a pre-release version + // with the same base segments. + return reflect.DeepEqual(c.Segments64(), v.Segments64()) + + case !cPre && vPre: + // A constraint without a pre-release can only match a version without a + // pre-release. + return false + + case cPre && !vPre: + // OK, except with the pessimistic operator + case !cPre && !vPre: + // OK + } + return true +} + +//------------------------------------------------------------------- +// Constraint functions +//------------------------------------------------------------------- + +func constraintEqual(v, c *Version) bool { + return v.Equal(c) +} + +func constraintNotEqual(v, c *Version) bool { + return !v.Equal(c) +} + +func constraintGreaterThan(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) == 1 +} + +func constraintLessThan(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) == -1 +} + +func constraintGreaterThanEqual(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) >= 0 +} + +func constraintLessThanEqual(v, c *Version) bool { + return prereleaseCheck(v, c) && v.Compare(c) <= 0 +} + +func constraintPessimistic(v, c *Version) bool { + // Using a pessimistic constraint with a pre-release, restricts versions to pre-releases + if !prereleaseCheck(v, c) || (c.Prerelease() != "" && v.Prerelease() == "") { + return false + } + + // If the version being checked is naturally less than the constraint, then there + // is no way for the version to be valid against the constraint + if v.LessThan(c) { + return false + } + // We'll use this more than once, so grab the length now so it's a little cleaner + // to write the later checks + cs := len(c.segments) + + // If the version being checked has less specificity than the constraint, then there + // is no way for the version to be valid against the constraint + if cs > len(v.segments) { + return false + } + + // Check the segments in the constraint against those in the version. If the version + // being checked, at any point, does not have the same values in each index of the + // constraints segments, then it cannot be valid against the constraint. + for i := 0; i < c.si-1; i++ { + if v.segments[i] != c.segments[i] { + return false + } + } + + // Check the last part of the segment in the constraint. If the version segment at + // this index is less than the constraints segment at this index, then it cannot + // be valid against the constraint + if c.segments[cs-1] > v.segments[cs-1] { + return false + } + + // If nothing has rejected the version by now, it's valid + return true +} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go b/test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go new file mode 100644 index 0000000000..9c5bee312c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go @@ -0,0 +1,126 @@ +package version + +import ( + "testing" +) + +func TestNewConstraint(t *testing.T) { + cases := []struct { + input string + count int + err bool + }{ + {">= 1.2", 1, false}, + {"1.0", 1, false}, + {">= 1.x", 0, true}, + {">= 1.2, < 1.0", 2, false}, + + // Out of bounds + {"11387778780781445675529500000000000000000", 0, true}, + } + + for _, tc := range cases { + v, err := NewConstraint(tc.input) + if tc.err && err == nil { + t.Fatalf("expected error for input: %s", tc.input) + } else if !tc.err && err != nil { + t.Fatalf("error for input %s: %s", tc.input, err) + } + + if len(v) != tc.count { + t.Fatalf("input: %s\nexpected len: %d\nactual: %d", + tc.input, tc.count, len(v)) + } + } +} + +func TestConstraintCheck(t *testing.T) { + cases := []struct { + constraint string + version string + check bool + }{ + {">= 1.0, < 1.2", "1.1.5", true}, + {"< 1.0, < 1.2", "1.1.5", false}, + {"= 1.0", "1.1.5", false}, + {"= 1.0", "1.0.0", true}, + {"1.0", "1.0.0", true}, + {"~> 1.0", "2.0", false}, + {"~> 1.0", "1.1", true}, + {"~> 1.0", "1.2.3", true}, + {"~> 1.0.0", "1.2.3", false}, + {"~> 1.0.0", "1.0.7", true}, + {"~> 1.0.0", "1.1.0", false}, + {"~> 1.0.7", "1.0.4", false}, + {"~> 1.0.7", "1.0.7", true}, + {"~> 1.0.7", "1.0.8", true}, + {"~> 1.0.7", "1.0.7.5", true}, + {"~> 1.0.7", "1.0.6.99", false}, + {"~> 1.0.7", "1.0.8.0", true}, + {"~> 1.0.9.5", "1.0.9.5", true}, + {"~> 1.0.9.5", "1.0.9.4", false}, + {"~> 1.0.9.5", "1.0.9.6", true}, + {"~> 1.0.9.5", "1.0.9.5.0", true}, + {"~> 1.0.9.5", "1.0.9.5.1", true}, + {"~> 2.0", "2.1.0-beta", false}, + {"~> 2.1.0-a", "2.2.0", false}, + {"~> 2.1.0-a", "2.1.0", false}, + {"~> 2.1.0-a", "2.1.0-beta", true}, + {"~> 2.1.0-a", "2.2.0-alpha", false}, + {"> 2.0", "2.1.0-beta", false}, + {">= 2.1.0-a", "2.1.0-beta", true}, + {">= 2.1.0-a", "2.1.1-beta", false}, + {">= 2.0.0", "2.1.0-beta", false}, + {">= 2.1.0-a", "2.1.1", true}, + {">= 2.1.0-a", "2.1.1-beta", false}, + {">= 2.1.0-a", "2.1.0", true}, + {"<= 2.1.0-a", "2.0.0", true}, + } + + for _, tc := range cases { + c, err := NewConstraint(tc.constraint) + if err != nil { + t.Fatalf("err: %s", err) + } + + v, err := NewVersion(tc.version) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := c.Check(v) + expected := tc.check + if actual != expected { + t.Fatalf("Version: %s\nConstraint: %s\nExpected: %#v", + tc.version, tc.constraint, expected) + } + } +} + +func TestConstraintsString(t *testing.T) { + cases := []struct { + constraint string + result string + }{ + {">= 1.0, < 1.2", ""}, + {"~> 1.0.7", ""}, + } + + for _, tc := range cases { + c, err := NewConstraint(tc.constraint) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := c.String() + expected := tc.result + if expected == "" { + expected = tc.constraint + } + + if actual != expected { + t.Fatalf("Constraint: %s\nExpected: %#v\nActual: %s", + tc.constraint, expected, actual) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/go.mod b/test/integration/licenses/github.com/hashicorp/go-version/go.mod new file mode 100644 index 0000000000..f5285555fa --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/go.mod @@ -0,0 +1 @@ +module github.com/hashicorp/go-version diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version.go b/test/integration/licenses/github.com/hashicorp/go-version/version.go new file mode 100644 index 0000000000..09703e8e6f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/version.go @@ -0,0 +1,384 @@ +package version + +import ( + "bytes" + "fmt" + "reflect" + "regexp" + "strconv" + "strings" +) + +// The compiled regular expression used to test the validity of a version. +var ( + versionRegexp *regexp.Regexp + semverRegexp *regexp.Regexp +) + +// The raw regular expression string used for testing the validity +// of a version. +const ( + VersionRegexpRaw string = `v?([0-9]+(\.[0-9]+)*?)` + + `(-([0-9]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)|(-?([A-Za-z\-~]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)))?` + + `(\+([0-9A-Za-z\-~]+(\.[0-9A-Za-z\-~]+)*))?` + + `?` + + // SemverRegexpRaw requires a separator between version and prerelease + SemverRegexpRaw string = `v?([0-9]+(\.[0-9]+)*?)` + + `(-([0-9]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)|(-([A-Za-z\-~]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)))?` + + `(\+([0-9A-Za-z\-~]+(\.[0-9A-Za-z\-~]+)*))?` + + `?` +) + +// Version represents a single version. +type Version struct { + metadata string + pre string + segments []int64 + si int + original string +} + +func init() { + versionRegexp = regexp.MustCompile("^" + VersionRegexpRaw + "$") + semverRegexp = regexp.MustCompile("^" + SemverRegexpRaw + "$") +} + +// NewVersion parses the given version and returns a new +// Version. +func NewVersion(v string) (*Version, error) { + return newVersion(v, versionRegexp) +} + +// NewSemver parses the given version and returns a new +// Version that adheres strictly to SemVer specs +// https://semver.org/ +func NewSemver(v string) (*Version, error) { + return newVersion(v, semverRegexp) +} + +func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { + matches := pattern.FindStringSubmatch(v) + if matches == nil { + return nil, fmt.Errorf("Malformed version: %s", v) + } + segmentsStr := strings.Split(matches[1], ".") + segments := make([]int64, len(segmentsStr)) + si := 0 + for i, str := range segmentsStr { + val, err := strconv.ParseInt(str, 10, 64) + if err != nil { + return nil, fmt.Errorf( + "Error parsing version: %s", err) + } + + segments[i] = int64(val) + si++ + } + + // Even though we could support more than three segments, if we + // got less than three, pad it with 0s. This is to cover the basic + // default usecase of semver, which is MAJOR.MINOR.PATCH at the minimum + for i := len(segments); i < 3; i++ { + segments = append(segments, 0) + } + + pre := matches[7] + if pre == "" { + pre = matches[4] + } + + return &Version{ + metadata: matches[10], + pre: pre, + segments: segments, + si: si, + original: v, + }, nil +} + +// Must is a helper that wraps a call to a function returning (*Version, error) +// and panics if error is non-nil. +func Must(v *Version, err error) *Version { + if err != nil { + panic(err) + } + + return v +} + +// Compare compares this version to another version. This +// returns -1, 0, or 1 if this version is smaller, equal, +// or larger than the other version, respectively. +// +// If you want boolean results, use the LessThan, Equal, +// GreaterThan, GreaterThanOrEqual or LessThanOrEqual methods. +func (v *Version) Compare(other *Version) int { + // A quick, efficient equality check + if v.String() == other.String() { + return 0 + } + + segmentsSelf := v.Segments64() + segmentsOther := other.Segments64() + + // If the segments are the same, we must compare on prerelease info + if reflect.DeepEqual(segmentsSelf, segmentsOther) { + preSelf := v.Prerelease() + preOther := other.Prerelease() + if preSelf == "" && preOther == "" { + return 0 + } + if preSelf == "" { + return 1 + } + if preOther == "" { + return -1 + } + + return comparePrereleases(preSelf, preOther) + } + + // Get the highest specificity (hS), or if they're equal, just use segmentSelf length + lenSelf := len(segmentsSelf) + lenOther := len(segmentsOther) + hS := lenSelf + if lenSelf < lenOther { + hS = lenOther + } + // Compare the segments + // Because a constraint could have more/less specificity than the version it's + // checking, we need to account for a lopsided or jagged comparison + for i := 0; i < hS; i++ { + if i > lenSelf-1 { + // This means Self had the lower specificity + // Check to see if the remaining segments in Other are all zeros + if !allZero(segmentsOther[i:]) { + // if not, it means that Other has to be greater than Self + return -1 + } + break + } else if i > lenOther-1 { + // this means Other had the lower specificity + // Check to see if the remaining segments in Self are all zeros - + if !allZero(segmentsSelf[i:]) { + //if not, it means that Self has to be greater than Other + return 1 + } + break + } + lhs := segmentsSelf[i] + rhs := segmentsOther[i] + if lhs == rhs { + continue + } else if lhs < rhs { + return -1 + } + // Otherwis, rhs was > lhs, they're not equal + return 1 + } + + // if we got this far, they're equal + return 0 +} + +func allZero(segs []int64) bool { + for _, s := range segs { + if s != 0 { + return false + } + } + return true +} + +func comparePart(preSelf string, preOther string) int { + if preSelf == preOther { + return 0 + } + + var selfInt int64 + selfNumeric := true + selfInt, err := strconv.ParseInt(preSelf, 10, 64) + if err != nil { + selfNumeric = false + } + + var otherInt int64 + otherNumeric := true + otherInt, err = strconv.ParseInt(preOther, 10, 64) + if err != nil { + otherNumeric = false + } + + // if a part is empty, we use the other to decide + if preSelf == "" { + if otherNumeric { + return -1 + } + return 1 + } + + if preOther == "" { + if selfNumeric { + return 1 + } + return -1 + } + + if selfNumeric && !otherNumeric { + return -1 + } else if !selfNumeric && otherNumeric { + return 1 + } else if !selfNumeric && !otherNumeric && preSelf > preOther { + return 1 + } else if selfInt > otherInt { + return 1 + } + + return -1 +} + +func comparePrereleases(v string, other string) int { + // the same pre release! + if v == other { + return 0 + } + + // split both pre releases for analyse their parts + selfPreReleaseMeta := strings.Split(v, ".") + otherPreReleaseMeta := strings.Split(other, ".") + + selfPreReleaseLen := len(selfPreReleaseMeta) + otherPreReleaseLen := len(otherPreReleaseMeta) + + biggestLen := otherPreReleaseLen + if selfPreReleaseLen > otherPreReleaseLen { + biggestLen = selfPreReleaseLen + } + + // loop for parts to find the first difference + for i := 0; i < biggestLen; i = i + 1 { + partSelfPre := "" + if i < selfPreReleaseLen { + partSelfPre = selfPreReleaseMeta[i] + } + + partOtherPre := "" + if i < otherPreReleaseLen { + partOtherPre = otherPreReleaseMeta[i] + } + + compare := comparePart(partSelfPre, partOtherPre) + // if parts are equals, continue the loop + if compare != 0 { + return compare + } + } + + return 0 +} + +// Equal tests if two versions are equal. +func (v *Version) Equal(o *Version) bool { + if v == nil || o == nil { + return v == o + } + + return v.Compare(o) == 0 +} + +// GreaterThan tests if this version is greater than another version. +func (v *Version) GreaterThan(o *Version) bool { + return v.Compare(o) > 0 +} + +// GreaterThanOrEqual tests if this version is greater than or equal to another version. +func (v *Version) GreaterThanOrEqual(o *Version) bool { + return v.Compare(o) >= 0 +} + +// LessThan tests if this version is less than another version. +func (v *Version) LessThan(o *Version) bool { + return v.Compare(o) < 0 +} + +// LessThanOrEqual tests if this version is less than or equal to another version. +func (v *Version) LessThanOrEqual(o *Version) bool { + return v.Compare(o) <= 0 +} + +// Metadata returns any metadata that was part of the version +// string. +// +// Metadata is anything that comes after the "+" in the version. +// For example, with "1.2.3+beta", the metadata is "beta". +func (v *Version) Metadata() string { + return v.metadata +} + +// Prerelease returns any prerelease data that is part of the version, +// or blank if there is no prerelease data. +// +// Prerelease information is anything that comes after the "-" in the +// version (but before any metadata). For example, with "1.2.3-beta", +// the prerelease information is "beta". +func (v *Version) Prerelease() string { + return v.pre +} + +// Segments returns the numeric segments of the version as a slice of ints. +// +// This excludes any metadata or pre-release information. For example, +// for a version "1.2.3-beta", segments will return a slice of +// 1, 2, 3. +func (v *Version) Segments() []int { + segmentSlice := make([]int, len(v.segments)) + for i, v := range v.segments { + segmentSlice[i] = int(v) + } + return segmentSlice +} + +// Segments64 returns the numeric segments of the version as a slice of int64s. +// +// This excludes any metadata or pre-release information. For example, +// for a version "1.2.3-beta", segments will return a slice of +// 1, 2, 3. +func (v *Version) Segments64() []int64 { + result := make([]int64, len(v.segments)) + copy(result, v.segments) + return result +} + +// String returns the full version string included pre-release +// and metadata information. +// +// This value is rebuilt according to the parsed segments and other +// information. Therefore, ambiguities in the version string such as +// prefixed zeroes (1.04.0 => 1.4.0), `v` prefix (v1.0.0 => 1.0.0), and +// missing parts (1.0 => 1.0.0) will be made into a canonicalized form +// as shown in the parenthesized examples. +func (v *Version) String() string { + var buf bytes.Buffer + fmtParts := make([]string, len(v.segments)) + for i, s := range v.segments { + // We can ignore err here since we've pre-parsed the values in segments + str := strconv.FormatInt(s, 10) + fmtParts[i] = str + } + fmt.Fprintf(&buf, strings.Join(fmtParts, ".")) + if v.pre != "" { + fmt.Fprintf(&buf, "-%s", v.pre) + } + if v.metadata != "" { + fmt.Fprintf(&buf, "+%s", v.metadata) + } + + return buf.String() +} + +// Original returns the original parsed version as-is, including any +// potential whitespace, `v` prefix, etc. +func (v *Version) Original() string { + return v.original +} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version_collection.go b/test/integration/licenses/github.com/hashicorp/go-version/version_collection.go new file mode 100644 index 0000000000..cc888d43e6 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/version_collection.go @@ -0,0 +1,17 @@ +package version + +// Collection is a type that implements the sort.Interface interface +// so that versions can be sorted. +type Collection []*Version + +func (v Collection) Len() int { + return len(v) +} + +func (v Collection) Less(i, j int) bool { + return v[i].LessThan(v[j]) +} + +func (v Collection) Swap(i, j int) { + v[i], v[j] = v[j], v[i] +} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go b/test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go new file mode 100644 index 0000000000..14783d7e74 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go @@ -0,0 +1,46 @@ +package version + +import ( + "reflect" + "sort" + "testing" +) + +func TestCollection(t *testing.T) { + versionsRaw := []string{ + "1.1.1", + "1.0", + "1.2", + "2", + "0.7.1", + } + + versions := make([]*Version, len(versionsRaw)) + for i, raw := range versionsRaw { + v, err := NewVersion(raw) + if err != nil { + t.Fatalf("err: %s", err) + } + + versions[i] = v + } + + sort.Sort(Collection(versions)) + + actual := make([]string, len(versions)) + for i, v := range versions { + actual[i] = v.String() + } + + expected := []string{ + "0.7.1", + "1.0.0", + "1.1.1", + "1.2.0", + "2.0.0", + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("bad: %#v", actual) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version_test.go b/test/integration/licenses/github.com/hashicorp/go-version/version_test.go new file mode 100644 index 0000000000..cbbeac81fc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/go-version/version_test.go @@ -0,0 +1,624 @@ +package version + +import ( + "reflect" + "testing" +) + +func TestNewVersion(t *testing.T) { + cases := []struct { + version string + err bool + }{ + {"", true}, + {"1.2.3", false}, + {"1.0", false}, + {"1", false}, + {"1.2.beta", true}, + {"1.21.beta", true}, + {"foo", true}, + {"1.2-5", false}, + {"1.2-beta.5", false}, + {"\n1.2", true}, + {"1.2.0-x.Y.0+metadata", false}, + {"1.2.0-x.Y.0+metadata-width-hypen", false}, + {"1.2.3-rc1-with-hypen", false}, + {"1.2.3.4", false}, + {"1.2.0.4-x.Y.0+metadata", false}, + {"1.2.0.4-x.Y.0+metadata-width-hypen", false}, + {"1.2.0-X-1.2.0+metadata~dist", false}, + {"1.2.3.4-rc1-with-hypen", false}, + {"1.2.3.4", false}, + {"v1.2.3", false}, + {"foo1.2.3", true}, + {"1.7rc2", false}, + {"v1.7rc2", false}, + {"1.0-", false}, + } + + for _, tc := range cases { + _, err := NewVersion(tc.version) + if tc.err && err == nil { + t.Fatalf("expected error for version: %q", tc.version) + } else if !tc.err && err != nil { + t.Fatalf("error for version %q: %s", tc.version, err) + } + } +} + +func TestNewSemver(t *testing.T) { + cases := []struct { + version string + err bool + }{ + {"", true}, + {"1.2.3", false}, + {"1.0", false}, + {"1", false}, + {"1.2.beta", true}, + {"1.21.beta", true}, + {"foo", true}, + {"1.2-5", false}, + {"1.2-beta.5", false}, + {"\n1.2", true}, + {"1.2.0-x.Y.0+metadata", false}, + {"1.2.0-x.Y.0+metadata-width-hypen", false}, + {"1.2.3-rc1-with-hypen", false}, + {"1.2.3.4", false}, + {"1.2.0.4-x.Y.0+metadata", false}, + {"1.2.0.4-x.Y.0+metadata-width-hypen", false}, + {"1.2.0-X-1.2.0+metadata~dist", false}, + {"1.2.3.4-rc1-with-hypen", false}, + {"1.2.3.4", false}, + {"v1.2.3", false}, + {"foo1.2.3", true}, + {"1.7rc2", true}, + {"v1.7rc2", true}, + {"1.0-", true}, + } + + for _, tc := range cases { + _, err := NewSemver(tc.version) + if tc.err && err == nil { + t.Fatalf("expected error for version: %q", tc.version) + } else if !tc.err && err != nil { + t.Fatalf("error for version %q: %s", tc.version, err) + } + } +} + +func TestVersionCompare(t *testing.T) { + cases := []struct { + v1 string + v2 string + expected int + }{ + {"1.2.3", "1.4.5", -1}, + {"1.2-beta", "1.2-beta", 0}, + {"1.2", "1.1.4", 1}, + {"1.2", "1.2-beta", 1}, + {"1.2+foo", "1.2+beta", 0}, + {"v1.2", "v1.2-beta", 1}, + {"v1.2+foo", "v1.2+beta", 0}, + {"v1.2.3.4", "v1.2.3.4", 0}, + {"v1.2.0.0", "v1.2", 0}, + {"v1.2.0.0.1", "v1.2", 1}, + {"v1.2", "v1.2.0.0", 0}, + {"v1.2", "v1.2.0.0.1", -1}, + {"v1.2.0.0", "v1.2.0.0.1", -1}, + {"v1.2.3.0", "v1.2.3.4", -1}, + {"1.7rc2", "1.7rc1", 1}, + {"1.7rc2", "1.7", -1}, + {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", 1}, + } + + for _, tc := range cases { + v1, err := NewVersion(tc.v1) + if err != nil { + t.Fatalf("err: %s", err) + } + + v2, err := NewVersion(tc.v2) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v1.Compare(v2) + expected := tc.expected + if actual != expected { + t.Fatalf( + "%s <=> %s\nexpected: %d\nactual: %d", + tc.v1, tc.v2, + expected, actual) + } + } +} + +func TestVersionCompare_versionAndSemver(t *testing.T) { + cases := []struct { + versionRaw string + semverRaw string + expected int + }{ + {"0.0.2", "0.0.2", 0}, + {"1.0.2alpha", "1.0.2-alpha", 0}, + {"v1.2+foo", "v1.2+beta", 0}, + {"v1.2", "v1.2+meta", 0}, + {"1.2", "1.2-beta", 1}, + {"v1.2", "v1.2-beta", 1}, + {"1.2.3", "1.4.5", -1}, + {"v1.2", "v1.2.0.0.1", -1}, + {"v1.0.3-", "v1.0.3", -1}, + } + + for _, tc := range cases { + ver, err := NewVersion(tc.versionRaw) + if err != nil { + t.Fatalf("err: %s", err) + } + + semver, err := NewSemver(tc.semverRaw) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := ver.Compare(semver) + if actual != tc.expected { + t.Fatalf( + "%s <=> %s\nexpected: %d\n actual: %d", + tc.versionRaw, tc.semverRaw, tc.expected, actual, + ) + } + } +} + +func TestVersionEqual_nil(t *testing.T) { + mustVersion := func(v string) *Version { + ver, err := NewVersion(v) + if err != nil { + t.Fatal(err) + } + return ver + } + cases := []struct { + leftVersion *Version + rightVersion *Version + expected bool + }{ + {mustVersion("1.0.0"), nil, false}, + {nil, mustVersion("1.0.0"), false}, + {nil, nil, true}, + } + + for _, tc := range cases { + given := tc.leftVersion.Equal(tc.rightVersion) + if given != tc.expected { + t.Fatalf("expected Equal to nil to be %t", tc.expected) + } + } +} + +func TestComparePreReleases(t *testing.T) { + cases := []struct { + v1 string + v2 string + expected int + }{ + {"1.2-beta.2", "1.2-beta.2", 0}, + {"1.2-beta.1", "1.2-beta.2", -1}, + {"1.2-beta.2", "1.2-beta.11", -1}, + {"3.2-alpha.1", "3.2-alpha", 1}, + {"1.2-beta.2", "1.2-beta.1", 1}, + {"1.2-beta.11", "1.2-beta.2", 1}, + {"1.2-beta", "1.2-beta.3", -1}, + {"1.2-alpha", "1.2-beta.3", -1}, + {"1.2-beta", "1.2-alpha.3", 1}, + {"3.0-alpha.3", "3.0-rc.1", -1}, + {"3.0-alpha3", "3.0-rc1", -1}, + {"3.0-alpha.1", "3.0-alpha.beta", -1}, + {"5.4-alpha", "5.4-alpha.beta", 1}, + {"v1.2-beta.2", "v1.2-beta.2", 0}, + {"v1.2-beta.1", "v1.2-beta.2", -1}, + {"v3.2-alpha.1", "v3.2-alpha", 1}, + {"v3.2-rc.1-1-g123", "v3.2-rc.2", 1}, + } + + for _, tc := range cases { + v1, err := NewVersion(tc.v1) + if err != nil { + t.Fatalf("err: %s", err) + } + + v2, err := NewVersion(tc.v2) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v1.Compare(v2) + expected := tc.expected + if actual != expected { + t.Fatalf( + "%s <=> %s\nexpected: %d\nactual: %d", + tc.v1, tc.v2, + expected, actual) + } + } +} + +func TestVersionMetadata(t *testing.T) { + cases := []struct { + version string + expected string + }{ + {"1.2.3", ""}, + {"1.2-beta", ""}, + {"1.2.0-x.Y.0", ""}, + {"1.2.0-x.Y.0+metadata", "metadata"}, + {"1.2.0-metadata-1.2.0+metadata~dist", "metadata~dist"}, + } + + for _, tc := range cases { + v, err := NewVersion(tc.version) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v.Metadata() + expected := tc.expected + if actual != expected { + t.Fatalf("expected: %s\nactual: %s", expected, actual) + } + } +} + +func TestVersionPrerelease(t *testing.T) { + cases := []struct { + version string + expected string + }{ + {"1.2.3", ""}, + {"1.2-beta", "beta"}, + {"1.2.0-x.Y.0", "x.Y.0"}, + {"1.2.0-7.Y.0", "7.Y.0"}, + {"1.2.0-x.Y.0+metadata", "x.Y.0"}, + {"1.2.0-metadata-1.2.0+metadata~dist", "metadata-1.2.0"}, + {"17.03.0-ce", "ce"}, // zero-padded fields + } + + for _, tc := range cases { + v, err := NewVersion(tc.version) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v.Prerelease() + expected := tc.expected + if actual != expected { + t.Fatalf("expected: %s\nactual: %s", expected, actual) + } + } +} + +func TestVersionSegments(t *testing.T) { + cases := []struct { + version string + expected []int + }{ + {"1.2.3", []int{1, 2, 3}}, + {"1.2-beta", []int{1, 2, 0}}, + {"1-x.Y.0", []int{1, 0, 0}}, + {"1.2.0-x.Y.0+metadata", []int{1, 2, 0}}, + {"1.2.0-metadata-1.2.0+metadata~dist", []int{1, 2, 0}}, + {"17.03.0-ce", []int{17, 3, 0}}, // zero-padded fields + } + + for _, tc := range cases { + v, err := NewVersion(tc.version) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v.Segments() + expected := tc.expected + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("expected: %#v\nactual: %#v", expected, actual) + } + } +} + +func TestVersionSegments64(t *testing.T) { + cases := []struct { + version string + expected []int64 + }{ + {"1.2.3", []int64{1, 2, 3}}, + {"1.2-beta", []int64{1, 2, 0}}, + {"1-x.Y.0", []int64{1, 0, 0}}, + {"1.2.0-x.Y.0+metadata", []int64{1, 2, 0}}, + {"1.4.9223372036854775807", []int64{1, 4, 9223372036854775807}}, + } + + for _, tc := range cases { + v, err := NewVersion(tc.version) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v.Segments64() + expected := tc.expected + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("expected: %#v\nactual: %#v", expected, actual) + } + + { + expected := actual[0] + actual[0]++ + actual = v.Segments64() + if actual[0] != expected { + t.Fatalf("Segments64 is mutable") + } + } + } +} + +func TestVersionString(t *testing.T) { + cases := [][]string{ + {"1.2.3", "1.2.3"}, + {"1.2-beta", "1.2.0-beta"}, + {"1.2.0-x.Y.0", "1.2.0-x.Y.0"}, + {"1.2.0-x.Y.0+metadata", "1.2.0-x.Y.0+metadata"}, + {"1.2.0-metadata-1.2.0+metadata~dist", "1.2.0-metadata-1.2.0+metadata~dist"}, + {"17.03.0-ce", "17.3.0-ce"}, // zero-padded fields + } + + for _, tc := range cases { + v, err := NewVersion(tc[0]) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v.String() + expected := tc[1] + if actual != expected { + t.Fatalf("expected: %s\nactual: %s", expected, actual) + } + if actual := v.Original(); actual != tc[0] { + t.Fatalf("expected original: %q\nactual: %q", tc[0], actual) + } + } +} + +func TestEqual(t *testing.T) { + cases := []struct { + v1 string + v2 string + expected bool + }{ + {"1.2.3", "1.4.5", false}, + {"1.2-beta", "1.2-beta", true}, + {"1.2", "1.1.4", false}, + {"1.2", "1.2-beta", false}, + {"1.2+foo", "1.2+beta", true}, + {"v1.2", "v1.2-beta", false}, + {"v1.2+foo", "v1.2+beta", true}, + {"v1.2.3.4", "v1.2.3.4", true}, + {"v1.2.0.0", "v1.2", true}, + {"v1.2.0.0.1", "v1.2", false}, + {"v1.2", "v1.2.0.0", true}, + {"v1.2", "v1.2.0.0.1", false}, + {"v1.2.0.0", "v1.2.0.0.1", false}, + {"v1.2.3.0", "v1.2.3.4", false}, + {"1.7rc2", "1.7rc1", false}, + {"1.7rc2", "1.7", false}, + {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", false}, + } + + for _, tc := range cases { + v1, err := NewVersion(tc.v1) + if err != nil { + t.Fatalf("err: %s", err) + } + + v2, err := NewVersion(tc.v2) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v1.Equal(v2) + expected := tc.expected + if actual != expected { + t.Fatalf( + "%s <=> %s\nexpected: %t\nactual: %t", + tc.v1, tc.v2, + expected, actual) + } + } +} + +func TestGreaterThan(t *testing.T) { + cases := []struct { + v1 string + v2 string + expected bool + }{ + {"1.2.3", "1.4.5", false}, + {"1.2-beta", "1.2-beta", false}, + {"1.2", "1.1.4", true}, + {"1.2", "1.2-beta", true}, + {"1.2+foo", "1.2+beta", false}, + {"v1.2", "v1.2-beta", true}, + {"v1.2+foo", "v1.2+beta", false}, + {"v1.2.3.4", "v1.2.3.4", false}, + {"v1.2.0.0", "v1.2", false}, + {"v1.2.0.0.1", "v1.2", true}, + {"v1.2", "v1.2.0.0", false}, + {"v1.2", "v1.2.0.0.1", false}, + {"v1.2.0.0", "v1.2.0.0.1", false}, + {"v1.2.3.0", "v1.2.3.4", false}, + {"1.7rc2", "1.7rc1", true}, + {"1.7rc2", "1.7", false}, + {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", true}, + } + + for _, tc := range cases { + v1, err := NewVersion(tc.v1) + if err != nil { + t.Fatalf("err: %s", err) + } + + v2, err := NewVersion(tc.v2) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v1.GreaterThan(v2) + expected := tc.expected + if actual != expected { + t.Fatalf( + "%s > %s\nexpected: %t\nactual: %t", + tc.v1, tc.v2, + expected, actual) + } + } +} + +func TestLessThan(t *testing.T) { + cases := []struct { + v1 string + v2 string + expected bool + }{ + {"1.2.3", "1.4.5", true}, + {"1.2-beta", "1.2-beta", false}, + {"1.2", "1.1.4", false}, + {"1.2", "1.2-beta", false}, + {"1.2+foo", "1.2+beta", false}, + {"v1.2", "v1.2-beta", false}, + {"v1.2+foo", "v1.2+beta", false}, + {"v1.2.3.4", "v1.2.3.4", false}, + {"v1.2.0.0", "v1.2", false}, + {"v1.2.0.0.1", "v1.2", false}, + {"v1.2", "v1.2.0.0", false}, + {"v1.2", "v1.2.0.0.1", true}, + {"v1.2.0.0", "v1.2.0.0.1", true}, + {"v1.2.3.0", "v1.2.3.4", true}, + {"1.7rc2", "1.7rc1", false}, + {"1.7rc2", "1.7", true}, + {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", false}, + } + + for _, tc := range cases { + v1, err := NewVersion(tc.v1) + if err != nil { + t.Fatalf("err: %s", err) + } + + v2, err := NewVersion(tc.v2) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v1.LessThan(v2) + expected := tc.expected + if actual != expected { + t.Fatalf( + "%s < %s\nexpected: %t\nactual: %t", + tc.v1, tc.v2, + expected, actual) + } + } +} + +func TestGreaterThanOrEqual(t *testing.T) { + cases := []struct { + v1 string + v2 string + expected bool + }{ + {"1.2.3", "1.4.5", false}, + {"1.2-beta", "1.2-beta", true}, + {"1.2", "1.1.4", true}, + {"1.2", "1.2-beta", true}, + {"1.2+foo", "1.2+beta", true}, + {"v1.2", "v1.2-beta", true}, + {"v1.2+foo", "v1.2+beta", true}, + {"v1.2.3.4", "v1.2.3.4", true}, + {"v1.2.0.0", "v1.2", true}, + {"v1.2.0.0.1", "v1.2", true}, + {"v1.2", "v1.2.0.0", true}, + {"v1.2", "v1.2.0.0.1", false}, + {"v1.2.0.0", "v1.2.0.0.1", false}, + {"v1.2.3.0", "v1.2.3.4", false}, + {"1.7rc2", "1.7rc1", true}, + {"1.7rc2", "1.7", false}, + {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", true}, + } + + for _, tc := range cases { + v1, err := NewVersion(tc.v1) + if err != nil { + t.Fatalf("err: %s", err) + } + + v2, err := NewVersion(tc.v2) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v1.GreaterThanOrEqual(v2) + expected := tc.expected + if actual != expected { + t.Fatalf( + "%s >= %s\nexpected: %t\nactual: %t", + tc.v1, tc.v2, + expected, actual) + } + } +} + +func TestLessThanOrEqual(t *testing.T) { + cases := []struct { + v1 string + v2 string + expected bool + }{ + {"1.2.3", "1.4.5", true}, + {"1.2-beta", "1.2-beta", true}, + {"1.2", "1.1.4", false}, + {"1.2", "1.2-beta", false}, + {"1.2+foo", "1.2+beta", true}, + {"v1.2", "v1.2-beta", false}, + {"v1.2+foo", "v1.2+beta", true}, + {"v1.2.3.4", "v1.2.3.4", true}, + {"v1.2.0.0", "v1.2", true}, + {"v1.2.0.0.1", "v1.2", false}, + {"v1.2", "v1.2.0.0", true}, + {"v1.2", "v1.2.0.0.1", true}, + {"v1.2.0.0", "v1.2.0.0.1", true}, + {"v1.2.3.0", "v1.2.3.4", true}, + {"1.7rc2", "1.7rc1", false}, + {"1.7rc2", "1.7", true}, + {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", false}, + } + + for _, tc := range cases { + v1, err := NewVersion(tc.v1) + if err != nil { + t.Fatalf("err: %s", err) + } + + v2, err := NewVersion(tc.v2) + if err != nil { + t.Fatalf("err: %s", err) + } + + actual := v1.LessThanOrEqual(v2) + expected := tc.expected + if actual != expected { + t.Fatalf( + "%s <= %s\nexpected: %t\nactual: %t", + tc.v1, tc.v2, + expected, actual) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md b/test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..2d7fc4bf6f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,21 @@ +### HCL Template +```hcl +# Place your HCL configuration file here +``` + +### Expected behavior +What should have happened? + +### Actual behavior +What actually happened? + +### Steps to reproduce +1. +2. +3. + +### References +Are there any other GitHub issues (open or closed) that should +be linked here? For example: +- GH-1234 +- ... diff --git a/test/integration/licenses/github.com/hashicorp/hcl/.gitignore b/test/integration/licenses/github.com/hashicorp/hcl/.gitignore new file mode 100644 index 0000000000..15586a2b54 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/.gitignore @@ -0,0 +1,9 @@ +y.output + +# ignore intellij files +.idea +*.iml +*.ipr +*.iws + +*.test diff --git a/test/integration/licenses/github.com/hashicorp/hcl/.travis.yml b/test/integration/licenses/github.com/hashicorp/hcl/.travis.yml new file mode 100644 index 0000000000..cb63a32161 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/.travis.yml @@ -0,0 +1,13 @@ +sudo: false + +language: go + +go: + - 1.x + - tip + +branches: + only: + - master + +script: make test diff --git a/test/integration/licenses/github.com/hashicorp/hcl/LICENSE b/test/integration/licenses/github.com/hashicorp/hcl/LICENSE new file mode 100644 index 0000000000..c33dcc7c92 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/LICENSE @@ -0,0 +1,354 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. “Contributor” + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. “Contributor Version” + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + + means Covered Software of a particular Contributor. + +1.4. “Covered Software” + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. “Incompatible With Secondary Licenses” + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version + 1.1 or earlier of the License, but not also under the terms of a + Secondary License. + +1.6. “Executable Form” + + means any form of the work other than Source Code Form. + +1.7. “Larger Work” + + means a work that combines Covered Software with other material, in a separate + file or files, that is not Covered Software. + +1.8. “License” + + means this document. + +1.9. “Licensable” + + means having the right to grant, to the maximum extent possible, whether at the + time of the initial grant or subsequently, any and all of the rights conveyed by + this License. + +1.10. “Modifications” + + means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion + from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + + means any patent claim(s), including without limitation, method, process, + and apparatus claims, in any patent Licensable by such Contributor that + would be infringed, but for the grant of the License, by the making, + using, selling, offering for sale, having made, import, or transfer of + either its Contributions or its Contributor Version. + +1.12. “Secondary License” + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + + means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + + means an individual or a legal entity exercising rights under this + License. For legal entities, “You” includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, “control” means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or as + part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its Contributions + or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution become + effective for each Contribution on the date the Contributor first distributes + such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under this + License. No additional rights or licenses will be implied from the distribution + or licensing of Covered Software under this License. Notwithstanding Section + 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its + Contributions. + + This License does not grant any rights in the trademarks, service marks, or + logos of any Contributor (except as may be necessary to comply with the + notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this License + (see Section 10.2) or under the terms of a Secondary License (if permitted + under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its Contributions + are its original creation(s) or it has sufficient rights to grant the + rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under applicable + copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under the + terms of this License. You must inform recipients that the Source Code Form + of the Covered Software is governed by the terms of this License, and how + they can obtain a copy of this License. You may not attempt to alter or + restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, + or sublicense it under different terms, provided that the license for + the Executable Form does not attempt to limit or alter the recipients’ + rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for the + Covered Software. If the Larger Work is a combination of Covered Software + with a work governed by one or more Secondary Licenses, and the Covered + Software is not Incompatible With Secondary Licenses, this License permits + You to additionally distribute such Covered Software under the terms of + such Secondary License(s), so that the recipient of the Larger Work may, at + their option, further distribute the Covered Software under the terms of + either this License or such Secondary License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices (including + copyright notices, patent notices, disclaimers of warranty, or limitations + of liability) contained within the Source Code Form of the Covered + Software, except that You may alter any license notices to the extent + required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on behalf + of any Contributor. You must make it absolutely clear that any such + warranty, support, indemnity, or liability obligation is offered by You + alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, judicial + order, or regulation then You must: (a) comply with the terms of this License + to the maximum extent possible; and (b) describe the limitations and the code + they affect. Such description must be placed in a text file included with all + distributions of the Covered Software under this License. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing basis, + if such Contributor fails to notify You of the non-compliance by some + reasonable means prior to 60 days after You have come back into compliance. + Moreover, Your grants from a particular Contributor are reinstated on an + ongoing basis if such Contributor notifies You of the non-compliance by + some reasonable means, this is the first time You have received notice of + non-compliance with this License from such Contributor, and You become + compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, counter-claims, + and cross-claims) alleging that a Contributor Version directly or + indirectly infringes any patent, then the rights granted to You by any and + all Contributors for the Covered Software under Section 2.1 of this License + shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without + warranty of any kind, either expressed, implied, or statutory, including, + without limitation, warranties that the Covered Software is free of defects, + merchantable, fit for a particular purpose or non-infringing. The entire + risk as to the quality and performance of the Covered Software is with You. + Should any Covered Software prove defective in any respect, You (not any + Contributor) assume the cost of any necessary servicing, repair, or + correction. This disclaimer of warranty constitutes an essential part of this + License. No use of any Covered Software is authorized under this License + except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from such + party’s negligence to the extent applicable law prohibits such limitation. + Some jurisdictions do not allow the exclusion or limitation of incidental or + consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts of + a jurisdiction where the defendant maintains its principal place of business + and such litigation shall be governed by laws of that jurisdiction, without + reference to its conflict-of-law provisions. Nothing in this Section shall + prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject matter + hereof. If any provision of this License is held to be unenforceable, such + provision shall be reformed only to the extent necessary to make it + enforceable. Any law or regulation which provides that the language of a + contract shall be construed against the drafter shall not be used to construe + this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version of + the License under which You originally received the Covered Software, or + under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a modified + version of this License if you rename the license and remove any + references to the name of the license steward (except to note that such + modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + If You choose to distribute Source Code Form that is Incompatible With + Secondary Licenses under the terms of this version of the License, the + notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then +You may include the notice in a location (such as a LICENSE file in a relevant +directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible + With Secondary Licenses”, as defined by + the Mozilla Public License, v. 2.0. + diff --git a/test/integration/licenses/github.com/hashicorp/hcl/Makefile b/test/integration/licenses/github.com/hashicorp/hcl/Makefile new file mode 100644 index 0000000000..84fd743f5c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/Makefile @@ -0,0 +1,18 @@ +TEST?=./... + +default: test + +fmt: generate + go fmt ./... + +test: generate + go get -t ./... + go test $(TEST) $(TESTARGS) + +generate: + go generate ./... + +updatedeps: + go get -u golang.org/x/tools/cmd/stringer + +.PHONY: default generate test updatedeps diff --git a/test/integration/licenses/github.com/hashicorp/hcl/README.md b/test/integration/licenses/github.com/hashicorp/hcl/README.md new file mode 100644 index 0000000000..c8223326dd --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/README.md @@ -0,0 +1,125 @@ +# HCL + +[![GoDoc](https://godoc.org/github.com/hashicorp/hcl?status.png)](https://godoc.org/github.com/hashicorp/hcl) [![Build Status](https://travis-ci.org/hashicorp/hcl.svg?branch=master)](https://travis-ci.org/hashicorp/hcl) + +HCL (HashiCorp Configuration Language) is a configuration language built +by HashiCorp. The goal of HCL is to build a structured configuration language +that is both human and machine friendly for use with command-line tools, but +specifically targeted towards DevOps tools, servers, etc. + +HCL is also fully JSON compatible. That is, JSON can be used as completely +valid input to a system expecting HCL. This helps makes systems +interoperable with other systems. + +HCL is heavily inspired by +[libucl](https://github.com/vstakhov/libucl), +nginx configuration, and others similar. + +## Why? + +A common question when viewing HCL is to ask the question: why not +JSON, YAML, etc.? + +Prior to HCL, the tools we built at [HashiCorp](http://www.hashicorp.com) +used a variety of configuration languages from full programming languages +such as Ruby to complete data structure languages such as JSON. What we +learned is that some people wanted human-friendly configuration languages +and some people wanted machine-friendly languages. + +JSON fits a nice balance in this, but is fairly verbose and most +importantly doesn't support comments. With YAML, we found that beginners +had a really hard time determining what the actual structure was, and +ended up guessing more often than not whether to use a hyphen, colon, etc. +in order to represent some configuration key. + +Full programming languages such as Ruby enable complex behavior +a configuration language shouldn't usually allow, and also forces +people to learn some set of Ruby. + +Because of this, we decided to create our own configuration language +that is JSON-compatible. Our configuration language (HCL) is designed +to be written and modified by humans. The API for HCL allows JSON +as an input so that it is also machine-friendly (machines can generate +JSON instead of trying to generate HCL). + +Our goal with HCL is not to alienate other configuration languages. +It is instead to provide HCL as a specialized language for our tools, +and JSON as the interoperability layer. + +## Syntax + +For a complete grammar, please see the parser itself. A high-level overview +of the syntax and grammar is listed here. + + * Single line comments start with `#` or `//` + + * Multi-line comments are wrapped in `/*` and `*/`. Nested block comments + are not allowed. A multi-line comment (also known as a block comment) + terminates at the first `*/` found. + + * Values are assigned with the syntax `key = value` (whitespace doesn't + matter). The value can be any primitive: a string, number, boolean, + object, or list. + + * Strings are double-quoted and can contain any UTF-8 characters. + Example: `"Hello, World"` + + * Multi-line strings start with `<- + echo %Path% + + go version + + go env + + go get -t ./... + +build_script: +- cmd: go test -v ./... diff --git a/test/integration/licenses/github.com/hashicorp/hcl/decoder.go b/test/integration/licenses/github.com/hashicorp/hcl/decoder.go new file mode 100644 index 0000000000..bed9ebbe14 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/decoder.go @@ -0,0 +1,729 @@ +package hcl + +import ( + "errors" + "fmt" + "reflect" + "sort" + "strconv" + "strings" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/parser" + "github.com/hashicorp/hcl/hcl/token" +) + +// This is the tag to use with structures to have settings for HCL +const tagName = "hcl" + +var ( + // nodeType holds a reference to the type of ast.Node + nodeType reflect.Type = findNodeType() +) + +// Unmarshal accepts a byte slice as input and writes the +// data to the value pointed to by v. +func Unmarshal(bs []byte, v interface{}) error { + root, err := parse(bs) + if err != nil { + return err + } + + return DecodeObject(v, root) +} + +// Decode reads the given input and decodes it into the structure +// given by `out`. +func Decode(out interface{}, in string) error { + obj, err := Parse(in) + if err != nil { + return err + } + + return DecodeObject(out, obj) +} + +// DecodeObject is a lower-level version of Decode. It decodes a +// raw Object into the given output. +func DecodeObject(out interface{}, n ast.Node) error { + val := reflect.ValueOf(out) + if val.Kind() != reflect.Ptr { + return errors.New("result must be a pointer") + } + + // If we have the file, we really decode the root node + if f, ok := n.(*ast.File); ok { + n = f.Node + } + + var d decoder + return d.decode("root", n, val.Elem()) +} + +type decoder struct { + stack []reflect.Kind +} + +func (d *decoder) decode(name string, node ast.Node, result reflect.Value) error { + k := result + + // If we have an interface with a valid value, we use that + // for the check. + if result.Kind() == reflect.Interface { + elem := result.Elem() + if elem.IsValid() { + k = elem + } + } + + // Push current onto stack unless it is an interface. + if k.Kind() != reflect.Interface { + d.stack = append(d.stack, k.Kind()) + + // Schedule a pop + defer func() { + d.stack = d.stack[:len(d.stack)-1] + }() + } + + switch k.Kind() { + case reflect.Bool: + return d.decodeBool(name, node, result) + case reflect.Float32, reflect.Float64: + return d.decodeFloat(name, node, result) + case reflect.Int, reflect.Int32, reflect.Int64: + return d.decodeInt(name, node, result) + case reflect.Interface: + // When we see an interface, we make our own thing + return d.decodeInterface(name, node, result) + case reflect.Map: + return d.decodeMap(name, node, result) + case reflect.Ptr: + return d.decodePtr(name, node, result) + case reflect.Slice: + return d.decodeSlice(name, node, result) + case reflect.String: + return d.decodeString(name, node, result) + case reflect.Struct: + return d.decodeStruct(name, node, result) + default: + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown kind to decode into: %s", name, k.Kind()), + } + } +} + +func (d *decoder) decodeBool(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + if n.Token.Type == token.BOOL { + v, err := strconv.ParseBool(n.Token.Text) + if err != nil { + return err + } + + result.Set(reflect.ValueOf(v)) + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type %T", name, node), + } +} + +func (d *decoder) decodeFloat(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + if n.Token.Type == token.FLOAT || n.Token.Type == token.NUMBER { + v, err := strconv.ParseFloat(n.Token.Text, 64) + if err != nil { + return err + } + + result.Set(reflect.ValueOf(v).Convert(result.Type())) + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type %T", name, node), + } +} + +func (d *decoder) decodeInt(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + switch n.Token.Type { + case token.NUMBER: + v, err := strconv.ParseInt(n.Token.Text, 0, 0) + if err != nil { + return err + } + + if result.Kind() == reflect.Interface { + result.Set(reflect.ValueOf(int(v))) + } else { + result.SetInt(v) + } + return nil + case token.STRING: + v, err := strconv.ParseInt(n.Token.Value().(string), 0, 0) + if err != nil { + return err + } + + if result.Kind() == reflect.Interface { + result.Set(reflect.ValueOf(int(v))) + } else { + result.SetInt(v) + } + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type %T", name, node), + } +} + +func (d *decoder) decodeInterface(name string, node ast.Node, result reflect.Value) error { + // When we see an ast.Node, we retain the value to enable deferred decoding. + // Very useful in situations where we want to preserve ast.Node information + // like Pos + if result.Type() == nodeType && result.CanSet() { + result.Set(reflect.ValueOf(node)) + return nil + } + + var set reflect.Value + redecode := true + + // For testing types, ObjectType should just be treated as a list. We + // set this to a temporary var because we want to pass in the real node. + testNode := node + if ot, ok := node.(*ast.ObjectType); ok { + testNode = ot.List + } + + switch n := testNode.(type) { + case *ast.ObjectList: + // If we're at the root or we're directly within a slice, then we + // decode objects into map[string]interface{}, otherwise we decode + // them into lists. + if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { + var temp map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeMap( + reflect.MapOf( + reflect.TypeOf(""), + tempVal.Type().Elem())) + + set = result + } else { + var temp []map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeSlice( + reflect.SliceOf(tempVal.Type().Elem()), 0, len(n.Items)) + set = result + } + case *ast.ObjectType: + // If we're at the root or we're directly within a slice, then we + // decode objects into map[string]interface{}, otherwise we decode + // them into lists. + if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { + var temp map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeMap( + reflect.MapOf( + reflect.TypeOf(""), + tempVal.Type().Elem())) + + set = result + } else { + var temp []map[string]interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeSlice( + reflect.SliceOf(tempVal.Type().Elem()), 0, 1) + set = result + } + case *ast.ListType: + var temp []interface{} + tempVal := reflect.ValueOf(temp) + result := reflect.MakeSlice( + reflect.SliceOf(tempVal.Type().Elem()), 0, 0) + set = result + case *ast.LiteralType: + switch n.Token.Type { + case token.BOOL: + var result bool + set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) + case token.FLOAT: + var result float64 + set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) + case token.NUMBER: + var result int + set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) + case token.STRING, token.HEREDOC: + set = reflect.Indirect(reflect.New(reflect.TypeOf(""))) + default: + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: cannot decode into interface: %T", name, node), + } + } + default: + return fmt.Errorf( + "%s: cannot decode into interface: %T", + name, node) + } + + // Set the result to what its supposed to be, then reset + // result so we don't reflect into this method anymore. + result.Set(set) + + if redecode { + // Revisit the node so that we can use the newly instantiated + // thing and populate it. + if err := d.decode(name, node, result); err != nil { + return err + } + } + + return nil +} + +func (d *decoder) decodeMap(name string, node ast.Node, result reflect.Value) error { + if item, ok := node.(*ast.ObjectItem); ok { + node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} + } + + if ot, ok := node.(*ast.ObjectType); ok { + node = ot.List + } + + n, ok := node.(*ast.ObjectList) + if !ok { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: not an object type for map (%T)", name, node), + } + } + + // If we have an interface, then we can address the interface, + // but not the slice itself, so get the element but set the interface + set := result + if result.Kind() == reflect.Interface { + result = result.Elem() + } + + resultType := result.Type() + resultElemType := resultType.Elem() + resultKeyType := resultType.Key() + if resultKeyType.Kind() != reflect.String { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: map must have string keys", name), + } + } + + // Make a map if it is nil + resultMap := result + if result.IsNil() { + resultMap = reflect.MakeMap( + reflect.MapOf(resultKeyType, resultElemType)) + } + + // Go through each element and decode it. + done := make(map[string]struct{}) + for _, item := range n.Items { + if item.Val == nil { + continue + } + + // github.com/hashicorp/terraform/issue/5740 + if len(item.Keys) == 0 { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: map must have string keys", name), + } + } + + // Get the key we're dealing with, which is the first item + keyStr := item.Keys[0].Token.Value().(string) + + // If we've already processed this key, then ignore it + if _, ok := done[keyStr]; ok { + continue + } + + // Determine the value. If we have more than one key, then we + // get the objectlist of only these keys. + itemVal := item.Val + if len(item.Keys) > 1 { + itemVal = n.Filter(keyStr) + done[keyStr] = struct{}{} + } + + // Make the field name + fieldName := fmt.Sprintf("%s.%s", name, keyStr) + + // Get the key/value as reflection values + key := reflect.ValueOf(keyStr) + val := reflect.Indirect(reflect.New(resultElemType)) + + // If we have a pre-existing value in the map, use that + oldVal := resultMap.MapIndex(key) + if oldVal.IsValid() { + val.Set(oldVal) + } + + // Decode! + if err := d.decode(fieldName, itemVal, val); err != nil { + return err + } + + // Set the value on the map + resultMap.SetMapIndex(key, val) + } + + // Set the final map if we can + set.Set(resultMap) + return nil +} + +func (d *decoder) decodePtr(name string, node ast.Node, result reflect.Value) error { + // Create an element of the concrete (non pointer) type and decode + // into that. Then set the value of the pointer to this type. + resultType := result.Type() + resultElemType := resultType.Elem() + val := reflect.New(resultElemType) + if err := d.decode(name, node, reflect.Indirect(val)); err != nil { + return err + } + + result.Set(val) + return nil +} + +func (d *decoder) decodeSlice(name string, node ast.Node, result reflect.Value) error { + // If we have an interface, then we can address the interface, + // but not the slice itself, so get the element but set the interface + set := result + if result.Kind() == reflect.Interface { + result = result.Elem() + } + // Create the slice if it isn't nil + resultType := result.Type() + resultElemType := resultType.Elem() + if result.IsNil() { + resultSliceType := reflect.SliceOf(resultElemType) + result = reflect.MakeSlice( + resultSliceType, 0, 0) + } + + // Figure out the items we'll be copying into the slice + var items []ast.Node + switch n := node.(type) { + case *ast.ObjectList: + items = make([]ast.Node, len(n.Items)) + for i, item := range n.Items { + items[i] = item + } + case *ast.ObjectType: + items = []ast.Node{n} + case *ast.ListType: + items = n.List + default: + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("unknown slice type: %T", node), + } + } + + for i, item := range items { + fieldName := fmt.Sprintf("%s[%d]", name, i) + + // Decode + val := reflect.Indirect(reflect.New(resultElemType)) + + // if item is an object that was decoded from ambiguous JSON and + // flattened, make sure it's expanded if it needs to decode into a + // defined structure. + item := expandObject(item, val) + + if err := d.decode(fieldName, item, val); err != nil { + return err + } + + // Append it onto the slice + result = reflect.Append(result, val) + } + + set.Set(result) + return nil +} + +// expandObject detects if an ambiguous JSON object was flattened to a List which +// should be decoded into a struct, and expands the ast to properly deocode. +func expandObject(node ast.Node, result reflect.Value) ast.Node { + item, ok := node.(*ast.ObjectItem) + if !ok { + return node + } + + elemType := result.Type() + + // our target type must be a struct + switch elemType.Kind() { + case reflect.Ptr: + switch elemType.Elem().Kind() { + case reflect.Struct: + //OK + default: + return node + } + case reflect.Struct: + //OK + default: + return node + } + + // A list value will have a key and field name. If it had more fields, + // it wouldn't have been flattened. + if len(item.Keys) != 2 { + return node + } + + keyToken := item.Keys[0].Token + item.Keys = item.Keys[1:] + + // we need to un-flatten the ast enough to decode + newNode := &ast.ObjectItem{ + Keys: []*ast.ObjectKey{ + &ast.ObjectKey{ + Token: keyToken, + }, + }, + Val: &ast.ObjectType{ + List: &ast.ObjectList{ + Items: []*ast.ObjectItem{item}, + }, + }, + } + + return newNode +} + +func (d *decoder) decodeString(name string, node ast.Node, result reflect.Value) error { + switch n := node.(type) { + case *ast.LiteralType: + switch n.Token.Type { + case token.NUMBER: + result.Set(reflect.ValueOf(n.Token.Text).Convert(result.Type())) + return nil + case token.STRING, token.HEREDOC: + result.Set(reflect.ValueOf(n.Token.Value()).Convert(result.Type())) + return nil + } + } + + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unknown type for string %T", name, node), + } +} + +func (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value) error { + var item *ast.ObjectItem + if it, ok := node.(*ast.ObjectItem); ok { + item = it + node = it.Val + } + + if ot, ok := node.(*ast.ObjectType); ok { + node = ot.List + } + + // Handle the special case where the object itself is a literal. Previously + // the yacc parser would always ensure top-level elements were arrays. The new + // parser does not make the same guarantees, thus we need to convert any + // top-level literal elements into a list. + if _, ok := node.(*ast.LiteralType); ok && item != nil { + node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} + } + + list, ok := node.(*ast.ObjectList) + if !ok { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: not an object type for struct (%T)", name, node), + } + } + + // This slice will keep track of all the structs we'll be decoding. + // There can be more than one struct if there are embedded structs + // that are squashed. + structs := make([]reflect.Value, 1, 5) + structs[0] = result + + // Compile the list of all the fields that we're going to be decoding + // from all the structs. + type field struct { + field reflect.StructField + val reflect.Value + } + fields := []field{} + for len(structs) > 0 { + structVal := structs[0] + structs = structs[1:] + + structType := structVal.Type() + for i := 0; i < structType.NumField(); i++ { + fieldType := structType.Field(i) + tagParts := strings.Split(fieldType.Tag.Get(tagName), ",") + + // Ignore fields with tag name "-" + if tagParts[0] == "-" { + continue + } + + if fieldType.Anonymous { + fieldKind := fieldType.Type.Kind() + if fieldKind != reflect.Struct { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: unsupported type to struct: %s", + fieldType.Name, fieldKind), + } + } + + // We have an embedded field. We "squash" the fields down + // if specified in the tag. + squash := false + for _, tag := range tagParts[1:] { + if tag == "squash" { + squash = true + break + } + } + + if squash { + structs = append( + structs, result.FieldByName(fieldType.Name)) + continue + } + } + + // Normal struct field, store it away + fields = append(fields, field{fieldType, structVal.Field(i)}) + } + } + + usedKeys := make(map[string]struct{}) + decodedFields := make([]string, 0, len(fields)) + decodedFieldsVal := make([]reflect.Value, 0) + unusedKeysVal := make([]reflect.Value, 0) + for _, f := range fields { + field, fieldValue := f.field, f.val + if !fieldValue.IsValid() { + // This should never happen + panic("field is not valid") + } + + // If we can't set the field, then it is unexported or something, + // and we just continue onwards. + if !fieldValue.CanSet() { + continue + } + + fieldName := field.Name + + tagValue := field.Tag.Get(tagName) + tagParts := strings.SplitN(tagValue, ",", 2) + if len(tagParts) >= 2 { + switch tagParts[1] { + case "decodedFields": + decodedFieldsVal = append(decodedFieldsVal, fieldValue) + continue + case "key": + if item == nil { + return &parser.PosError{ + Pos: node.Pos(), + Err: fmt.Errorf("%s: %s asked for 'key', impossible", + name, fieldName), + } + } + + fieldValue.SetString(item.Keys[0].Token.Value().(string)) + continue + case "unusedKeys": + unusedKeysVal = append(unusedKeysVal, fieldValue) + continue + } + } + + if tagParts[0] != "" { + fieldName = tagParts[0] + } + + // Determine the element we'll use to decode. If it is a single + // match (only object with the field), then we decode it exactly. + // If it is a prefix match, then we decode the matches. + filter := list.Filter(fieldName) + + prefixMatches := filter.Children() + matches := filter.Elem() + if len(matches.Items) == 0 && len(prefixMatches.Items) == 0 { + continue + } + + // Track the used key + usedKeys[fieldName] = struct{}{} + + // Create the field name and decode. We range over the elements + // because we actually want the value. + fieldName = fmt.Sprintf("%s.%s", name, fieldName) + if len(prefixMatches.Items) > 0 { + if err := d.decode(fieldName, prefixMatches, fieldValue); err != nil { + return err + } + } + for _, match := range matches.Items { + var decodeNode ast.Node = match.Val + if ot, ok := decodeNode.(*ast.ObjectType); ok { + decodeNode = &ast.ObjectList{Items: ot.List.Items} + } + + if err := d.decode(fieldName, decodeNode, fieldValue); err != nil { + return err + } + } + + decodedFields = append(decodedFields, field.Name) + } + + if len(decodedFieldsVal) > 0 { + // Sort it so that it is deterministic + sort.Strings(decodedFields) + + for _, v := range decodedFieldsVal { + v.Set(reflect.ValueOf(decodedFields)) + } + } + + return nil +} + +// findNodeType returns the type of ast.Node +func findNodeType() reflect.Type { + var nodeContainer struct { + Node ast.Node + } + value := reflect.ValueOf(nodeContainer).FieldByName("Node") + return value.Type() +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go b/test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go new file mode 100644 index 0000000000..8682f470ed --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go @@ -0,0 +1,1203 @@ +package hcl + +import ( + "io/ioutil" + "path/filepath" + "reflect" + "testing" + "time" + + "github.com/davecgh/go-spew/spew" + "github.com/hashicorp/hcl/hcl/ast" +) + +func TestDecode_interface(t *testing.T) { + cases := []struct { + File string + Err bool + Out interface{} + }{ + { + "basic.hcl", + false, + map[string]interface{}{ + "foo": "bar", + "bar": "${file(\"bing/bong.txt\")}", + }, + }, + { + "basic_squish.hcl", + false, + map[string]interface{}{ + "foo": "bar", + "bar": "${file(\"bing/bong.txt\")}", + "foo-bar": "baz", + }, + }, + { + "empty.hcl", + false, + map[string]interface{}{ + "resource": []map[string]interface{}{ + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{}, + }, + }, + }, + }, + }, + { + "tfvars.hcl", + false, + map[string]interface{}{ + "regularvar": "Should work", + "map.key1": "Value", + "map.key2": "Other value", + }, + }, + { + "escape.hcl", + false, + map[string]interface{}{ + "foo": "bar\"baz\\n", + "qux": "back\\slash", + "bar": "new\nline", + "qax": `slash\:colon`, + "nested": `${HH\\:mm\\:ss}`, + "nestedquotes": `${"\"stringwrappedinquotes\""}`, + }, + }, + { + "float.hcl", + false, + map[string]interface{}{ + "a": 1.02, + "b": 2, + }, + }, + { + "multiline_bad.hcl", + true, + nil, + }, + { + "multiline_literal.hcl", + true, + nil, + }, + { + "multiline_literal_with_hil.hcl", + false, + map[string]interface{}{"multiline_literal_with_hil": "${hello\n world}"}, + }, + { + "multiline_no_marker.hcl", + true, + nil, + }, + { + "multiline.hcl", + false, + map[string]interface{}{"foo": "bar\nbaz\n"}, + }, + { + "multiline_indented.hcl", + false, + map[string]interface{}{"foo": " bar\n baz\n"}, + }, + { + "multiline_no_hanging_indent.hcl", + false, + map[string]interface{}{"foo": " baz\n bar\n foo\n"}, + }, + { + "multiline_no_eof.hcl", + false, + map[string]interface{}{"foo": "bar\nbaz\n", "key": "value"}, + }, + { + "multiline.json", + false, + map[string]interface{}{"foo": "bar\nbaz"}, + }, + { + "null_strings.json", + false, + map[string]interface{}{ + "module": []map[string]interface{}{ + map[string]interface{}{ + "app": []map[string]interface{}{ + map[string]interface{}{"foo": ""}, + }, + }, + }, + }, + }, + { + "scientific.json", + false, + map[string]interface{}{ + "a": 1e-10, + "b": 1e+10, + "c": 1e10, + "d": 1.2e-10, + "e": 1.2e+10, + "f": 1.2e10, + }, + }, + { + "scientific.hcl", + false, + map[string]interface{}{ + "a": 1e-10, + "b": 1e+10, + "c": 1e10, + "d": 1.2e-10, + "e": 1.2e+10, + "f": 1.2e10, + }, + }, + { + "terraform_heroku.hcl", + false, + map[string]interface{}{ + "name": "terraform-test-app", + "config_vars": []map[string]interface{}{ + map[string]interface{}{ + "FOO": "bar", + }, + }, + }, + }, + { + "structure_multi.hcl", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "baz": []map[string]interface{}{ + map[string]interface{}{"key": 7}, + }, + }, + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{"key": 12}, + }, + }, + }, + }, + }, + { + "structure_multi.json", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "baz": []map[string]interface{}{ + map[string]interface{}{"key": 7}, + }, + }, + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{"key": 12}, + }, + }, + }, + }, + }, + { + "list_of_lists.hcl", + false, + map[string]interface{}{ + "foo": []interface{}{ + []interface{}{"foo"}, + []interface{}{"bar"}, + }, + }, + }, + { + "list_of_maps.hcl", + false, + map[string]interface{}{ + "foo": []interface{}{ + map[string]interface{}{"somekey1": "someval1"}, + map[string]interface{}{"somekey2": "someval2", "someextrakey": "someextraval"}, + }, + }, + }, + { + "assign_deep.hcl", + false, + map[string]interface{}{ + "resource": []interface{}{ + map[string]interface{}{ + "foo": []interface{}{ + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{}}}}}}}, + }, + { + "structure_list.hcl", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "key": 7, + }, + map[string]interface{}{ + "key": 12, + }, + }, + }, + }, + { + "structure_list.json", + false, + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "key": 7, + }, + map[string]interface{}{ + "key": 12, + }, + }, + }, + }, + { + "structure_list_deep.json", + false, + map[string]interface{}{ + "bar": []map[string]interface{}{ + map[string]interface{}{ + "foo": []map[string]interface{}{ + map[string]interface{}{ + "name": "terraform_example", + "ingress": []map[string]interface{}{ + map[string]interface{}{ + "from_port": 22, + }, + map[string]interface{}{ + "from_port": 80, + }, + }, + }, + }, + }, + }, + }, + }, + + { + "structure_list_empty.json", + false, + map[string]interface{}{ + "foo": []interface{}{}, + }, + }, + + { + "nested_block_comment.hcl", + false, + map[string]interface{}{ + "bar": "value", + }, + }, + + { + "unterminated_block_comment.hcl", + true, + nil, + }, + + { + "unterminated_brace.hcl", + true, + nil, + }, + + { + "nested_provider_bad.hcl", + true, + nil, + }, + + { + "object_list.json", + false, + map[string]interface{}{ + "resource": []map[string]interface{}{ + map[string]interface{}{ + "aws_instance": []map[string]interface{}{ + map[string]interface{}{ + "db": []map[string]interface{}{ + map[string]interface{}{ + "vpc": "foo", + "provisioner": []map[string]interface{}{ + map[string]interface{}{ + "file": []map[string]interface{}{ + map[string]interface{}{ + "source": "foo", + "destination": "bar", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + + // Terraform GH-8295 sanity test that basic decoding into + // interface{} works. + { + "terraform_variable_invalid.json", + false, + map[string]interface{}{ + "variable": []map[string]interface{}{ + map[string]interface{}{ + "whatever": "abc123", + }, + }, + }, + }, + + { + "interpolate.json", + false, + map[string]interface{}{ + "default": `${replace("europe-west", "-", " ")}`, + }, + }, + + { + "block_assign.hcl", + true, + nil, + }, + + { + "escape_backslash.hcl", + false, + map[string]interface{}{ + "output": []map[string]interface{}{ + map[string]interface{}{ + "one": `${replace(var.sub_domain, ".", "\\.")}`, + "two": `${replace(var.sub_domain, ".", "\\\\.")}`, + "many": `${replace(var.sub_domain, ".", "\\\\\\\\.")}`, + }, + }, + }, + }, + + { + "git_crypt.hcl", + true, + nil, + }, + + { + "object_with_bool.hcl", + false, + map[string]interface{}{ + "path": []map[string]interface{}{ + map[string]interface{}{ + "policy": "write", + "permissions": []map[string]interface{}{ + map[string]interface{}{ + "bool": []interface{}{false}, + }, + }, + }, + }, + }, + }, + } + + for _, tc := range cases { + t.Run(tc.File, func(t *testing.T) { + d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.File)) + if err != nil { + t.Fatalf("err: %s", err) + } + + var out interface{} + err = Decode(&out, string(d)) + if (err != nil) != tc.Err { + t.Fatalf("Input: %s\n\nError: %s", tc.File, err) + } + + if !reflect.DeepEqual(out, tc.Out) { + t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) + } + + var v interface{} + err = Unmarshal(d, &v) + if (err != nil) != tc.Err { + t.Fatalf("Input: %s\n\nError: %s", tc.File, err) + } + + if !reflect.DeepEqual(v, tc.Out) { + t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) + } + }) + } +} + +func TestDecode_interfaceInline(t *testing.T) { + cases := []struct { + Value string + Err bool + Out interface{} + }{ + {"t t e{{}}", true, nil}, + {"t=0t d {}", true, map[string]interface{}{"t": 0}}, + {"v=0E0v d{}", true, map[string]interface{}{"v": float64(0)}}, + } + + for _, tc := range cases { + t.Logf("Testing: %q", tc.Value) + + var out interface{} + err := Decode(&out, tc.Value) + if (err != nil) != tc.Err { + t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) + } + + if !reflect.DeepEqual(out, tc.Out) { + t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) + } + + var v interface{} + err = Unmarshal([]byte(tc.Value), &v) + if (err != nil) != tc.Err { + t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) + } + + if !reflect.DeepEqual(v, tc.Out) { + t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) + } + } +} + +func TestDecode_equal(t *testing.T) { + cases := []struct { + One, Two string + }{ + { + "basic.hcl", + "basic.json", + }, + { + "float.hcl", + "float.json", + }, + /* + { + "structure.hcl", + "structure.json", + }, + */ + { + "structure.hcl", + "structure_flat.json", + }, + { + "terraform_heroku.hcl", + "terraform_heroku.json", + }, + } + + for _, tc := range cases { + p1 := filepath.Join(fixtureDir, tc.One) + p2 := filepath.Join(fixtureDir, tc.Two) + + d1, err := ioutil.ReadFile(p1) + if err != nil { + t.Fatalf("err: %s", err) + } + + d2, err := ioutil.ReadFile(p2) + if err != nil { + t.Fatalf("err: %s", err) + } + + var i1, i2 interface{} + err = Decode(&i1, string(d1)) + if err != nil { + t.Fatalf("err: %s", err) + } + + err = Decode(&i2, string(d2)) + if err != nil { + t.Fatalf("err: %s", err) + } + + if !reflect.DeepEqual(i1, i2) { + t.Fatalf( + "%s != %s\n\n%#v\n\n%#v", + tc.One, tc.Two, + i1, i2) + } + } +} + +func TestDecode_flatMap(t *testing.T) { + var val map[string]map[string]string + + err := Decode(&val, testReadFile(t, "structure_flatmap.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := map[string]map[string]string{ + "foo": map[string]string{ + "foo": "bar", + "key": "7", + }, + } + + if !reflect.DeepEqual(val, expected) { + t.Fatalf("Actual: %#v\n\nExpected: %#v", val, expected) + } +} + +func TestDecode_structure(t *testing.T) { + type Embedded interface{} + + type V struct { + Embedded `hcl:"-"` + Key int + Foo string + } + + var actual V + + err := Decode(&actual, testReadFile(t, "flat.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := V{ + Key: 7, + Foo: "bar", + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) + } +} + +func TestDecode_structurePtr(t *testing.T) { + type V struct { + Key int + Foo string + } + + var actual *V + + err := Decode(&actual, testReadFile(t, "flat.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + expected := &V{ + Key: 7, + Foo: "bar", + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) + } +} + +func TestDecode_structureArray(t *testing.T) { + // This test is extracted from a failure in Consul (consul.io), + // hence the interesting structure naming. + + type KeyPolicyType string + + type KeyPolicy struct { + Prefix string `hcl:",key"` + Policy KeyPolicyType + } + + type Policy struct { + Keys []KeyPolicy `hcl:"key,expand"` + } + + expected := Policy{ + Keys: []KeyPolicy{ + KeyPolicy{ + Prefix: "", + Policy: "read", + }, + KeyPolicy{ + Prefix: "foo/", + Policy: "write", + }, + KeyPolicy{ + Prefix: "foo/bar/", + Policy: "read", + }, + KeyPolicy{ + Prefix: "foo/bar/baz", + Policy: "deny", + }, + }, + } + + files := []string{ + "decode_policy.hcl", + "decode_policy.json", + } + + for _, f := range files { + var actual Policy + + err := Decode(&actual, testReadFile(t, f)) + if err != nil { + t.Fatalf("Input: %s\n\nerr: %s", f, err) + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) + } + } +} + +func TestDecode_sliceExpand(t *testing.T) { + type testInner struct { + Name string `hcl:",key"` + Key string + } + + type testStruct struct { + Services []testInner `hcl:"service,expand"` + } + + expected := testStruct{ + Services: []testInner{ + testInner{ + Name: "my-service-0", + Key: "value", + }, + testInner{ + Name: "my-service-1", + Key: "value", + }, + }, + } + + files := []string{ + "slice_expand.hcl", + } + + for _, f := range files { + t.Logf("Testing: %s", f) + + var actual testStruct + err := Decode(&actual, testReadFile(t, f)) + if err != nil { + t.Fatalf("Input: %s\n\nerr: %s", f, err) + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) + } + } +} + +func TestDecode_structureMap(t *testing.T) { + // This test is extracted from a failure in Terraform (terraform.io), + // hence the interesting structure naming. + + type hclVariable struct { + Default interface{} + Description string + Fields []string `hcl:",decodedFields"` + } + + type rawConfig struct { + Variable map[string]hclVariable + } + + expected := rawConfig{ + Variable: map[string]hclVariable{ + "foo": hclVariable{ + Default: "bar", + Description: "bar", + Fields: []string{"Default", "Description"}, + }, + + "amis": hclVariable{ + Default: []map[string]interface{}{ + map[string]interface{}{ + "east": "foo", + }, + }, + Fields: []string{"Default"}, + }, + }, + } + + files := []string{ + "decode_tf_variable.hcl", + "decode_tf_variable.json", + } + + for _, f := range files { + t.Logf("Testing: %s", f) + + var actual rawConfig + err := Decode(&actual, testReadFile(t, f)) + if err != nil { + t.Fatalf("Input: %s\n\nerr: %s", f, err) + } + + if !reflect.DeepEqual(actual, expected) { + t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) + } + } +} + +func TestDecode_structureMapInvalid(t *testing.T) { + // Terraform GH-8295 + + type hclVariable struct { + Default interface{} + Description string + Fields []string `hcl:",decodedFields"` + } + + type rawConfig struct { + Variable map[string]*hclVariable + } + + var actual rawConfig + err := Decode(&actual, testReadFile(t, "terraform_variable_invalid.json")) + if err == nil { + t.Fatal("expected error") + } +} + +func TestDecode_interfaceNonPointer(t *testing.T) { + var value interface{} + err := Decode(value, testReadFile(t, "basic_int_string.hcl")) + if err == nil { + t.Fatal("should error") + } +} + +func TestDecode_intString(t *testing.T) { + var value struct { + Count int + } + + err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if value.Count != 3 { + t.Fatalf("bad: %#v", value.Count) + } +} + +func TestDecode_float32(t *testing.T) { + var value struct { + A float32 `hcl:"a"` + B float32 `hcl:"b"` + } + + err := Decode(&value, testReadFile(t, "float.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if got, want := value.A, float32(1.02); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } + if got, want := value.B, float32(2); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } +} + +func TestDecode_float64(t *testing.T) { + var value struct { + A float64 `hcl:"a"` + B float64 `hcl:"b"` + } + + err := Decode(&value, testReadFile(t, "float.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if got, want := value.A, float64(1.02); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } + if got, want := value.B, float64(2); got != want { + t.Fatalf("wrong result %#v; want %#v", got, want) + } +} + +func TestDecode_intStringAliased(t *testing.T) { + var value struct { + Count time.Duration + } + + err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) + if err != nil { + t.Fatalf("err: %s", err) + } + + if value.Count != time.Duration(3) { + t.Fatalf("bad: %#v", value.Count) + } +} + +func TestDecode_Node(t *testing.T) { + // given + var value struct { + Content ast.Node + Nested struct { + Content ast.Node + } + } + + content := ` +content { + hello = "world" +} +` + + // when + err := Decode(&value, content) + + // then + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + // verify ast.Node can be decoded later + var v map[string]interface{} + err = DecodeObject(&v, value.Content) + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + if v["hello"] != "world" { + t.Errorf("expected mapping to be returned") + } +} + +func TestDecode_NestedNode(t *testing.T) { + // given + var value struct { + Nested struct { + Content ast.Node + } + } + + content := ` +nested "content" { + hello = "world" +} +` + + // when + err := Decode(&value, content) + + // then + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + // verify ast.Node can be decoded later + var v map[string]interface{} + err = DecodeObject(&v, value.Nested.Content) + if err != nil { + t.Errorf("unable to decode content, %v", err) + return + } + + if v["hello"] != "world" { + t.Errorf("expected mapping to be returned") + } +} + +// https://github.com/hashicorp/hcl/issues/60 +func TestDecode_topLevelKeys(t *testing.T) { + type Template struct { + Source string + } + + templates := struct { + Templates []*Template `hcl:"template"` + }{} + + err := Decode(&templates, ` + template { + source = "blah" + } + + template { + source = "blahblah" + }`) + + if err != nil { + t.Fatal(err) + } + + if templates.Templates[0].Source != "blah" { + t.Errorf("bad source: %s", templates.Templates[0].Source) + } + + if templates.Templates[1].Source != "blahblah" { + t.Errorf("bad source: %s", templates.Templates[1].Source) + } +} + +func TestDecode_flattenedJSON(t *testing.T) { + // make sure we can also correctly extract a Name key too + type V struct { + Name string `hcl:",key"` + Description string + Default map[string]string + } + type Vars struct { + Variable []*V + } + + cases := []struct { + JSON string + Out interface{} + Expected interface{} + }{ + { // Nested object, no sibling keys + JSON: ` +{ + "var_name": { + "default": { + "key1": "a", + "key2": "b" + } + } +} + `, + Out: &[]*V{}, + Expected: &[]*V{ + &V{ + Name: "var_name", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + }, + }, + + { // Nested object with a sibling key (this worked previously) + JSON: ` +{ + "var_name": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } +} + `, + Out: &[]*V{}, + Expected: &[]*V{ + &V{ + Name: "var_name", + Description: "Described", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + }, + }, + + { // Multiple nested objects, one with a sibling key + JSON: ` +{ + "variable": { + "var_1": { + "default": { + "key1": "a", + "key2": "b" + } + }, + "var_2": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &Vars{}, + Expected: &Vars{ + Variable: []*V{ + &V{ + Name: "var_1", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + &V{ + Name: "var_2", + Description: "Described", + Default: map[string]string{"key1": "a", "key2": "b"}, + }, + }, + }, + }, + + { // Nested object to maps + JSON: ` +{ + "variable": { + "var_name": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &[]map[string]interface{}{}, + Expected: &[]map[string]interface{}{ + { + "variable": []map[string]interface{}{ + { + "var_name": []map[string]interface{}{ + { + "description": "Described", + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + }, + }, + + { // Nested object to maps without a sibling key should decode the same as above + JSON: ` +{ + "variable": { + "var_name": { + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &[]map[string]interface{}{}, + Expected: &[]map[string]interface{}{ + { + "variable": []map[string]interface{}{ + { + "var_name": []map[string]interface{}{ + { + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + }, + }, + + { // Nested objects, one with a sibling key, and one without + JSON: ` +{ + "variable": { + "var_1": { + "default": { + "key1": "a", + "key2": "b" + } + }, + "var_2": { + "description": "Described", + "default": { + "key1": "a", + "key2": "b" + } + } + } +} + `, + Out: &[]map[string]interface{}{}, + Expected: &[]map[string]interface{}{ + { + "variable": []map[string]interface{}{ + { + "var_1": []map[string]interface{}{ + { + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + { + "variable": []map[string]interface{}{ + { + "var_2": []map[string]interface{}{ + { + "description": "Described", + "default": []map[string]interface{}{ + { + "key1": "a", + "key2": "b", + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + + for i, tc := range cases { + err := Decode(tc.Out, tc.JSON) + if err != nil { + t.Fatalf("[%d] err: %s", i, err) + } + + if !reflect.DeepEqual(tc.Out, tc.Expected) { + t.Fatalf("[%d]\ngot: %s\nexpected: %s\n", i, spew.Sdump(tc.Out), spew.Sdump(tc.Expected)) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/go.mod b/test/integration/licenses/github.com/hashicorp/hcl/go.mod new file mode 100644 index 0000000000..4debbbe358 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/go.mod @@ -0,0 +1,3 @@ +module github.com/hashicorp/hcl + +require github.com/davecgh/go-spew v1.1.1 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/go.sum b/test/integration/licenses/github.com/hashicorp/hcl/go.sum new file mode 100644 index 0000000000..b5e2922e89 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/go.sum @@ -0,0 +1,2 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl.go new file mode 100644 index 0000000000..575a20b50b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl.go @@ -0,0 +1,11 @@ +// Package hcl decodes HCL into usable Go structures. +// +// hcl input can come in either pure HCL format or JSON format. +// It can be parsed into an AST, and then decoded into a structure, +// or it can be decoded directly from a string into a structure. +// +// If you choose to parse HCL into a raw AST, the benefit is that you +// can write custom visitor implementations to implement custom +// semantic checks. By default, HCL does not perform any semantic +// checks. +package hcl diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go new file mode 100644 index 0000000000..6e5ef654bb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go @@ -0,0 +1,219 @@ +// Package ast declares the types used to represent syntax trees for HCL +// (HashiCorp Configuration Language) +package ast + +import ( + "fmt" + "strings" + + "github.com/hashicorp/hcl/hcl/token" +) + +// Node is an element in the abstract syntax tree. +type Node interface { + node() + Pos() token.Pos +} + +func (File) node() {} +func (ObjectList) node() {} +func (ObjectKey) node() {} +func (ObjectItem) node() {} +func (Comment) node() {} +func (CommentGroup) node() {} +func (ObjectType) node() {} +func (LiteralType) node() {} +func (ListType) node() {} + +// File represents a single HCL file +type File struct { + Node Node // usually a *ObjectList + Comments []*CommentGroup // list of all comments in the source +} + +func (f *File) Pos() token.Pos { + return f.Node.Pos() +} + +// ObjectList represents a list of ObjectItems. An HCL file itself is an +// ObjectList. +type ObjectList struct { + Items []*ObjectItem +} + +func (o *ObjectList) Add(item *ObjectItem) { + o.Items = append(o.Items, item) +} + +// Filter filters out the objects with the given key list as a prefix. +// +// The returned list of objects contain ObjectItems where the keys have +// this prefix already stripped off. This might result in objects with +// zero-length key lists if they have no children. +// +// If no matches are found, an empty ObjectList (non-nil) is returned. +func (o *ObjectList) Filter(keys ...string) *ObjectList { + var result ObjectList + for _, item := range o.Items { + // If there aren't enough keys, then ignore this + if len(item.Keys) < len(keys) { + continue + } + + match := true + for i, key := range item.Keys[:len(keys)] { + key := key.Token.Value().(string) + if key != keys[i] && !strings.EqualFold(key, keys[i]) { + match = false + break + } + } + if !match { + continue + } + + // Strip off the prefix from the children + newItem := *item + newItem.Keys = newItem.Keys[len(keys):] + result.Add(&newItem) + } + + return &result +} + +// Children returns further nested objects (key length > 0) within this +// ObjectList. This should be used with Filter to get at child items. +func (o *ObjectList) Children() *ObjectList { + var result ObjectList + for _, item := range o.Items { + if len(item.Keys) > 0 { + result.Add(item) + } + } + + return &result +} + +// Elem returns items in the list that are direct element assignments +// (key length == 0). This should be used with Filter to get at elements. +func (o *ObjectList) Elem() *ObjectList { + var result ObjectList + for _, item := range o.Items { + if len(item.Keys) == 0 { + result.Add(item) + } + } + + return &result +} + +func (o *ObjectList) Pos() token.Pos { + // always returns the uninitiliazed position + return o.Items[0].Pos() +} + +// ObjectItem represents a HCL Object Item. An item is represented with a key +// (or keys). It can be an assignment or an object (both normal and nested) +type ObjectItem struct { + // keys is only one length long if it's of type assignment. If it's a + // nested object it can be larger than one. In that case "assign" is + // invalid as there is no assignments for a nested object. + Keys []*ObjectKey + + // assign contains the position of "=", if any + Assign token.Pos + + // val is the item itself. It can be an object,list, number, bool or a + // string. If key length is larger than one, val can be only of type + // Object. + Val Node + + LeadComment *CommentGroup // associated lead comment + LineComment *CommentGroup // associated line comment +} + +func (o *ObjectItem) Pos() token.Pos { + // I'm not entirely sure what causes this, but removing this causes + // a test failure. We should investigate at some point. + if len(o.Keys) == 0 { + return token.Pos{} + } + + return o.Keys[0].Pos() +} + +// ObjectKeys are either an identifier or of type string. +type ObjectKey struct { + Token token.Token +} + +func (o *ObjectKey) Pos() token.Pos { + return o.Token.Pos +} + +// LiteralType represents a literal of basic type. Valid types are: +// token.NUMBER, token.FLOAT, token.BOOL and token.STRING +type LiteralType struct { + Token token.Token + + // comment types, only used when in a list + LeadComment *CommentGroup + LineComment *CommentGroup +} + +func (l *LiteralType) Pos() token.Pos { + return l.Token.Pos +} + +// ListStatement represents a HCL List type +type ListType struct { + Lbrack token.Pos // position of "[" + Rbrack token.Pos // position of "]" + List []Node // the elements in lexical order +} + +func (l *ListType) Pos() token.Pos { + return l.Lbrack +} + +func (l *ListType) Add(node Node) { + l.List = append(l.List, node) +} + +// ObjectType represents a HCL Object Type +type ObjectType struct { + Lbrace token.Pos // position of "{" + Rbrace token.Pos // position of "}" + List *ObjectList // the nodes in lexical order +} + +func (o *ObjectType) Pos() token.Pos { + return o.Lbrace +} + +// Comment node represents a single //, # style or /*- style commment +type Comment struct { + Start token.Pos // position of / or # + Text string +} + +func (c *Comment) Pos() token.Pos { + return c.Start +} + +// CommentGroup node represents a sequence of comments with no other tokens and +// no empty lines between. +type CommentGroup struct { + List []*Comment // len(List) > 0 +} + +func (c *CommentGroup) Pos() token.Pos { + return c.List[0].Pos() +} + +//------------------------------------------------------------------- +// GoStringer +//------------------------------------------------------------------- + +func (o *ObjectKey) GoString() string { return fmt.Sprintf("*%#v", *o) } +func (o *ObjectList) GoString() string { return fmt.Sprintf("*%#v", *o) } diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go new file mode 100644 index 0000000000..d4364a10f0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go @@ -0,0 +1,200 @@ +package ast + +import ( + "reflect" + "strings" + "testing" + + "github.com/hashicorp/hcl/hcl/token" +) + +func TestObjectListFilter(t *testing.T) { + var cases = []struct { + Filter []string + Input []*ObjectItem + Output []*ObjectItem + }{ + { + []string{"foo"}, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{ + Token: token.Token{Type: token.STRING, Text: `"foo"`}, + }, + }, + }, + }, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{}, + }, + }, + }, + + { + []string{"foo"}, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, + }, + }, + }, + []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + }, + }, + } + + for _, tc := range cases { + input := &ObjectList{Items: tc.Input} + expected := &ObjectList{Items: tc.Output} + if actual := input.Filter(tc.Filter...); !reflect.DeepEqual(actual, expected) { + t.Fatalf("in order: input, expected, actual\n\n%#v\n\n%#v\n\n%#v", input, expected, actual) + } + } +} + +func TestWalk(t *testing.T) { + items := []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + Val: &LiteralType{Token: token.Token{Type: token.STRING, Text: `"example"`}}, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, + }, + }, + } + + node := &ObjectList{Items: items} + + order := []string{ + "*ast.ObjectList", + "*ast.ObjectItem", + "*ast.ObjectKey", + "*ast.ObjectKey", + "*ast.LiteralType", + "*ast.ObjectItem", + "*ast.ObjectKey", + } + count := 0 + + Walk(node, func(n Node) (Node, bool) { + if n == nil { + return n, false + } + + typeName := reflect.TypeOf(n).String() + if order[count] != typeName { + t.Errorf("expected '%s' got: '%s'", order[count], typeName) + } + count++ + return n, true + }) +} + +func TestWalkEquality(t *testing.T) { + items := []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + }, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + } + + node := &ObjectList{Items: items} + + rewritten := Walk(node, func(n Node) (Node, bool) { return n, true }) + + newNode, ok := rewritten.(*ObjectList) + if !ok { + t.Fatalf("expected Objectlist, got %T", rewritten) + } + + if !reflect.DeepEqual(node, newNode) { + t.Fatal("rewritten node is not equal to the given node") + } + + if len(newNode.Items) != 2 { + t.Errorf("expected newNode length 2, got: %d", len(newNode.Items)) + } + + expected := []string{ + `"foo"`, + `"bar"`, + } + + for i, item := range newNode.Items { + if len(item.Keys) != 1 { + t.Errorf("expected keys newNode length 1, got: %d", len(item.Keys)) + } + + if item.Keys[0].Token.Text != expected[i] { + t.Errorf("expected key %s, got %s", expected[i], item.Keys[0].Token.Text) + } + + if item.Val != nil { + t.Errorf("expected item value should be nil") + } + } +} + +func TestWalkRewrite(t *testing.T) { + items := []*ObjectItem{ + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, + }, + }, + &ObjectItem{ + Keys: []*ObjectKey{ + &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, + }, + }, + } + + node := &ObjectList{Items: items} + + suffix := "_example" + node = Walk(node, func(n Node) (Node, bool) { + switch i := n.(type) { + case *ObjectKey: + i.Token.Text = i.Token.Text + suffix + n = i + } + return n, true + }).(*ObjectList) + + Walk(node, func(n Node) (Node, bool) { + switch i := n.(type) { + case *ObjectKey: + if !strings.HasSuffix(i.Token.Text, suffix) { + t.Errorf("Token '%s' should have suffix: %s", i.Token.Text, suffix) + } + } + return n, true + }) + +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go new file mode 100644 index 0000000000..ba07ad42b0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go @@ -0,0 +1,52 @@ +package ast + +import "fmt" + +// WalkFunc describes a function to be called for each node during a Walk. The +// returned node can be used to rewrite the AST. Walking stops the returned +// bool is false. +type WalkFunc func(Node) (Node, bool) + +// Walk traverses an AST in depth-first order: It starts by calling fn(node); +// node must not be nil. If fn returns true, Walk invokes fn recursively for +// each of the non-nil children of node, followed by a call of fn(nil). The +// returned node of fn can be used to rewrite the passed node to fn. +func Walk(node Node, fn WalkFunc) Node { + rewritten, ok := fn(node) + if !ok { + return rewritten + } + + switch n := node.(type) { + case *File: + n.Node = Walk(n.Node, fn) + case *ObjectList: + for i, item := range n.Items { + n.Items[i] = Walk(item, fn).(*ObjectItem) + } + case *ObjectKey: + // nothing to do + case *ObjectItem: + for i, k := range n.Keys { + n.Keys[i] = Walk(k, fn).(*ObjectKey) + } + + if n.Val != nil { + n.Val = Walk(n.Val, fn) + } + case *LiteralType: + // nothing to do + case *ListType: + for i, l := range n.List { + n.List[i] = Walk(l, fn) + } + case *ObjectType: + n.List = Walk(n.List, fn).(*ObjectList) + default: + // should we panic here? + fmt.Printf("unknown type: %T\n", n) + } + + fn(nil) + return rewritten +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go new file mode 100644 index 0000000000..2380d71e3c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go @@ -0,0 +1,162 @@ +// Derivative work from: +// - https://golang.org/src/cmd/gofmt/gofmt.go +// - https://github.com/fatih/hclfmt + +package fmtcmd + +import ( + "bytes" + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strings" + + "github.com/hashicorp/hcl/hcl/printer" +) + +var ( + ErrWriteStdin = errors.New("cannot use write option with standard input") +) + +type Options struct { + List bool // list files whose formatting differs + Write bool // write result to (source) file instead of stdout + Diff bool // display diffs of formatting changes +} + +func isValidFile(f os.FileInfo, extensions []string) bool { + if !f.IsDir() && !strings.HasPrefix(f.Name(), ".") { + for _, ext := range extensions { + if strings.HasSuffix(f.Name(), "."+ext) { + return true + } + } + } + + return false +} + +// If in == nil, the source is the contents of the file with the given filename. +func processFile(filename string, in io.Reader, out io.Writer, stdin bool, opts Options) error { + if in == nil { + f, err := os.Open(filename) + if err != nil { + return err + } + defer f.Close() + in = f + } + + src, err := ioutil.ReadAll(in) + if err != nil { + return err + } + + res, err := printer.Format(src) + if err != nil { + return fmt.Errorf("In %s: %s", filename, err) + } + + if !bytes.Equal(src, res) { + // formatting has changed + if opts.List { + fmt.Fprintln(out, filename) + } + if opts.Write { + err = ioutil.WriteFile(filename, res, 0644) + if err != nil { + return err + } + } + if opts.Diff { + data, err := diff(src, res) + if err != nil { + return fmt.Errorf("computing diff: %s", err) + } + fmt.Fprintf(out, "diff a/%s b/%s\n", filename, filename) + out.Write(data) + } + } + + if !opts.List && !opts.Write && !opts.Diff { + _, err = out.Write(res) + } + + return err +} + +func walkDir(path string, extensions []string, stdout io.Writer, opts Options) error { + visitFile := func(path string, f os.FileInfo, err error) error { + if err == nil && isValidFile(f, extensions) { + err = processFile(path, nil, stdout, false, opts) + } + return err + } + + return filepath.Walk(path, visitFile) +} + +func Run( + paths, extensions []string, + stdin io.Reader, + stdout io.Writer, + opts Options, +) error { + if len(paths) == 0 { + if opts.Write { + return ErrWriteStdin + } + if err := processFile("", stdin, stdout, true, opts); err != nil { + return err + } + return nil + } + + for _, path := range paths { + switch dir, err := os.Stat(path); { + case err != nil: + return err + case dir.IsDir(): + if err := walkDir(path, extensions, stdout, opts); err != nil { + return err + } + default: + if err := processFile(path, nil, stdout, false, opts); err != nil { + return err + } + } + } + + return nil +} + +func diff(b1, b2 []byte) (data []byte, err error) { + f1, err := ioutil.TempFile("", "") + if err != nil { + return + } + defer os.Remove(f1.Name()) + defer f1.Close() + + f2, err := ioutil.TempFile("", "") + if err != nil { + return + } + defer os.Remove(f2.Name()) + defer f2.Close() + + f1.Write(b1) + f2.Write(b2) + + data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() + if len(data) > 0 { + // diff exits with a non-zero status when the files don't match. + // Ignore that failure as long as we get output. + err = nil + } + return +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go new file mode 100644 index 0000000000..66bed581c0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go @@ -0,0 +1,440 @@ +// +build !windows +// TODO(jen20): These need fixing on Windows but fmt is not used right now +// and red CI is making it harder to process other bugs, so ignore until +// we get around to fixing them. + +package fmtcmd + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "reflect" + "regexp" + "sort" + "syscall" + "testing" + + "github.com/hashicorp/hcl/testhelper" +) + +var fixtureExtensions = []string{"hcl"} + +func init() { + sort.Sort(ByFilename(fixtures)) +} + +func TestIsValidFile(t *testing.T) { + const fixtureDir = "./test-fixtures" + + cases := []struct { + Path string + Expected bool + }{ + {"good.hcl", true}, + {".hidden.ignore", false}, + {"file.ignore", false}, + {"dir.ignore", false}, + } + + for _, tc := range cases { + file, err := os.Stat(filepath.Join(fixtureDir, tc.Path)) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + + if res := isValidFile(file, fixtureExtensions); res != tc.Expected { + t.Errorf("want: %t, got: %t", tc.Expected, res) + } + } +} + +func TestRunMultiplePaths(t *testing.T) { + path1, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path1) + path2, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path2) + + var expectedOut bytes.Buffer + for _, path := range []string{path1, path2} { + for _, fixture := range fixtures { + if !bytes.Equal(fixture.golden, fixture.input) { + expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") + } + } + } + + _, stdout := mockIO() + err = Run( + []string{path1, path2}, + fixtureExtensions, + nil, stdout, + Options{ + List: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) + } +} + +func TestRunSubDirectories(t *testing.T) { + pathParent, err := ioutil.TempDir("", "") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(pathParent) + + path1, err := renderFixtures(pathParent) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + path2, err := renderFixtures(pathParent) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + + paths := []string{path1, path2} + sort.Strings(paths) + + var expectedOut bytes.Buffer + for _, path := range paths { + for _, fixture := range fixtures { + if !bytes.Equal(fixture.golden, fixture.input) { + expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") + } + } + } + + _, stdout := mockIO() + err = Run( + []string{pathParent}, + fixtureExtensions, + nil, stdout, + Options{ + List: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) + } +} + +func TestRunStdin(t *testing.T) { + var expectedOut bytes.Buffer + for i, fixture := range fixtures { + if i != 0 { + expectedOut.WriteString("\n") + } + expectedOut.Write(fixture.golden) + } + + stdin, stdout := mockIO() + for _, fixture := range fixtures { + stdin.Write(fixture.input) + } + + err := Run( + []string{}, + fixtureExtensions, + stdin, stdout, + Options{}, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if !bytes.Equal(stdout.Bytes(), expectedOut.Bytes()) { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) + } +} + +func TestRunStdinAndWrite(t *testing.T) { + var expectedOut = []byte{} + + stdin, stdout := mockIO() + stdin.WriteString("") + err := Run( + []string{}, []string{}, + stdin, stdout, + Options{ + Write: true, + }, + ) + + if err != ErrWriteStdin { + t.Errorf("error want:\n%s\ngot:\n%s", ErrWriteStdin, err) + } + if !bytes.Equal(stdout.Bytes(), expectedOut) { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) + } +} + +func TestRunFileError(t *testing.T) { + path, err := ioutil.TempDir("", "") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + filename := filepath.Join(path, "unreadable.hcl") + + var expectedError = &os.PathError{ + Op: "open", + Path: filename, + Err: syscall.EACCES, + } + + err = ioutil.WriteFile(filename, []byte{}, 0000) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{}, + ) + + if !reflect.DeepEqual(err, expectedError) { + t.Errorf("error want: %#v, got: %#v", expectedError, err) + } +} + +func TestRunNoOptions(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + var expectedOut bytes.Buffer + for _, fixture := range fixtures { + expectedOut.Write(fixture.golden) + } + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{}, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) + } +} + +func TestRunList(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + var expectedOut bytes.Buffer + for _, fixture := range fixtures { + if !bytes.Equal(fixture.golden, fixture.input) { + expectedOut.WriteString(fmt.Sprintln(filepath.Join(path, fixture.filename))) + } + } + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{ + List: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if stdout.String() != expectedOut.String() { + t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) + } +} + +func TestRunWrite(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{ + Write: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + for _, fixture := range fixtures { + res, err := ioutil.ReadFile(filepath.Join(path, fixture.filename)) + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if !bytes.Equal(res, fixture.golden) { + t.Errorf("file %q contents want:\n%s\ngot:\n%s", fixture.filename, fixture.golden, res) + } + } +} + +func TestRunDiff(t *testing.T) { + path, err := renderFixtures("") + if err != nil { + t.Errorf("unexpected error: %s", err) + } + defer os.RemoveAll(path) + + var expectedOut bytes.Buffer + for _, fixture := range fixtures { + if len(fixture.diff) > 0 { + expectedOut.WriteString( + regexp.QuoteMeta( + fmt.Sprintf("diff a/%s/%s b/%s/%s\n", path, fixture.filename, path, fixture.filename), + ), + ) + // Need to use regex to ignore datetimes in diff. + expectedOut.WriteString(`--- .+?\n`) + expectedOut.WriteString(`\+\+\+ .+?\n`) + expectedOut.WriteString(regexp.QuoteMeta(string(fixture.diff))) + } + } + + expectedOutString := testhelper.Unix2dos(expectedOut.String()) + + _, stdout := mockIO() + err = Run( + []string{path}, + fixtureExtensions, + nil, stdout, + Options{ + Diff: true, + }, + ) + + if err != nil { + t.Errorf("unexpected error: %s", err) + } + if !regexp.MustCompile(expectedOutString).Match(stdout.Bytes()) { + t.Errorf("stdout want match:\n%s\ngot:\n%q", expectedOutString, stdout) + } +} + +func mockIO() (stdin, stdout *bytes.Buffer) { + return new(bytes.Buffer), new(bytes.Buffer) +} + +type fixture struct { + filename string + input, golden, diff []byte +} + +type ByFilename []fixture + +func (s ByFilename) Len() int { return len(s) } +func (s ByFilename) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s ByFilename) Less(i, j int) bool { return len(s[i].filename) > len(s[j].filename) } + +var fixtures = []fixture{ + { + "noop.hcl", + []byte(`resource "aws_security_group" "firewall" { + count = 5 +} +`), + []byte(`resource "aws_security_group" "firewall" { + count = 5 +} +`), + []byte(``), + }, { + "align_equals.hcl", + []byte(`variable "foo" { + default = "bar" + description = "bar" +} +`), + []byte(`variable "foo" { + default = "bar" + description = "bar" +} +`), + []byte(`@@ -1,4 +1,4 @@ + variable "foo" { +- default = "bar" ++ default = "bar" + description = "bar" + } +`), + }, { + "indentation.hcl", + []byte(`provider "aws" { + access_key = "foo" + secret_key = "bar" +} +`), + []byte(`provider "aws" { + access_key = "foo" + secret_key = "bar" +} +`), + []byte(`@@ -1,4 +1,4 @@ + provider "aws" { +- access_key = "foo" +- secret_key = "bar" ++ access_key = "foo" ++ secret_key = "bar" + } +`), + }, +} + +// parent can be an empty string, in which case the system's default +// temporary directory will be used. +func renderFixtures(parent string) (path string, err error) { + path, err = ioutil.TempDir(parent, "") + if err != nil { + return "", err + } + + for _, fixture := range fixtures { + err = ioutil.WriteFile(filepath.Join(path, fixture.filename), []byte(fixture.input), 0644) + if err != nil { + os.RemoveAll(path) + return "", err + } + } + + return path, nil +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore new file mode 100644 index 0000000000..9977a2836c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore @@ -0,0 +1 @@ +invalid diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore new file mode 100644 index 0000000000..9977a2836c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore @@ -0,0 +1 @@ +invalid diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go new file mode 100644 index 0000000000..5c99381dfb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go @@ -0,0 +1,17 @@ +package parser + +import ( + "fmt" + + "github.com/hashicorp/hcl/hcl/token" +) + +// PosError is a parse error that contains a position. +type PosError struct { + Pos token.Pos + Err error +} + +func (e *PosError) Error() string { + return fmt.Sprintf("At %s: %s", e.Pos, e.Err) +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go new file mode 100644 index 0000000000..32399fec5d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go @@ -0,0 +1,9 @@ +package parser + +import ( + "testing" +) + +func TestPosError_impl(t *testing.T) { + var _ error = new(PosError) +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go new file mode 100644 index 0000000000..64c83bcfb5 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go @@ -0,0 +1,532 @@ +// Package parser implements a parser for HCL (HashiCorp Configuration +// Language) +package parser + +import ( + "bytes" + "errors" + "fmt" + "strings" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/scanner" + "github.com/hashicorp/hcl/hcl/token" +) + +type Parser struct { + sc *scanner.Scanner + + // Last read token + tok token.Token + commaPrev token.Token + + comments []*ast.CommentGroup + leadComment *ast.CommentGroup // last lead comment + lineComment *ast.CommentGroup // last line comment + + enableTrace bool + indent int + n int // buffer size (max = 1) +} + +func newParser(src []byte) *Parser { + return &Parser{ + sc: scanner.New(src), + } +} + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func Parse(src []byte) (*ast.File, error) { + // normalize all line endings + // since the scanner and output only work with "\n" line endings, we may + // end up with dangling "\r" characters in the parsed data. + src = bytes.Replace(src, []byte("\r\n"), []byte("\n"), -1) + + p := newParser(src) + return p.Parse() +} + +var errEofToken = errors.New("EOF token found") + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func (p *Parser) Parse() (*ast.File, error) { + f := &ast.File{} + var err, scerr error + p.sc.Error = func(pos token.Pos, msg string) { + scerr = &PosError{Pos: pos, Err: errors.New(msg)} + } + + f.Node, err = p.objectList(false) + if scerr != nil { + return nil, scerr + } + if err != nil { + return nil, err + } + + f.Comments = p.comments + return f, nil +} + +// objectList parses a list of items within an object (generally k/v pairs). +// The parameter" obj" tells this whether to we are within an object (braces: +// '{', '}') or just at the top level. If we're within an object, we end +// at an RBRACE. +func (p *Parser) objectList(obj bool) (*ast.ObjectList, error) { + defer un(trace(p, "ParseObjectList")) + node := &ast.ObjectList{} + + for { + if obj { + tok := p.scan() + p.unscan() + if tok.Type == token.RBRACE { + break + } + } + + n, err := p.objectItem() + if err == errEofToken { + break // we are finished + } + + // we don't return a nil node, because might want to use already + // collected items. + if err != nil { + return node, err + } + + node.Add(n) + + // object lists can be optionally comma-delimited e.g. when a list of maps + // is being expressed, so a comma is allowed here - it's simply consumed + tok := p.scan() + if tok.Type != token.COMMA { + p.unscan() + } + } + return node, nil +} + +func (p *Parser) consumeComment() (comment *ast.Comment, endline int) { + endline = p.tok.Pos.Line + + // count the endline if it's multiline comment, ie starting with /* + if len(p.tok.Text) > 1 && p.tok.Text[1] == '*' { + // don't use range here - no need to decode Unicode code points + for i := 0; i < len(p.tok.Text); i++ { + if p.tok.Text[i] == '\n' { + endline++ + } + } + } + + comment = &ast.Comment{Start: p.tok.Pos, Text: p.tok.Text} + p.tok = p.sc.Scan() + return +} + +func (p *Parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) { + var list []*ast.Comment + endline = p.tok.Pos.Line + + for p.tok.Type == token.COMMENT && p.tok.Pos.Line <= endline+n { + var comment *ast.Comment + comment, endline = p.consumeComment() + list = append(list, comment) + } + + // add comment group to the comments list + comments = &ast.CommentGroup{List: list} + p.comments = append(p.comments, comments) + + return +} + +// objectItem parses a single object item +func (p *Parser) objectItem() (*ast.ObjectItem, error) { + defer un(trace(p, "ParseObjectItem")) + + keys, err := p.objectKey() + if len(keys) > 0 && err == errEofToken { + // We ignore eof token here since it is an error if we didn't + // receive a value (but we did receive a key) for the item. + err = nil + } + if len(keys) > 0 && err != nil && p.tok.Type == token.RBRACE { + // This is a strange boolean statement, but what it means is: + // We have keys with no value, and we're likely in an object + // (since RBrace ends an object). For this, we set err to nil so + // we continue and get the error below of having the wrong value + // type. + err = nil + + // Reset the token type so we don't think it completed fine. See + // objectType which uses p.tok.Type to check if we're done with + // the object. + p.tok.Type = token.EOF + } + if err != nil { + return nil, err + } + + o := &ast.ObjectItem{ + Keys: keys, + } + + if p.leadComment != nil { + o.LeadComment = p.leadComment + p.leadComment = nil + } + + switch p.tok.Type { + case token.ASSIGN: + o.Assign = p.tok.Pos + o.Val, err = p.object() + if err != nil { + return nil, err + } + case token.LBRACE: + o.Val, err = p.objectType() + if err != nil { + return nil, err + } + default: + keyStr := make([]string, 0, len(keys)) + for _, k := range keys { + keyStr = append(keyStr, k.Token.Text) + } + + return nil, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf( + "key '%s' expected start of object ('{') or assignment ('=')", + strings.Join(keyStr, " ")), + } + } + + // key=#comment + // val + if p.lineComment != nil { + o.LineComment, p.lineComment = p.lineComment, nil + } + + // do a look-ahead for line comment + p.scan() + if len(keys) > 0 && o.Val.Pos().Line == keys[0].Pos().Line && p.lineComment != nil { + o.LineComment = p.lineComment + p.lineComment = nil + } + p.unscan() + return o, nil +} + +// objectKey parses an object key and returns a ObjectKey AST +func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { + keyCount := 0 + keys := make([]*ast.ObjectKey, 0) + + for { + tok := p.scan() + switch tok.Type { + case token.EOF: + // It is very important to also return the keys here as well as + // the error. This is because we need to be able to tell if we + // did parse keys prior to finding the EOF, or if we just found + // a bare EOF. + return keys, errEofToken + case token.ASSIGN: + // assignment or object only, but not nested objects. this is not + // allowed: `foo bar = {}` + if keyCount > 1 { + return nil, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("nested object expected: LBRACE got: %s", p.tok.Type), + } + } + + if keyCount == 0 { + return nil, &PosError{ + Pos: p.tok.Pos, + Err: errors.New("no object keys found!"), + } + } + + return keys, nil + case token.LBRACE: + var err error + + // If we have no keys, then it is a syntax error. i.e. {{}} is not + // allowed. + if len(keys) == 0 { + err = &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("expected: IDENT | STRING got: %s", p.tok.Type), + } + } + + // object + return keys, err + case token.IDENT, token.STRING: + keyCount++ + keys = append(keys, &ast.ObjectKey{Token: p.tok}) + case token.ILLEGAL: + return keys, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("illegal character"), + } + default: + return keys, &PosError{ + Pos: p.tok.Pos, + Err: fmt.Errorf("expected: IDENT | STRING | ASSIGN | LBRACE got: %s", p.tok.Type), + } + } + } +} + +// object parses any type of object, such as number, bool, string, object or +// list. +func (p *Parser) object() (ast.Node, error) { + defer un(trace(p, "ParseType")) + tok := p.scan() + + switch tok.Type { + case token.NUMBER, token.FLOAT, token.BOOL, token.STRING, token.HEREDOC: + return p.literalType() + case token.LBRACE: + return p.objectType() + case token.LBRACK: + return p.listType() + case token.COMMENT: + // implement comment + case token.EOF: + return nil, errEofToken + } + + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf("Unknown token: %+v", tok), + } +} + +// objectType parses an object type and returns a ObjectType AST +func (p *Parser) objectType() (*ast.ObjectType, error) { + defer un(trace(p, "ParseObjectType")) + + // we assume that the currently scanned token is a LBRACE + o := &ast.ObjectType{ + Lbrace: p.tok.Pos, + } + + l, err := p.objectList(true) + + // if we hit RBRACE, we are good to go (means we parsed all Items), if it's + // not a RBRACE, it's an syntax error and we just return it. + if err != nil && p.tok.Type != token.RBRACE { + return nil, err + } + + // No error, scan and expect the ending to be a brace + if tok := p.scan(); tok.Type != token.RBRACE { + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf("object expected closing RBRACE got: %s", tok.Type), + } + } + + o.List = l + o.Rbrace = p.tok.Pos // advanced via parseObjectList + return o, nil +} + +// listType parses a list type and returns a ListType AST +func (p *Parser) listType() (*ast.ListType, error) { + defer un(trace(p, "ParseListType")) + + // we assume that the currently scanned token is a LBRACK + l := &ast.ListType{ + Lbrack: p.tok.Pos, + } + + needComma := false + for { + tok := p.scan() + if needComma { + switch tok.Type { + case token.COMMA, token.RBRACK: + default: + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf( + "error parsing list, expected comma or list end, got: %s", + tok.Type), + } + } + } + switch tok.Type { + case token.BOOL, token.NUMBER, token.FLOAT, token.STRING, token.HEREDOC: + node, err := p.literalType() + if err != nil { + return nil, err + } + + // If there is a lead comment, apply it + if p.leadComment != nil { + node.LeadComment = p.leadComment + p.leadComment = nil + } + + l.Add(node) + needComma = true + case token.COMMA: + // get next list item or we are at the end + // do a look-ahead for line comment + p.scan() + if p.lineComment != nil && len(l.List) > 0 { + lit, ok := l.List[len(l.List)-1].(*ast.LiteralType) + if ok { + lit.LineComment = p.lineComment + l.List[len(l.List)-1] = lit + p.lineComment = nil + } + } + p.unscan() + + needComma = false + continue + case token.LBRACE: + // Looks like a nested object, so parse it out + node, err := p.objectType() + if err != nil { + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf( + "error while trying to parse object within list: %s", err), + } + } + l.Add(node) + needComma = true + case token.LBRACK: + node, err := p.listType() + if err != nil { + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf( + "error while trying to parse list within list: %s", err), + } + } + l.Add(node) + case token.RBRACK: + // finished + l.Rbrack = p.tok.Pos + return l, nil + default: + return nil, &PosError{ + Pos: tok.Pos, + Err: fmt.Errorf("unexpected token while parsing list: %s", tok.Type), + } + } + } +} + +// literalType parses a literal type and returns a LiteralType AST +func (p *Parser) literalType() (*ast.LiteralType, error) { + defer un(trace(p, "ParseLiteral")) + + return &ast.LiteralType{ + Token: p.tok, + }, nil +} + +// scan returns the next token from the underlying scanner. If a token has +// been unscanned then read that instead. In the process, it collects any +// comment groups encountered, and remembers the last lead and line comments. +func (p *Parser) scan() token.Token { + // If we have a token on the buffer, then return it. + if p.n != 0 { + p.n = 0 + return p.tok + } + + // Otherwise read the next token from the scanner and Save it to the buffer + // in case we unscan later. + prev := p.tok + p.tok = p.sc.Scan() + + if p.tok.Type == token.COMMENT { + var comment *ast.CommentGroup + var endline int + + // fmt.Printf("p.tok.Pos.Line = %+v prev: %d endline %d \n", + // p.tok.Pos.Line, prev.Pos.Line, endline) + if p.tok.Pos.Line == prev.Pos.Line { + // The comment is on same line as the previous token; it + // cannot be a lead comment but may be a line comment. + comment, endline = p.consumeCommentGroup(0) + if p.tok.Pos.Line != endline { + // The next token is on a different line, thus + // the last comment group is a line comment. + p.lineComment = comment + } + } + + // consume successor comments, if any + endline = -1 + for p.tok.Type == token.COMMENT { + comment, endline = p.consumeCommentGroup(1) + } + + if endline+1 == p.tok.Pos.Line && p.tok.Type != token.RBRACE { + switch p.tok.Type { + case token.RBRACE, token.RBRACK: + // Do not count for these cases + default: + // The next token is following on the line immediately after the + // comment group, thus the last comment group is a lead comment. + p.leadComment = comment + } + } + + } + + return p.tok +} + +// unscan pushes the previously read token back onto the buffer. +func (p *Parser) unscan() { + p.n = 1 +} + +// ---------------------------------------------------------------------------- +// Parsing support + +func (p *Parser) printTrace(a ...interface{}) { + if !p.enableTrace { + return + } + + const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " + const n = len(dots) + fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) + + i := 2 * p.indent + for i > n { + fmt.Print(dots) + i -= n + } + // i <= n + fmt.Print(dots[0:i]) + fmt.Println(a...) +} + +func trace(p *Parser, msg string) *Parser { + p.printTrace(msg, "(") + p.indent++ + return p +} + +// Usage pattern: defer un(trace(p, "...")) +func un(p *Parser) { + p.indent-- + p.printTrace(")") +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go new file mode 100644 index 0000000000..2702122076 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go @@ -0,0 +1,575 @@ +package parser + +import ( + "fmt" + "io/ioutil" + "path/filepath" + "reflect" + "runtime" + "strings" + "testing" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/token" +) + +func TestType(t *testing.T) { + var literals = []struct { + typ token.Type + src string + }{ + {token.STRING, `foo = "foo"`}, + {token.NUMBER, `foo = 123`}, + {token.NUMBER, `foo = -29`}, + {token.FLOAT, `foo = 123.12`}, + {token.FLOAT, `foo = -123.12`}, + {token.BOOL, `foo = true`}, + {token.HEREDOC, "foo = <= 0 { + result = p.heredocIndent(result) + } + } + + return result +} + +// objectItem returns the printable HCL form of an object item. An object type +// starts with one/multiple keys and has a value. The value might be of any +// type. +func (p *printer) objectItem(o *ast.ObjectItem) []byte { + defer un(trace(p, fmt.Sprintf("ObjectItem: %s", o.Keys[0].Token.Text))) + var buf bytes.Buffer + + if o.LeadComment != nil { + for _, comment := range o.LeadComment.List { + buf.WriteString(comment.Text) + buf.WriteByte(newline) + } + } + + // If key and val are on different lines, treat line comments like lead comments. + if o.LineComment != nil && o.Val.Pos().Line != o.Keys[0].Pos().Line { + for _, comment := range o.LineComment.List { + buf.WriteString(comment.Text) + buf.WriteByte(newline) + } + } + + for i, k := range o.Keys { + buf.WriteString(k.Token.Text) + buf.WriteByte(blank) + + // reach end of key + if o.Assign.IsValid() && i == len(o.Keys)-1 && len(o.Keys) == 1 { + buf.WriteString("=") + buf.WriteByte(blank) + } + } + + buf.Write(p.output(o.Val)) + + if o.LineComment != nil && o.Val.Pos().Line == o.Keys[0].Pos().Line { + buf.WriteByte(blank) + for _, comment := range o.LineComment.List { + buf.WriteString(comment.Text) + } + } + + return buf.Bytes() +} + +// objectType returns the printable HCL form of an object type. An object type +// begins with a brace and ends with a brace. +func (p *printer) objectType(o *ast.ObjectType) []byte { + defer un(trace(p, "ObjectType")) + var buf bytes.Buffer + buf.WriteString("{") + + var index int + var nextItem token.Pos + var commented, newlinePrinted bool + for { + // Determine the location of the next actual non-comment + // item. If we're at the end, the next item is the closing brace + if index != len(o.List.Items) { + nextItem = o.List.Items[index].Pos() + } else { + nextItem = o.Rbrace + } + + // Go through the standalone comments in the file and print out + // the comments that we should be for this object item. + for _, c := range p.standaloneComments { + printed := false + var lastCommentPos token.Pos + for _, comment := range c.List { + // We only care about comments after the previous item + // we've printed so that comments are printed in the + // correct locations (between two objects for example). + // And before the next item. + if comment.Pos().After(p.prev) && comment.Pos().Before(nextItem) { + // If there are standalone comments and the initial newline has not + // been printed yet, do it now. + if !newlinePrinted { + newlinePrinted = true + buf.WriteByte(newline) + } + + // add newline if it's between other printed nodes + if index > 0 { + commented = true + buf.WriteByte(newline) + } + + // Store this position + lastCommentPos = comment.Pos() + + // output the comment itself + buf.Write(p.indent(p.heredocIndent([]byte(comment.Text)))) + + // Set printed to true to note that we printed something + printed = true + + /* + if index != len(o.List.Items) { + buf.WriteByte(newline) // do not print on the end + } + */ + } + } + + // Stuff to do if we had comments + if printed { + // Always write a newline + buf.WriteByte(newline) + + // If there is another item in the object and our comment + // didn't hug it directly, then make sure there is a blank + // line separating them. + if nextItem != o.Rbrace && nextItem.Line != lastCommentPos.Line+1 { + buf.WriteByte(newline) + } + } + } + + if index == len(o.List.Items) { + p.prev = o.Rbrace + break + } + + // At this point we are sure that it's not a totally empty block: print + // the initial newline if it hasn't been printed yet by the previous + // block about standalone comments. + if !newlinePrinted { + buf.WriteByte(newline) + newlinePrinted = true + } + + // check if we have adjacent one liner items. If yes we'll going to align + // the comments. + var aligned []*ast.ObjectItem + for _, item := range o.List.Items[index:] { + // we don't group one line lists + if len(o.List.Items) == 1 { + break + } + + // one means a oneliner with out any lead comment + // two means a oneliner with lead comment + // anything else might be something else + cur := lines(string(p.objectItem(item))) + if cur > 2 { + break + } + + curPos := item.Pos() + + nextPos := token.Pos{} + if index != len(o.List.Items)-1 { + nextPos = o.List.Items[index+1].Pos() + } + + prevPos := token.Pos{} + if index != 0 { + prevPos = o.List.Items[index-1].Pos() + } + + // fmt.Println("DEBUG ----------------") + // fmt.Printf("prev = %+v prevPos: %s\n", prev, prevPos) + // fmt.Printf("cur = %+v curPos: %s\n", cur, curPos) + // fmt.Printf("next = %+v nextPos: %s\n", next, nextPos) + + if curPos.Line+1 == nextPos.Line { + aligned = append(aligned, item) + index++ + continue + } + + if curPos.Line-1 == prevPos.Line { + aligned = append(aligned, item) + index++ + + // finish if we have a new line or comment next. This happens + // if the next item is not adjacent + if curPos.Line+1 != nextPos.Line { + break + } + continue + } + + break + } + + // put newlines if the items are between other non aligned items. + // newlines are also added if there is a standalone comment already, so + // check it too + if !commented && index != len(aligned) { + buf.WriteByte(newline) + } + + if len(aligned) >= 1 { + p.prev = aligned[len(aligned)-1].Pos() + + items := p.alignedItems(aligned) + buf.Write(p.indent(items)) + } else { + p.prev = o.List.Items[index].Pos() + + buf.Write(p.indent(p.objectItem(o.List.Items[index]))) + index++ + } + + buf.WriteByte(newline) + } + + buf.WriteString("}") + return buf.Bytes() +} + +func (p *printer) alignedItems(items []*ast.ObjectItem) []byte { + var buf bytes.Buffer + + // find the longest key and value length, needed for alignment + var longestKeyLen int // longest key length + var longestValLen int // longest value length + for _, item := range items { + key := len(item.Keys[0].Token.Text) + val := len(p.output(item.Val)) + + if key > longestKeyLen { + longestKeyLen = key + } + + if val > longestValLen { + longestValLen = val + } + } + + for i, item := range items { + if item.LeadComment != nil { + for _, comment := range item.LeadComment.List { + buf.WriteString(comment.Text) + buf.WriteByte(newline) + } + } + + for i, k := range item.Keys { + keyLen := len(k.Token.Text) + buf.WriteString(k.Token.Text) + for i := 0; i < longestKeyLen-keyLen+1; i++ { + buf.WriteByte(blank) + } + + // reach end of key + if i == len(item.Keys)-1 && len(item.Keys) == 1 { + buf.WriteString("=") + buf.WriteByte(blank) + } + } + + val := p.output(item.Val) + valLen := len(val) + buf.Write(val) + + if item.Val.Pos().Line == item.Keys[0].Pos().Line && item.LineComment != nil { + for i := 0; i < longestValLen-valLen+1; i++ { + buf.WriteByte(blank) + } + + for _, comment := range item.LineComment.List { + buf.WriteString(comment.Text) + } + } + + // do not print for the last item + if i != len(items)-1 { + buf.WriteByte(newline) + } + } + + return buf.Bytes() +} + +// list returns the printable HCL form of an list type. +func (p *printer) list(l *ast.ListType) []byte { + if p.isSingleLineList(l) { + return p.singleLineList(l) + } + + var buf bytes.Buffer + buf.WriteString("[") + buf.WriteByte(newline) + + var longestLine int + for _, item := range l.List { + // for now we assume that the list only contains literal types + if lit, ok := item.(*ast.LiteralType); ok { + lineLen := len(lit.Token.Text) + if lineLen > longestLine { + longestLine = lineLen + } + } + } + + haveEmptyLine := false + for i, item := range l.List { + // If we have a lead comment, then we want to write that first + leadComment := false + if lit, ok := item.(*ast.LiteralType); ok && lit.LeadComment != nil { + leadComment = true + + // Ensure an empty line before every element with a + // lead comment (except the first item in a list). + if !haveEmptyLine && i != 0 { + buf.WriteByte(newline) + } + + for _, comment := range lit.LeadComment.List { + buf.Write(p.indent([]byte(comment.Text))) + buf.WriteByte(newline) + } + } + + // also indent each line + val := p.output(item) + curLen := len(val) + buf.Write(p.indent(val)) + + // if this item is a heredoc, then we output the comma on + // the next line. This is the only case this happens. + comma := []byte{','} + if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { + buf.WriteByte(newline) + comma = p.indent(comma) + } + + buf.Write(comma) + + if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { + // if the next item doesn't have any comments, do not align + buf.WriteByte(blank) // align one space + for i := 0; i < longestLine-curLen; i++ { + buf.WriteByte(blank) + } + + for _, comment := range lit.LineComment.List { + buf.WriteString(comment.Text) + } + } + + buf.WriteByte(newline) + + // Ensure an empty line after every element with a + // lead comment (except the first item in a list). + haveEmptyLine = leadComment && i != len(l.List)-1 + if haveEmptyLine { + buf.WriteByte(newline) + } + } + + buf.WriteString("]") + return buf.Bytes() +} + +// isSingleLineList returns true if: +// * they were previously formatted entirely on one line +// * they consist entirely of literals +// * there are either no heredoc strings or the list has exactly one element +// * there are no line comments +func (printer) isSingleLineList(l *ast.ListType) bool { + for _, item := range l.List { + if item.Pos().Line != l.Lbrack.Line { + return false + } + + lit, ok := item.(*ast.LiteralType) + if !ok { + return false + } + + if lit.Token.Type == token.HEREDOC && len(l.List) != 1 { + return false + } + + if lit.LineComment != nil { + return false + } + } + + return true +} + +// singleLineList prints a simple single line list. +// For a definition of "simple", see isSingleLineList above. +func (p *printer) singleLineList(l *ast.ListType) []byte { + buf := &bytes.Buffer{} + + buf.WriteString("[") + for i, item := range l.List { + if i != 0 { + buf.WriteString(", ") + } + + // Output the item itself + buf.Write(p.output(item)) + + // The heredoc marker needs to be at the end of line. + if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { + buf.WriteByte(newline) + } + } + + buf.WriteString("]") + return buf.Bytes() +} + +// indent indents the lines of the given buffer for each non-empty line +func (p *printer) indent(buf []byte) []byte { + var prefix []byte + if p.cfg.SpacesWidth != 0 { + for i := 0; i < p.cfg.SpacesWidth; i++ { + prefix = append(prefix, blank) + } + } else { + prefix = []byte{tab} + } + + var res []byte + bol := true + for _, c := range buf { + if bol && c != '\n' { + res = append(res, prefix...) + } + + res = append(res, c) + bol = c == '\n' + } + return res +} + +// unindent removes all the indentation from the tombstoned lines +func (p *printer) unindent(buf []byte) []byte { + var res []byte + for i := 0; i < len(buf); i++ { + skip := len(buf)-i <= len(unindent) + if !skip { + skip = !bytes.Equal(unindent, buf[i:i+len(unindent)]) + } + if skip { + res = append(res, buf[i]) + continue + } + + // We have a marker. we have to backtrace here and clean out + // any whitespace ahead of our tombstone up to a \n + for j := len(res) - 1; j >= 0; j-- { + if res[j] == '\n' { + break + } + + res = res[:j] + } + + // Skip the entire unindent marker + i += len(unindent) - 1 + } + + return res +} + +// heredocIndent marks all the 2nd and further lines as unindentable +func (p *printer) heredocIndent(buf []byte) []byte { + var res []byte + bol := false + for _, c := range buf { + if bol && c != '\n' { + res = append(res, unindent...) + } + res = append(res, c) + bol = c == '\n' + } + return res +} + +// isSingleLineObject tells whether the given object item is a single +// line object such as "obj {}". +// +// A single line object: +// +// * has no lead comments (hence multi-line) +// * has no assignment +// * has no values in the stanza (within {}) +// +func (p *printer) isSingleLineObject(val *ast.ObjectItem) bool { + // If there is a lead comment, can't be one line + if val.LeadComment != nil { + return false + } + + // If there is assignment, we always break by line + if val.Assign.IsValid() { + return false + } + + // If it isn't an object type, then its not a single line object + ot, ok := val.Val.(*ast.ObjectType) + if !ok { + return false + } + + // If the object has no items, it is single line! + return len(ot.List.Items) == 0 +} + +func lines(txt string) int { + endline := 1 + for i := 0; i < len(txt); i++ { + if txt[i] == '\n' { + endline++ + } + } + return endline +} + +// ---------------------------------------------------------------------------- +// Tracing support + +func (p *printer) printTrace(a ...interface{}) { + if !p.enableTrace { + return + } + + const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " + const n = len(dots) + i := 2 * p.indentTrace + for i > n { + fmt.Print(dots) + i -= n + } + // i <= n + fmt.Print(dots[0:i]) + fmt.Println(a...) +} + +func trace(p *printer, msg string) *printer { + p.printTrace(msg, "(") + p.indentTrace++ + return p +} + +// Usage pattern: defer un(trace(p, "...")) +func un(p *printer) { + p.indentTrace-- + p.printTrace(")") +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go new file mode 100644 index 0000000000..6617ab8e7a --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go @@ -0,0 +1,66 @@ +// Package printer implements printing of AST nodes to HCL format. +package printer + +import ( + "bytes" + "io" + "text/tabwriter" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/parser" +) + +var DefaultConfig = Config{ + SpacesWidth: 2, +} + +// A Config node controls the output of Fprint. +type Config struct { + SpacesWidth int // if set, it will use spaces instead of tabs for alignment +} + +func (c *Config) Fprint(output io.Writer, node ast.Node) error { + p := &printer{ + cfg: *c, + comments: make([]*ast.CommentGroup, 0), + standaloneComments: make([]*ast.CommentGroup, 0), + // enableTrace: true, + } + + p.collectComments(node) + + if _, err := output.Write(p.unindent(p.output(node))); err != nil { + return err + } + + // flush tabwriter, if any + var err error + if tw, _ := output.(*tabwriter.Writer); tw != nil { + err = tw.Flush() + } + + return err +} + +// Fprint "pretty-prints" an HCL node to output +// It calls Config.Fprint with default settings. +func Fprint(output io.Writer, node ast.Node) error { + return DefaultConfig.Fprint(output, node) +} + +// Format formats src HCL and returns the result. +func Format(src []byte) ([]byte, error) { + node, err := parser.Parse(src) + if err != nil { + return nil, err + } + + var buf bytes.Buffer + if err := DefaultConfig.Fprint(&buf, node); err != nil { + return nil, err + } + + // Add trailing newline to result + buf.WriteString("\n") + return buf.Bytes(), nil +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go new file mode 100644 index 0000000000..8ae747ab82 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go @@ -0,0 +1,176 @@ +package printer + +import ( + "bytes" + "errors" + "flag" + "fmt" + "io/ioutil" + "path/filepath" + "testing" + + "github.com/hashicorp/hcl/hcl/parser" +) + +var update = flag.Bool("update", false, "update golden files") + +const ( + dataDir = "testdata" +) + +type entry struct { + source, golden string +} + +// Use go test -update to create/update the respective golden files. +var data = []entry{ + {"complexhcl.input", "complexhcl.golden"}, + {"list.input", "list.golden"}, + {"list_comment.input", "list_comment.golden"}, + {"comment.input", "comment.golden"}, + {"comment_crlf.input", "comment.golden"}, + {"comment_aligned.input", "comment_aligned.golden"}, + {"comment_array.input", "comment_array.golden"}, + {"comment_end_file.input", "comment_end_file.golden"}, + {"comment_multiline_indent.input", "comment_multiline_indent.golden"}, + {"comment_multiline_no_stanza.input", "comment_multiline_no_stanza.golden"}, + {"comment_multiline_stanza.input", "comment_multiline_stanza.golden"}, + {"comment_newline.input", "comment_newline.golden"}, + {"comment_object_multi.input", "comment_object_multi.golden"}, + {"comment_standalone.input", "comment_standalone.golden"}, + {"empty_block.input", "empty_block.golden"}, + {"list_of_objects.input", "list_of_objects.golden"}, + {"multiline_string.input", "multiline_string.golden"}, + {"object_singleline.input", "object_singleline.golden"}, + {"object_with_heredoc.input", "object_with_heredoc.golden"}, +} + +func TestFiles(t *testing.T) { + for _, e := range data { + source := filepath.Join(dataDir, e.source) + golden := filepath.Join(dataDir, e.golden) + t.Run(e.source, func(t *testing.T) { + check(t, source, golden) + }) + } +} + +func check(t *testing.T, source, golden string) { + src, err := ioutil.ReadFile(source) + if err != nil { + t.Error(err) + return + } + + res, err := format(src) + if err != nil { + t.Error(err) + return + } + + // update golden files if necessary + if *update { + if err := ioutil.WriteFile(golden, res, 0644); err != nil { + t.Error(err) + } + return + } + + // get golden + gld, err := ioutil.ReadFile(golden) + if err != nil { + t.Error(err) + return + } + + // formatted source and golden must be the same + if err := diff(source, golden, res, gld); err != nil { + t.Error(err) + return + } +} + +// diff compares a and b. +func diff(aname, bname string, a, b []byte) error { + var buf bytes.Buffer // holding long error message + + // compare lengths + if len(a) != len(b) { + fmt.Fprintf(&buf, "\nlength changed: len(%s) = %d, len(%s) = %d", aname, len(a), bname, len(b)) + } + + // compare contents + line := 1 + offs := 1 + for i := 0; i < len(a) && i < len(b); i++ { + ch := a[i] + if ch != b[i] { + fmt.Fprintf(&buf, "\n%s:%d:%d: %q", aname, line, i-offs+1, lineAt(a, offs)) + fmt.Fprintf(&buf, "\n%s:%d:%d: %q", bname, line, i-offs+1, lineAt(b, offs)) + fmt.Fprintf(&buf, "\n\n") + break + } + if ch == '\n' { + line++ + offs = i + 1 + } + } + + if buf.Len() > 0 { + return errors.New(buf.String()) + } + return nil +} + +// format parses src, prints the corresponding AST, verifies the resulting +// src is syntactically correct, and returns the resulting src or an error +// if any. +func format(src []byte) ([]byte, error) { + formatted, err := Format(src) + if err != nil { + return nil, err + } + + // make sure formatted output is syntactically correct + if _, err := parser.Parse(formatted); err != nil { + return nil, fmt.Errorf("parse: %s\n%s", err, formatted) + } + + return formatted, nil +} + +// lineAt returns the line in text starting at offset offs. +func lineAt(text []byte, offs int) []byte { + i := offs + for i < len(text) && text[i] != '\n' { + i++ + } + return text[offs:i] +} + +// TestFormatParsable ensures that the output of Format() is can be parsed again. +func TestFormatValidOutput(t *testing.T) { + cases := []string{ + "#\x00", + "#\ue123t", + "x=//\n0y=<<_\n_\n", + "y=[1,//\n]", + "Y=<<4\n4/\n\n\n/4/@=4/\n\n\n/4000000004\r\r\n00004\n", + "x=<<_\n_\r\r\n_\n", + "X=<<-\n\r\r\n", + } + + for _, c := range cases { + f, err := Format([]byte(c)) + if err != nil { + // ignore these failures, not all inputs are valid HCL. + t.Logf("Format(%q) = %v", c, err) + continue + } + + if _, err := parser.Parse(f); err != nil { + t.Errorf("Format(%q) = %q; Parse(%q) = %v", c, f, f, err) + continue + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden new file mode 100644 index 0000000000..192c26aac1 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden @@ -0,0 +1,39 @@ +// A standalone comment is a comment which is not attached to any kind of node + +// This comes from Terraform, as a test +variable "foo" { + # Standalone comment should be still here + + default = "bar" + description = "bar" # yooo +} + +/* This is a multi line standalone +comment*/ + +// fatih arslan +/* This is a developer test +account and a multine comment */ +developer = ["fatih", "arslan"] // fatih arslan + +# One line here +numbers = [1, 2] // another line here + +# Another comment +variable = { + description = "bar" # another yooo + + foo { + # Nested standalone + + bar = "fatih" + } +} + +// lead comment +foo { + bar = "fatih" // line comment 2 +} // line comment 3 + +// comment +multiline = "assignment" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input new file mode 100644 index 0000000000..c4b29de7fe --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input @@ -0,0 +1,39 @@ +// A standalone comment is a comment which is not attached to any kind of node + + // This comes from Terraform, as a test +variable "foo" { + # Standalone comment should be still here + + default = "bar" + description = "bar" # yooo +} + +/* This is a multi line standalone +comment*/ + + +// fatih arslan +/* This is a developer test +account and a multine comment */ +developer = [ "fatih", "arslan"] // fatih arslan + +# One line here +numbers = [1,2] // another line here + + # Another comment +variable = { + description = "bar" # another yooo + foo { + # Nested standalone + + bar = "fatih" + } +} + + // lead comment +foo { + bar = "fatih" // line comment 2 +} // line comment 3 + +multiline = // comment +"assignment" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden new file mode 100644 index 0000000000..6ff21504c9 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden @@ -0,0 +1,32 @@ +aligned { + # We have some aligned items below + foo = "fatih" # yoo1 + default = "bar" # yoo2 + bar = "bar and foo" # yoo3 + + default = { + bar = "example" + } + + #deneme arslan + fatih = ["fatih"] # yoo4 + + #fatih arslan + fatiharslan = ["arslan"] // yoo5 + + default = { + bar = "example" + } + + security_groups = [ + "foo", # kenya 1 + "${aws_security_group.firewall.foo}", # kenya 2 + ] + + security_groups2 = [ + "foo", # kenya 1 + "bar", # kenya 1.5 + "${aws_security_group.firewall.foo}", # kenya 2 + "foobar", # kenya 3 + ] +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input new file mode 100644 index 0000000000..bd43ab1adc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input @@ -0,0 +1,28 @@ +aligned { +# We have some aligned items below + foo = "fatih" # yoo1 + default = "bar" # yoo2 + bar = "bar and foo" # yoo3 + default = { + bar = "example" + } + #deneme arslan + fatih = ["fatih"] # yoo4 + #fatih arslan + fatiharslan = ["arslan"] // yoo5 + default = { + bar = "example" + } + +security_groups = [ + "foo", # kenya 1 + "${aws_security_group.firewall.foo}", # kenya 2 +] + +security_groups2 = [ + "foo", # kenya 1 + "bar", # kenya 1.5 + "${aws_security_group.firewall.foo}", # kenya 2 + "foobar", # kenya 3 +] +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden new file mode 100644 index 0000000000..e778eafa36 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden @@ -0,0 +1,13 @@ +banana = [ + # I really want to comment this item in the array. + "a", + + # This as well + "b", + + "c", # And C + "d", + + # And another + "e", +] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input new file mode 100644 index 0000000000..e778eafa36 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input @@ -0,0 +1,13 @@ +banana = [ + # I really want to comment this item in the array. + "a", + + # This as well + "b", + + "c", # And C + "d", + + # And another + "e", +] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input new file mode 100644 index 0000000000..495508644b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input @@ -0,0 +1,39 @@ +// A standalone comment is a comment which is not attached to any kind of node + + // This comes from Terraform, as a test +variable "foo" { + # Standalone comment should be still here + + default = "bar" + description = "bar" # yooo +} + +/* This is a multi line standalone +comment*/ + + +// fatih arslan +/* This is a developer test +account and a multine comment */ +developer = [ "fatih", "arslan"] // fatih arslan + +# One line here +numbers = [1,2] // another line here + + # Another comment +variable = { + description = "bar" # another yooo + foo { + # Nested standalone + + bar = "fatih" + } +} + + // lead comment +foo { + bar = "fatih" // line comment 2 +} // line comment 3 + +multiline = // comment +"assignment" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden new file mode 100644 index 0000000000..dbeae36a8b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden @@ -0,0 +1,6 @@ +resource "blah" "blah" {} + +// +// +// + diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input new file mode 100644 index 0000000000..68c4c282ec --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input @@ -0,0 +1,5 @@ +resource "blah" "blah" {} + +// +// +// diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden new file mode 100644 index 0000000000..74c4ccd896 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden @@ -0,0 +1,12 @@ +resource "provider" "resource" { + /* + SPACE_SENSITIVE_CODE = < 0 { + // common case: last character was not a '\n' + s.tokPos.Line = s.srcPos.Line + s.tokPos.Column = s.srcPos.Column + } else { + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + s.tokPos.Line = s.srcPos.Line - 1 + s.tokPos.Column = s.lastLineLen + } + + switch { + case isLetter(ch): + tok = token.IDENT + lit := s.scanIdentifier() + if lit == "true" || lit == "false" { + tok = token.BOOL + } + case isDecimal(ch): + tok = s.scanNumber(ch) + default: + switch ch { + case eof: + tok = token.EOF + case '"': + tok = token.STRING + s.scanString() + case '#', '/': + tok = token.COMMENT + s.scanComment(ch) + case '.': + tok = token.PERIOD + ch = s.peek() + if isDecimal(ch) { + tok = token.FLOAT + ch = s.scanMantissa(ch) + ch = s.scanExponent(ch) + } + case '<': + tok = token.HEREDOC + s.scanHeredoc() + case '[': + tok = token.LBRACK + case ']': + tok = token.RBRACK + case '{': + tok = token.LBRACE + case '}': + tok = token.RBRACE + case ',': + tok = token.COMMA + case '=': + tok = token.ASSIGN + case '+': + tok = token.ADD + case '-': + if isDecimal(s.peek()) { + ch := s.next() + tok = s.scanNumber(ch) + } else { + tok = token.SUB + } + default: + s.err("illegal char") + } + } + + // finish token ending + s.tokEnd = s.srcPos.Offset + + // create token literal + var tokenText string + if s.tokStart >= 0 { + tokenText = string(s.src[s.tokStart:s.tokEnd]) + } + s.tokStart = s.tokEnd // ensure idempotency of tokenText() call + + return token.Token{ + Type: tok, + Pos: s.tokPos, + Text: tokenText, + } +} + +func (s *Scanner) scanComment(ch rune) { + // single line comments + if ch == '#' || (ch == '/' && s.peek() != '*') { + if ch == '/' && s.peek() != '/' { + s.err("expected '/' for comment") + return + } + + ch = s.next() + for ch != '\n' && ch >= 0 && ch != eof { + ch = s.next() + } + if ch != eof && ch >= 0 { + s.unread() + } + return + } + + // be sure we get the character after /* This allows us to find comment's + // that are not erminated + if ch == '/' { + s.next() + ch = s.next() // read character after "/*" + } + + // look for /* - style comments + for { + if ch < 0 || ch == eof { + s.err("comment not terminated") + break + } + + ch0 := ch + ch = s.next() + if ch0 == '*' && ch == '/' { + break + } + } +} + +// scanNumber scans a HCL number definition starting with the given rune +func (s *Scanner) scanNumber(ch rune) token.Type { + if ch == '0' { + // check for hexadecimal, octal or float + ch = s.next() + if ch == 'x' || ch == 'X' { + // hexadecimal + ch = s.next() + found := false + for isHexadecimal(ch) { + ch = s.next() + found = true + } + + if !found { + s.err("illegal hexadecimal number") + } + + if ch != eof { + s.unread() + } + + return token.NUMBER + } + + // now it's either something like: 0421(octal) or 0.1231(float) + illegalOctal := false + for isDecimal(ch) { + ch = s.next() + if ch == '8' || ch == '9' { + // this is just a possibility. For example 0159 is illegal, but + // 0159.23 is valid. So we mark a possible illegal octal. If + // the next character is not a period, we'll print the error. + illegalOctal = true + } + } + + if ch == 'e' || ch == 'E' { + ch = s.scanExponent(ch) + return token.FLOAT + } + + if ch == '.' { + ch = s.scanFraction(ch) + + if ch == 'e' || ch == 'E' { + ch = s.next() + ch = s.scanExponent(ch) + } + return token.FLOAT + } + + if illegalOctal { + s.err("illegal octal number") + } + + if ch != eof { + s.unread() + } + return token.NUMBER + } + + s.scanMantissa(ch) + ch = s.next() // seek forward + if ch == 'e' || ch == 'E' { + ch = s.scanExponent(ch) + return token.FLOAT + } + + if ch == '.' { + ch = s.scanFraction(ch) + if ch == 'e' || ch == 'E' { + ch = s.next() + ch = s.scanExponent(ch) + } + return token.FLOAT + } + + if ch != eof { + s.unread() + } + return token.NUMBER +} + +// scanMantissa scans the mantissa beginning from the rune. It returns the next +// non decimal rune. It's used to determine wheter it's a fraction or exponent. +func (s *Scanner) scanMantissa(ch rune) rune { + scanned := false + for isDecimal(ch) { + ch = s.next() + scanned = true + } + + if scanned && ch != eof { + s.unread() + } + return ch +} + +// scanFraction scans the fraction after the '.' rune +func (s *Scanner) scanFraction(ch rune) rune { + if ch == '.' { + ch = s.peek() // we peek just to see if we can move forward + ch = s.scanMantissa(ch) + } + return ch +} + +// scanExponent scans the remaining parts of an exponent after the 'e' or 'E' +// rune. +func (s *Scanner) scanExponent(ch rune) rune { + if ch == 'e' || ch == 'E' { + ch = s.next() + if ch == '-' || ch == '+' { + ch = s.next() + } + ch = s.scanMantissa(ch) + } + return ch +} + +// scanHeredoc scans a heredoc string +func (s *Scanner) scanHeredoc() { + // Scan the second '<' in example: '<= len(identBytes) && identRegexp.Match(s.src[lineStart:s.srcPos.Offset-s.lastCharLen]) { + break + } + + // Not an anchor match, record the start of a new line + lineStart = s.srcPos.Offset + } + + if ch == eof { + s.err("heredoc not terminated") + return + } + } + + return +} + +// scanString scans a quoted string +func (s *Scanner) scanString() { + braces := 0 + for { + // '"' opening already consumed + // read character after quote + ch := s.next() + + if (ch == '\n' && braces == 0) || ch < 0 || ch == eof { + s.err("literal not terminated") + return + } + + if ch == '"' && braces == 0 { + break + } + + // If we're going into a ${} then we can ignore quotes for awhile + if braces == 0 && ch == '$' && s.peek() == '{' { + braces++ + s.next() + } else if braces > 0 && ch == '{' { + braces++ + } + if braces > 0 && ch == '}' { + braces-- + } + + if ch == '\\' { + s.scanEscape() + } + } + + return +} + +// scanEscape scans an escape sequence +func (s *Scanner) scanEscape() rune { + // http://en.cppreference.com/w/cpp/language/escape + ch := s.next() // read character after '/' + switch ch { + case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': + // nothing to do + case '0', '1', '2', '3', '4', '5', '6', '7': + // octal notation + ch = s.scanDigits(ch, 8, 3) + case 'x': + // hexademical notation + ch = s.scanDigits(s.next(), 16, 2) + case 'u': + // universal character name + ch = s.scanDigits(s.next(), 16, 4) + case 'U': + // universal character name + ch = s.scanDigits(s.next(), 16, 8) + default: + s.err("illegal char escape") + } + return ch +} + +// scanDigits scans a rune with the given base for n times. For example an +// octal notation \184 would yield in scanDigits(ch, 8, 3) +func (s *Scanner) scanDigits(ch rune, base, n int) rune { + start := n + for n > 0 && digitVal(ch) < base { + ch = s.next() + if ch == eof { + // If we see an EOF, we halt any more scanning of digits + // immediately. + break + } + + n-- + } + if n > 0 { + s.err("illegal char escape") + } + + if n != start && ch != eof { + // we scanned all digits, put the last non digit char back, + // only if we read anything at all + s.unread() + } + + return ch +} + +// scanIdentifier scans an identifier and returns the literal string +func (s *Scanner) scanIdentifier() string { + offs := s.srcPos.Offset - s.lastCharLen + ch := s.next() + for isLetter(ch) || isDigit(ch) || ch == '-' || ch == '.' { + ch = s.next() + } + + if ch != eof { + s.unread() // we got identifier, put back latest char + } + + return string(s.src[offs:s.srcPos.Offset]) +} + +// recentPosition returns the position of the character immediately after the +// character or token returned by the last call to Scan. +func (s *Scanner) recentPosition() (pos token.Pos) { + pos.Offset = s.srcPos.Offset - s.lastCharLen + switch { + case s.srcPos.Column > 0: + // common case: last character was not a '\n' + pos.Line = s.srcPos.Line + pos.Column = s.srcPos.Column + case s.lastLineLen > 0: + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + pos.Line = s.srcPos.Line - 1 + pos.Column = s.lastLineLen + default: + // at the beginning of the source + pos.Line = 1 + pos.Column = 1 + } + return +} + +// err prints the error of any scanning to s.Error function. If the function is +// not defined, by default it prints them to os.Stderr +func (s *Scanner) err(msg string) { + s.ErrorCount++ + pos := s.recentPosition() + + if s.Error != nil { + s.Error(pos, msg) + return + } + + fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) +} + +// isHexadecimal returns true if the given rune is a letter +func isLetter(ch rune) bool { + return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) +} + +// isDigit returns true if the given rune is a decimal digit +func isDigit(ch rune) bool { + return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) +} + +// isDecimal returns true if the given rune is a decimal number +func isDecimal(ch rune) bool { + return '0' <= ch && ch <= '9' +} + +// isHexadecimal returns true if the given rune is an hexadecimal number +func isHexadecimal(ch rune) bool { + return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' +} + +// isWhitespace returns true if the rune is a space, tab, newline or carriage return +func isWhitespace(ch rune) bool { + return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' +} + +// digitVal returns the integer value of a given octal,decimal or hexadecimal rune +func digitVal(ch rune) int { + switch { + case '0' <= ch && ch <= '9': + return int(ch - '0') + case 'a' <= ch && ch <= 'f': + return int(ch - 'a' + 10) + case 'A' <= ch && ch <= 'F': + return int(ch - 'A' + 10) + } + return 16 // larger than any legal digit val +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go new file mode 100644 index 0000000000..58d68f5c53 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go @@ -0,0 +1,642 @@ +package scanner + +import ( + "bytes" + "fmt" + "testing" + + "strings" + + "github.com/hashicorp/hcl/hcl/token" +) + +var f100 = strings.Repeat("f", 100) + +type tokenPair struct { + tok token.Type + text string +} + +var tokenLists = map[string][]tokenPair{ + "comment": []tokenPair{ + {token.COMMENT, "//"}, + {token.COMMENT, "////"}, + {token.COMMENT, "// comment"}, + {token.COMMENT, "// /* comment */"}, + {token.COMMENT, "// // comment //"}, + {token.COMMENT, "//" + f100}, + {token.COMMENT, "#"}, + {token.COMMENT, "##"}, + {token.COMMENT, "# comment"}, + {token.COMMENT, "# /* comment */"}, + {token.COMMENT, "# # comment #"}, + {token.COMMENT, "#" + f100}, + {token.COMMENT, "/**/"}, + {token.COMMENT, "/***/"}, + {token.COMMENT, "/* comment */"}, + {token.COMMENT, "/* // comment */"}, + {token.COMMENT, "/* /* comment */"}, + {token.COMMENT, "/*\n comment\n*/"}, + {token.COMMENT, "/*" + f100 + "*/"}, + }, + "operator": []tokenPair{ + {token.LBRACK, "["}, + {token.LBRACE, "{"}, + {token.COMMA, ","}, + {token.PERIOD, "."}, + {token.RBRACK, "]"}, + {token.RBRACE, "}"}, + {token.ASSIGN, "="}, + {token.ADD, "+"}, + {token.SUB, "-"}, + }, + "bool": []tokenPair{ + {token.BOOL, "true"}, + {token.BOOL, "false"}, + }, + "ident": []tokenPair{ + {token.IDENT, "a"}, + {token.IDENT, "a0"}, + {token.IDENT, "foobar"}, + {token.IDENT, "foo-bar"}, + {token.IDENT, "abc123"}, + {token.IDENT, "LGTM"}, + {token.IDENT, "_"}, + {token.IDENT, "_abc123"}, + {token.IDENT, "abc123_"}, + {token.IDENT, "_abc_123_"}, + {token.IDENT, "_äöü"}, + {token.IDENT, "_本"}, + {token.IDENT, "äöü"}, + {token.IDENT, "本"}, + {token.IDENT, "a۰۱۸"}, + {token.IDENT, "foo६४"}, + {token.IDENT, "bar9876"}, + }, + "heredoc": []tokenPair{ + {token.HEREDOC, "< 0 for %q", s.ErrorCount, src) + } +} + +func testTokenList(t *testing.T, tokenList []tokenPair) { + // create artifical source code + buf := new(bytes.Buffer) + for _, ident := range tokenList { + fmt.Fprintf(buf, "%s\n", ident.text) + } + + s := New(buf.Bytes()) + for _, ident := range tokenList { + tok := s.Scan() + if tok.Type != ident.tok { + t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) + } + + if tok.Text != ident.text { + t.Errorf("text = %q want %q", tok.String(), ident.text) + } + + } +} + +func countNewlines(s string) int { + n := 0 + for _, ch := range s { + if ch == '\n' { + n++ + } + } + return n +} + +func TestScanDigitsUnread(t *testing.T) { + cases := []string{ + "M=0\"\\00", + "M=\"\\00", + "\"\\00", + "M=[\"\\00", + "U{\"\\00", + "\"\n{}#\n\"\\00", + "M=[[\"\\00", + "U{d=0\"\\U00", + "#\n\"\\x00", + "m=[[[\"\\00", + } + + for _, c := range cases { + s := New([]byte(c)) + + for { + tok := s.Scan() + if tok.Type == token.EOF { + break + } + t.Logf("s.Scan() = %s", tok) + } + } +} + +func TestScanHeredocRegexpCompile(t *testing.T) { + cases := []string{ + "0\xe1\n<<ȸ\nhello\nworld\nȸ", + } + + for _, c := range cases { + s := New([]byte(c)) + + for { + tok := s.Scan() + if tok.Type == token.EOF { + break + } + t.Logf("s.Scan() = %s", tok) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go new file mode 100644 index 0000000000..5f981eaa2f --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go @@ -0,0 +1,241 @@ +package strconv + +import ( + "errors" + "unicode/utf8" +) + +// ErrSyntax indicates that a value does not have the right syntax for the target type. +var ErrSyntax = errors.New("invalid syntax") + +// Unquote interprets s as a single-quoted, double-quoted, +// or backquoted Go string literal, returning the string value +// that s quotes. (If s is single-quoted, it would be a Go +// character literal; Unquote returns the corresponding +// one-character string.) +func Unquote(s string) (t string, err error) { + n := len(s) + if n < 2 { + return "", ErrSyntax + } + quote := s[0] + if quote != s[n-1] { + return "", ErrSyntax + } + s = s[1 : n-1] + + if quote != '"' { + return "", ErrSyntax + } + if !contains(s, '$') && !contains(s, '{') && contains(s, '\n') { + return "", ErrSyntax + } + + // Is it trivial? Avoid allocation. + if !contains(s, '\\') && !contains(s, quote) && !contains(s, '$') { + switch quote { + case '"': + return s, nil + case '\'': + r, size := utf8.DecodeRuneInString(s) + if size == len(s) && (r != utf8.RuneError || size != 1) { + return s, nil + } + } + } + + var runeTmp [utf8.UTFMax]byte + buf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations. + for len(s) > 0 { + // If we're starting a '${}' then let it through un-unquoted. + // Specifically: we don't unquote any characters within the `${}` + // section. + if s[0] == '$' && len(s) > 1 && s[1] == '{' { + buf = append(buf, '$', '{') + s = s[2:] + + // Continue reading until we find the closing brace, copying as-is + braces := 1 + for len(s) > 0 && braces > 0 { + r, size := utf8.DecodeRuneInString(s) + if r == utf8.RuneError { + return "", ErrSyntax + } + + s = s[size:] + + n := utf8.EncodeRune(runeTmp[:], r) + buf = append(buf, runeTmp[:n]...) + + switch r { + case '{': + braces++ + case '}': + braces-- + } + } + if braces != 0 { + return "", ErrSyntax + } + if len(s) == 0 { + // If there's no string left, we're done! + break + } else { + // If there's more left, we need to pop back up to the top of the loop + // in case there's another interpolation in this string. + continue + } + } + + if s[0] == '\n' { + return "", ErrSyntax + } + + c, multibyte, ss, err := unquoteChar(s, quote) + if err != nil { + return "", err + } + s = ss + if c < utf8.RuneSelf || !multibyte { + buf = append(buf, byte(c)) + } else { + n := utf8.EncodeRune(runeTmp[:], c) + buf = append(buf, runeTmp[:n]...) + } + if quote == '\'' && len(s) != 0 { + // single-quoted must be single character + return "", ErrSyntax + } + } + return string(buf), nil +} + +// contains reports whether the string contains the byte c. +func contains(s string, c byte) bool { + for i := 0; i < len(s); i++ { + if s[i] == c { + return true + } + } + return false +} + +func unhex(b byte) (v rune, ok bool) { + c := rune(b) + switch { + case '0' <= c && c <= '9': + return c - '0', true + case 'a' <= c && c <= 'f': + return c - 'a' + 10, true + case 'A' <= c && c <= 'F': + return c - 'A' + 10, true + } + return +} + +func unquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) { + // easy cases + switch c := s[0]; { + case c == quote && (quote == '\'' || quote == '"'): + err = ErrSyntax + return + case c >= utf8.RuneSelf: + r, size := utf8.DecodeRuneInString(s) + return r, true, s[size:], nil + case c != '\\': + return rune(s[0]), false, s[1:], nil + } + + // hard case: c is backslash + if len(s) <= 1 { + err = ErrSyntax + return + } + c := s[1] + s = s[2:] + + switch c { + case 'a': + value = '\a' + case 'b': + value = '\b' + case 'f': + value = '\f' + case 'n': + value = '\n' + case 'r': + value = '\r' + case 't': + value = '\t' + case 'v': + value = '\v' + case 'x', 'u', 'U': + n := 0 + switch c { + case 'x': + n = 2 + case 'u': + n = 4 + case 'U': + n = 8 + } + var v rune + if len(s) < n { + err = ErrSyntax + return + } + for j := 0; j < n; j++ { + x, ok := unhex(s[j]) + if !ok { + err = ErrSyntax + return + } + v = v<<4 | x + } + s = s[n:] + if c == 'x' { + // single-byte string, possibly not UTF-8 + value = v + break + } + if v > utf8.MaxRune { + err = ErrSyntax + return + } + value = v + multibyte = true + case '0', '1', '2', '3', '4', '5', '6', '7': + v := rune(c) - '0' + if len(s) < 2 { + err = ErrSyntax + return + } + for j := 0; j < 2; j++ { // one digit already; two more + x := rune(s[j]) - '0' + if x < 0 || x > 7 { + err = ErrSyntax + return + } + v = (v << 3) | x + } + s = s[2:] + if v > 255 { + err = ErrSyntax + return + } + value = v + case '\\': + value = '\\' + case '\'', '"': + if c != quote { + err = ErrSyntax + return + } + value = rune(c) + default: + err = ErrSyntax + return + } + tail = s + return +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go new file mode 100644 index 0000000000..65be375d93 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go @@ -0,0 +1,96 @@ +package strconv + +import "testing" + +type quoteTest struct { + in string + out string + ascii string +} + +var quotetests = []quoteTest{ + {"\a\b\f\r\n\t\v", `"\a\b\f\r\n\t\v"`, `"\a\b\f\r\n\t\v"`}, + {"\\", `"\\"`, `"\\"`}, + {"abc\xffdef", `"abc\xffdef"`, `"abc\xffdef"`}, + {"\u263a", `"☺"`, `"\u263a"`}, + {"\U0010ffff", `"\U0010ffff"`, `"\U0010ffff"`}, + {"\x04", `"\x04"`, `"\x04"`}, +} + +type unQuoteTest struct { + in string + out string +} + +var unquotetests = []unQuoteTest{ + {`""`, ""}, + {`"a"`, "a"}, + {`"abc"`, "abc"}, + {`"☺"`, "☺"}, + {`"hello world"`, "hello world"}, + {`"\xFF"`, "\xFF"}, + {`"\377"`, "\377"}, + {`"\u1234"`, "\u1234"}, + {`"\U00010111"`, "\U00010111"}, + {`"\U0001011111"`, "\U0001011111"}, + {`"\a\b\f\n\r\t\v\\\""`, "\a\b\f\n\r\t\v\\\""}, + {`"'"`, "'"}, + {`"${file("foo")}"`, `${file("foo")}`}, + {`"${file("\"foo\"")}"`, `${file("\"foo\"")}`}, + {`"echo ${var.region}${element(split(",",var.zones),0)}"`, + `echo ${var.region}${element(split(",",var.zones),0)}`}, + {`"${HH\\:mm\\:ss}"`, `${HH\\:mm\\:ss}`}, + {`"${\n}"`, `${\n}`}, +} + +var misquoted = []string{ + ``, + `"`, + `"a`, + `"'`, + `b"`, + `"\"`, + `"\9"`, + `"\19"`, + `"\129"`, + `'\'`, + `'\9'`, + `'\19'`, + `'\129'`, + `'ab'`, + `"\x1!"`, + `"\U12345678"`, + `"\z"`, + "`", + "`xxx", + "`\"", + `"\'"`, + `'\"'`, + "\"\n\"", + "\"\\n\n\"", + "'\n'", + `"${"`, + `"${foo{}"`, + "\"${foo}\n\"", +} + +func TestUnquote(t *testing.T) { + for _, tt := range unquotetests { + if out, err := Unquote(tt.in); err != nil || out != tt.out { + t.Errorf("Unquote(%#q) = %q, %v want %q, nil", tt.in, out, err, tt.out) + } + } + + // run the quote tests too, backward + for _, tt := range quotetests { + if in, err := Unquote(tt.out); in != tt.in { + t.Errorf("Unquote(%#q) = %q, %v, want %q, nil", tt.out, in, err, tt.in) + } + } + + for _, s := range misquoted { + if out, err := Unquote(s); out != "" || err != ErrSyntax { + t.Errorf("Unquote(%#q) = %q, %v want %q, %v", s, out, err, "", ErrSyntax) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl new file mode 100644 index 0000000000..78c2675823 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl @@ -0,0 +1,4 @@ +foo = [ + "1", + "2", # comment +] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl new file mode 100644 index 0000000000..eb5a99a694 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl @@ -0,0 +1,6 @@ +resource = [{ + "foo": { + "bar": {}, + "baz": [1, 2, "foo"], + } +}] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl new file mode 100644 index 0000000000..1ff7f29fd2 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl @@ -0,0 +1,15 @@ +// Foo + +/* Bar */ + +/* +/* +Baz +*/ + +# Another + +# Multiple +# Lines + +foo = "bar" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl new file mode 100644 index 0000000000..fec56017dc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl @@ -0,0 +1 @@ +# Hello diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl new file mode 100644 index 0000000000..cccb5b06fc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl @@ -0,0 +1,42 @@ +// This comes from Terraform, as a test +variable "foo" { + default = "bar" + description = "bar" +} + +provider "aws" { + access_key = "foo" + secret_key = "bar" +} + +provider "do" { + api_key = "${var.foo}" +} + +resource "aws_security_group" "firewall" { + count = 5 +} + +resource aws_instance "web" { + ami = "${var.foo}" + security_groups = [ + "foo", + "${aws_security_group.firewall.foo}" + ] + + network_interface { + device_index = 0 + description = "Main network interface" + } +} + +resource "aws_instance" "db" { + security_groups = "${aws_security_group.firewall.*.id}" + VPC = "foo" + + depends_on = ["aws_instance.web"] +} + +output "web_ip" { + value = "${aws_instance.web.private_ip}" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl new file mode 100644 index 0000000000..0007aaf5f7 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl @@ -0,0 +1 @@ +foo.bar = "baz" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl new file mode 100644 index 0000000000..059d4ce65b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl @@ -0,0 +1 @@ +foo = [1, 2, "foo"] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl new file mode 100644 index 0000000000..50f4218ac8 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl @@ -0,0 +1 @@ +foo = [1, 2, "foo",] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl new file mode 100644 index 0000000000..029c54b0ce --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl @@ -0,0 +1,2 @@ +foo = "bar" +key = 7 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl new file mode 100644 index 0000000000..e9f77cae90 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl @@ -0,0 +1,3 @@ +default = { + "eu-west-1": "ami-b1cf19c6", +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl new file mode 100644 index 0000000000..92592fbb3c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl @@ -0,0 +1,5 @@ +// This is a test structure for the lexer +foo bar "baz" { + key = 7 + foo = "bar" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl new file mode 100644 index 0000000000..7229a1f012 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl @@ -0,0 +1,5 @@ +foo { + value = 7 + "value" = 8 + "complex::value" = 9 +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl new file mode 100644 index 0000000000..4d156ddea9 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl @@ -0,0 +1 @@ +resource "foo" "bar" {} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl new file mode 100644 index 0000000000..cf2747ea1a --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl @@ -0,0 +1,7 @@ +foo = "bar" +bar = 7 +baz = [1,2,3] +foo = -12 +bar = 3.14159 +foo = true +bar = false diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go new file mode 100644 index 0000000000..59c1bb72d4 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go @@ -0,0 +1,46 @@ +package token + +import "fmt" + +// Pos describes an arbitrary source position +// including the file, line, and column location. +// A Position is valid if the line number is > 0. +type Pos struct { + Filename string // filename, if any + Offset int // offset, starting at 0 + Line int // line number, starting at 1 + Column int // column number, starting at 1 (character count) +} + +// IsValid returns true if the position is valid. +func (p *Pos) IsValid() bool { return p.Line > 0 } + +// String returns a string in one of several forms: +// +// file:line:column valid position with file name +// line:column valid position without file name +// file invalid position with file name +// - invalid position without file name +func (p Pos) String() string { + s := p.Filename + if p.IsValid() { + if s != "" { + s += ":" + } + s += fmt.Sprintf("%d:%d", p.Line, p.Column) + } + if s == "" { + s = "-" + } + return s +} + +// Before reports whether the position p is before u. +func (p Pos) Before(u Pos) bool { + return u.Offset > p.Offset || u.Line > p.Line +} + +// After reports whether the position p is after u. +func (p Pos) After(u Pos) bool { + return u.Offset < p.Offset || u.Line < p.Line +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go new file mode 100644 index 0000000000..e37c0664ec --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go @@ -0,0 +1,219 @@ +// Package token defines constants representing the lexical tokens for HCL +// (HashiCorp Configuration Language) +package token + +import ( + "fmt" + "strconv" + "strings" + + hclstrconv "github.com/hashicorp/hcl/hcl/strconv" +) + +// Token defines a single HCL token which can be obtained via the Scanner +type Token struct { + Type Type + Pos Pos + Text string + JSON bool +} + +// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) +type Type int + +const ( + // Special tokens + ILLEGAL Type = iota + EOF + COMMENT + + identifier_beg + IDENT // literals + literal_beg + NUMBER // 12345 + FLOAT // 123.45 + BOOL // true,false + STRING // "abc" + HEREDOC // < 0 { + // Pop the current item + n := len(frontier) + item := frontier[n-1] + frontier = frontier[:n-1] + + switch v := item.Val.(type) { + case *ast.ObjectType: + items, frontier = flattenObjectType(v, item, items, frontier) + case *ast.ListType: + items, frontier = flattenListType(v, item, items, frontier) + default: + items = append(items, item) + } + } + + // Reverse the list since the frontier model runs things backwards + for i := len(items)/2 - 1; i >= 0; i-- { + opp := len(items) - 1 - i + items[i], items[opp] = items[opp], items[i] + } + + // Done! Set the original items + list.Items = items + return n, true + }) +} + +func flattenListType( + ot *ast.ListType, + item *ast.ObjectItem, + items []*ast.ObjectItem, + frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { + // If the list is empty, keep the original list + if len(ot.List) == 0 { + items = append(items, item) + return items, frontier + } + + // All the elements of this object must also be objects! + for _, subitem := range ot.List { + if _, ok := subitem.(*ast.ObjectType); !ok { + items = append(items, item) + return items, frontier + } + } + + // Great! We have a match go through all the items and flatten + for _, elem := range ot.List { + // Add it to the frontier so that we can recurse + frontier = append(frontier, &ast.ObjectItem{ + Keys: item.Keys, + Assign: item.Assign, + Val: elem, + LeadComment: item.LeadComment, + LineComment: item.LineComment, + }) + } + + return items, frontier +} + +func flattenObjectType( + ot *ast.ObjectType, + item *ast.ObjectItem, + items []*ast.ObjectItem, + frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { + // If the list has no items we do not have to flatten anything + if ot.List.Items == nil { + items = append(items, item) + return items, frontier + } + + // All the elements of this object must also be objects! + for _, subitem := range ot.List.Items { + if _, ok := subitem.Val.(*ast.ObjectType); !ok { + items = append(items, item) + return items, frontier + } + } + + // Great! We have a match go through all the items and flatten + for _, subitem := range ot.List.Items { + // Copy the new key + keys := make([]*ast.ObjectKey, len(item.Keys)+len(subitem.Keys)) + copy(keys, item.Keys) + copy(keys[len(item.Keys):], subitem.Keys) + + // Add it to the frontier so that we can recurse + frontier = append(frontier, &ast.ObjectItem{ + Keys: keys, + Assign: item.Assign, + Val: subitem.Val, + LeadComment: item.LeadComment, + LineComment: item.LineComment, + }) + } + + return items, frontier +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go new file mode 100644 index 0000000000..125a5f0729 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go @@ -0,0 +1,313 @@ +package parser + +import ( + "errors" + "fmt" + + "github.com/hashicorp/hcl/hcl/ast" + hcltoken "github.com/hashicorp/hcl/hcl/token" + "github.com/hashicorp/hcl/json/scanner" + "github.com/hashicorp/hcl/json/token" +) + +type Parser struct { + sc *scanner.Scanner + + // Last read token + tok token.Token + commaPrev token.Token + + enableTrace bool + indent int + n int // buffer size (max = 1) +} + +func newParser(src []byte) *Parser { + return &Parser{ + sc: scanner.New(src), + } +} + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func Parse(src []byte) (*ast.File, error) { + p := newParser(src) + return p.Parse() +} + +var errEofToken = errors.New("EOF token found") + +// Parse returns the fully parsed source and returns the abstract syntax tree. +func (p *Parser) Parse() (*ast.File, error) { + f := &ast.File{} + var err, scerr error + p.sc.Error = func(pos token.Pos, msg string) { + scerr = fmt.Errorf("%s: %s", pos, msg) + } + + // The root must be an object in JSON + object, err := p.object() + if scerr != nil { + return nil, scerr + } + if err != nil { + return nil, err + } + + // We make our final node an object list so it is more HCL compatible + f.Node = object.List + + // Flatten it, which finds patterns and turns them into more HCL-like + // AST trees. + flattenObjects(f.Node) + + return f, nil +} + +func (p *Parser) objectList() (*ast.ObjectList, error) { + defer un(trace(p, "ParseObjectList")) + node := &ast.ObjectList{} + + for { + n, err := p.objectItem() + if err == errEofToken { + break // we are finished + } + + // we don't return a nil node, because might want to use already + // collected items. + if err != nil { + return node, err + } + + node.Add(n) + + // Check for a followup comma. If it isn't a comma, then we're done + if tok := p.scan(); tok.Type != token.COMMA { + break + } + } + + return node, nil +} + +// objectItem parses a single object item +func (p *Parser) objectItem() (*ast.ObjectItem, error) { + defer un(trace(p, "ParseObjectItem")) + + keys, err := p.objectKey() + if err != nil { + return nil, err + } + + o := &ast.ObjectItem{ + Keys: keys, + } + + switch p.tok.Type { + case token.COLON: + pos := p.tok.Pos + o.Assign = hcltoken.Pos{ + Filename: pos.Filename, + Offset: pos.Offset, + Line: pos.Line, + Column: pos.Column, + } + + o.Val, err = p.objectValue() + if err != nil { + return nil, err + } + } + + return o, nil +} + +// objectKey parses an object key and returns a ObjectKey AST +func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { + keyCount := 0 + keys := make([]*ast.ObjectKey, 0) + + for { + tok := p.scan() + switch tok.Type { + case token.EOF: + return nil, errEofToken + case token.STRING: + keyCount++ + keys = append(keys, &ast.ObjectKey{ + Token: p.tok.HCLToken(), + }) + case token.COLON: + // If we have a zero keycount it means that we never got + // an object key, i.e. `{ :`. This is a syntax error. + if keyCount == 0 { + return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) + } + + // Done + return keys, nil + case token.ILLEGAL: + return nil, errors.New("illegal") + default: + return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) + } + } +} + +// object parses any type of object, such as number, bool, string, object or +// list. +func (p *Parser) objectValue() (ast.Node, error) { + defer un(trace(p, "ParseObjectValue")) + tok := p.scan() + + switch tok.Type { + case token.NUMBER, token.FLOAT, token.BOOL, token.NULL, token.STRING: + return p.literalType() + case token.LBRACE: + return p.objectType() + case token.LBRACK: + return p.listType() + case token.EOF: + return nil, errEofToken + } + + return nil, fmt.Errorf("Expected object value, got unknown token: %+v", tok) +} + +// object parses any type of object, such as number, bool, string, object or +// list. +func (p *Parser) object() (*ast.ObjectType, error) { + defer un(trace(p, "ParseType")) + tok := p.scan() + + switch tok.Type { + case token.LBRACE: + return p.objectType() + case token.EOF: + return nil, errEofToken + } + + return nil, fmt.Errorf("Expected object, got unknown token: %+v", tok) +} + +// objectType parses an object type and returns a ObjectType AST +func (p *Parser) objectType() (*ast.ObjectType, error) { + defer un(trace(p, "ParseObjectType")) + + // we assume that the currently scanned token is a LBRACE + o := &ast.ObjectType{} + + l, err := p.objectList() + + // if we hit RBRACE, we are good to go (means we parsed all Items), if it's + // not a RBRACE, it's an syntax error and we just return it. + if err != nil && p.tok.Type != token.RBRACE { + return nil, err + } + + o.List = l + return o, nil +} + +// listType parses a list type and returns a ListType AST +func (p *Parser) listType() (*ast.ListType, error) { + defer un(trace(p, "ParseListType")) + + // we assume that the currently scanned token is a LBRACK + l := &ast.ListType{} + + for { + tok := p.scan() + switch tok.Type { + case token.NUMBER, token.FLOAT, token.STRING: + node, err := p.literalType() + if err != nil { + return nil, err + } + + l.Add(node) + case token.COMMA: + continue + case token.LBRACE: + node, err := p.objectType() + if err != nil { + return nil, err + } + + l.Add(node) + case token.BOOL: + // TODO(arslan) should we support? not supported by HCL yet + case token.LBRACK: + // TODO(arslan) should we support nested lists? Even though it's + // written in README of HCL, it's not a part of the grammar + // (not defined in parse.y) + case token.RBRACK: + // finished + return l, nil + default: + return nil, fmt.Errorf("unexpected token while parsing list: %s", tok.Type) + } + + } +} + +// literalType parses a literal type and returns a LiteralType AST +func (p *Parser) literalType() (*ast.LiteralType, error) { + defer un(trace(p, "ParseLiteral")) + + return &ast.LiteralType{ + Token: p.tok.HCLToken(), + }, nil +} + +// scan returns the next token from the underlying scanner. If a token has +// been unscanned then read that instead. +func (p *Parser) scan() token.Token { + // If we have a token on the buffer, then return it. + if p.n != 0 { + p.n = 0 + return p.tok + } + + p.tok = p.sc.Scan() + return p.tok +} + +// unscan pushes the previously read token back onto the buffer. +func (p *Parser) unscan() { + p.n = 1 +} + +// ---------------------------------------------------------------------------- +// Parsing support + +func (p *Parser) printTrace(a ...interface{}) { + if !p.enableTrace { + return + } + + const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " + const n = len(dots) + fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) + + i := 2 * p.indent + for i > n { + fmt.Print(dots) + i -= n + } + // i <= n + fmt.Print(dots[0:i]) + fmt.Println(a...) +} + +func trace(p *Parser, msg string) *Parser { + p.printTrace(msg, "(") + p.indent++ + return p +} + +// Usage pattern: defer un(trace(p, "...")) +func un(p *Parser) { + p.indent-- + p.printTrace(")") +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go new file mode 100644 index 0000000000..e0cebf50a8 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go @@ -0,0 +1,384 @@ +package parser + +import ( + "fmt" + "io/ioutil" + "path/filepath" + "reflect" + "runtime" + "testing" + + "github.com/hashicorp/hcl/hcl/ast" + "github.com/hashicorp/hcl/hcl/token" +) + +func TestType(t *testing.T) { + var literals = []struct { + typ token.Type + src string + }{ + {token.STRING, `"foo": "bar"`}, + {token.NUMBER, `"foo": 123`}, + {token.FLOAT, `"foo": 123.12`}, + {token.FLOAT, `"foo": -123.12`}, + {token.BOOL, `"foo": true`}, + {token.STRING, `"foo": null`}, + } + + for _, l := range literals { + t.Logf("Testing: %s", l.src) + + p := newParser([]byte(l.src)) + item, err := p.objectItem() + if err != nil { + t.Error(err) + } + + lit, ok := item.Val.(*ast.LiteralType) + if !ok { + t.Errorf("node should be of type LiteralType, got: %T", item.Val) + } + + if lit.Token.Type != l.typ { + t.Errorf("want: %s, got: %s", l.typ, lit.Token.Type) + } + } +} + +func TestListType(t *testing.T) { + var literals = []struct { + src string + tokens []token.Type + }{ + { + `"foo": ["123", 123]`, + []token.Type{token.STRING, token.NUMBER}, + }, + { + `"foo": [123, "123",]`, + []token.Type{token.NUMBER, token.STRING}, + }, + { + `"foo": []`, + []token.Type{}, + }, + { + `"foo": ["123", 123]`, + []token.Type{token.STRING, token.NUMBER}, + }, + { + `"foo": ["123", {}]`, + []token.Type{token.STRING, token.LBRACE}, + }, + } + + for _, l := range literals { + t.Logf("Testing: %s", l.src) + + p := newParser([]byte(l.src)) + item, err := p.objectItem() + if err != nil { + t.Error(err) + } + + list, ok := item.Val.(*ast.ListType) + if !ok { + t.Errorf("node should be of type LiteralType, got: %T", item.Val) + } + + tokens := []token.Type{} + for _, li := range list.List { + switch v := li.(type) { + case *ast.LiteralType: + tokens = append(tokens, v.Token.Type) + case *ast.ObjectType: + tokens = append(tokens, token.LBRACE) + } + } + + equals(t, l.tokens, tokens) + } +} + +func TestObjectType(t *testing.T) { + var literals = []struct { + src string + nodeType []ast.Node + itemLen int + }{ + { + `"foo": {}`, + nil, + 0, + }, + { + `"foo": { + "bar": "fatih" + }`, + []ast.Node{&ast.LiteralType{}}, + 1, + }, + { + `"foo": { + "bar": "fatih", + "baz": ["arslan"] + }`, + []ast.Node{ + &ast.LiteralType{}, + &ast.ListType{}, + }, + 2, + }, + { + `"foo": { + "bar": {} + }`, + []ast.Node{ + &ast.ObjectType{}, + }, + 1, + }, + { + `"foo": { + "bar": {}, + "foo": true + }`, + []ast.Node{ + &ast.ObjectType{}, + &ast.LiteralType{}, + }, + 2, + }, + } + + for _, l := range literals { + t.Logf("Testing:\n%s\n", l.src) + + p := newParser([]byte(l.src)) + // p.enableTrace = true + item, err := p.objectItem() + if err != nil { + t.Error(err) + } + + // we know that the ObjectKey name is foo for all cases, what matters + // is the object + obj, ok := item.Val.(*ast.ObjectType) + if !ok { + t.Errorf("node should be of type LiteralType, got: %T", item.Val) + } + + // check if the total length of items are correct + equals(t, l.itemLen, len(obj.List.Items)) + + // check if the types are correct + for i, item := range obj.List.Items { + equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) + } + } +} + +func TestFlattenObjects(t *testing.T) { + var literals = []struct { + src string + nodeType []ast.Node + itemLen int + }{ + { + `{ + "foo": [ + { + "foo": "svh", + "bar": "fatih" + } + ] + }`, + []ast.Node{ + &ast.ObjectType{}, + &ast.LiteralType{}, + &ast.LiteralType{}, + }, + 3, + }, + { + `{ + "variable": { + "foo": {} + } + }`, + []ast.Node{ + &ast.ObjectType{}, + }, + 1, + }, + { + `{ + "empty": [] + }`, + []ast.Node{ + &ast.ListType{}, + }, + 1, + }, + { + `{ + "basic": [1, 2, 3] + }`, + []ast.Node{ + &ast.ListType{}, + }, + 1, + }, + } + + for _, l := range literals { + t.Logf("Testing:\n%s\n", l.src) + + f, err := Parse([]byte(l.src)) + if err != nil { + t.Error(err) + } + + // the first object is always an ObjectList so just assert that one + // so we can use it as such + obj, ok := f.Node.(*ast.ObjectList) + if !ok { + t.Errorf("node should be *ast.ObjectList, got: %T", f.Node) + } + + // check if the types are correct + var i int + for _, item := range obj.Items { + equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) + i++ + + if obj, ok := item.Val.(*ast.ObjectType); ok { + for _, item := range obj.List.Items { + equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) + i++ + } + } + } + + // check if the number of items is correct + equals(t, l.itemLen, i) + + } +} + +func TestObjectKey(t *testing.T) { + keys := []struct { + exp []token.Type + src string + }{ + {[]token.Type{token.STRING}, `"foo": {}`}, + } + + for _, k := range keys { + p := newParser([]byte(k.src)) + keys, err := p.objectKey() + if err != nil { + t.Fatal(err) + } + + tokens := []token.Type{} + for _, o := range keys { + tokens = append(tokens, o.Token.Type) + } + + equals(t, k.exp, tokens) + } + + errKeys := []struct { + src string + }{ + {`foo 12 {}`}, + {`foo bar = {}`}, + {`foo []`}, + {`12 {}`}, + } + + for _, k := range errKeys { + p := newParser([]byte(k.src)) + _, err := p.objectKey() + if err == nil { + t.Errorf("case '%s' should give an error", k.src) + } + } +} + +// Official HCL tests +func TestParse(t *testing.T) { + cases := []struct { + Name string + Err bool + }{ + { + "array.json", + false, + }, + { + "basic.json", + false, + }, + { + "object.json", + false, + }, + { + "types.json", + false, + }, + { + "bad_input_128.json", + true, + }, + { + "bad_input_tf_8110.json", + true, + }, + { + "good_input_tf_8110.json", + false, + }, + } + + const fixtureDir = "./test-fixtures" + + for _, tc := range cases { + d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.Name)) + if err != nil { + t.Fatalf("err: %s", err) + } + + _, err = Parse(d) + if (err != nil) != tc.Err { + t.Fatalf("Input: %s\n\nError: %s", tc.Name, err) + } + } +} + +func TestParse_inline(t *testing.T) { + cases := []struct { + Value string + Err bool + }{ + {"{:{", true}, + } + + for _, tc := range cases { + _, err := Parse([]byte(tc.Value)) + if (err != nil) != tc.Err { + t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) + } + } +} + +// equals fails the test if exp is not equal to act. +func equals(tb testing.TB, exp, act interface{}) { + if !reflect.DeepEqual(exp, act) { + _, file, line, _ := runtime.Caller(1) + fmt.Printf("\033[31m%s:%d:\n\n\texp: %s\n\n\tgot: %s\033[39m\n\n", filepath.Base(file), line, exp, act) + tb.FailNow() + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json new file mode 100644 index 0000000000..e320f17ab2 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json @@ -0,0 +1,4 @@ +{ + "foo": [1, 2, "bar"], + "bar": "baz" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json new file mode 100644 index 0000000000..b5f850c963 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json @@ -0,0 +1 @@ +{:{ diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json new file mode 100644 index 0000000000..a04385833d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json @@ -0,0 +1,7 @@ +{ + "variable": { + "poc": { + "default": "${replace("europe-west", "-", " ")}" + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json new file mode 100644 index 0000000000..b54bde96c1 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json new file mode 100644 index 0000000000..f21aa090d5 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json @@ -0,0 +1,7 @@ +{ + "variable": { + "poc": { + "default": "${replace(\"europe-west\", \"-\", \" \")}" + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json new file mode 100644 index 0000000000..72168a3ccb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json @@ -0,0 +1,5 @@ +{ + "foo": { + "bar": [1,2] + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json new file mode 100644 index 0000000000..9a142a6ca6 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json @@ -0,0 +1,10 @@ +{ + "foo": "bar", + "bar": 7, + "baz": [1,2,3], + "foo": -12, + "bar": 3.14159, + "foo": true, + "bar": false, + "foo": null +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go b/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go new file mode 100644 index 0000000000..fe3f0f0950 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go @@ -0,0 +1,451 @@ +package scanner + +import ( + "bytes" + "fmt" + "os" + "unicode" + "unicode/utf8" + + "github.com/hashicorp/hcl/json/token" +) + +// eof represents a marker rune for the end of the reader. +const eof = rune(0) + +// Scanner defines a lexical scanner +type Scanner struct { + buf *bytes.Buffer // Source buffer for advancing and scanning + src []byte // Source buffer for immutable access + + // Source Position + srcPos token.Pos // current position + prevPos token.Pos // previous position, used for peek() method + + lastCharLen int // length of last character in bytes + lastLineLen int // length of last line in characters (for correct column reporting) + + tokStart int // token text start position + tokEnd int // token text end position + + // Error is called for each error encountered. If no Error + // function is set, the error is reported to os.Stderr. + Error func(pos token.Pos, msg string) + + // ErrorCount is incremented by one for each error encountered. + ErrorCount int + + // tokPos is the start position of most recently scanned token; set by + // Scan. The Filename field is always left untouched by the Scanner. If + // an error is reported (via Error) and Position is invalid, the scanner is + // not inside a token. + tokPos token.Pos +} + +// New creates and initializes a new instance of Scanner using src as +// its source content. +func New(src []byte) *Scanner { + // even though we accept a src, we read from a io.Reader compatible type + // (*bytes.Buffer). So in the future we might easily change it to streaming + // read. + b := bytes.NewBuffer(src) + s := &Scanner{ + buf: b, + src: src, + } + + // srcPosition always starts with 1 + s.srcPos.Line = 1 + return s +} + +// next reads the next rune from the bufferred reader. Returns the rune(0) if +// an error occurs (or io.EOF is returned). +func (s *Scanner) next() rune { + ch, size, err := s.buf.ReadRune() + if err != nil { + // advance for error reporting + s.srcPos.Column++ + s.srcPos.Offset += size + s.lastCharLen = size + return eof + } + + if ch == utf8.RuneError && size == 1 { + s.srcPos.Column++ + s.srcPos.Offset += size + s.lastCharLen = size + s.err("illegal UTF-8 encoding") + return ch + } + + // remember last position + s.prevPos = s.srcPos + + s.srcPos.Column++ + s.lastCharLen = size + s.srcPos.Offset += size + + if ch == '\n' { + s.srcPos.Line++ + s.lastLineLen = s.srcPos.Column + s.srcPos.Column = 0 + } + + // debug + // fmt.Printf("ch: %q, offset:column: %d:%d\n", ch, s.srcPos.Offset, s.srcPos.Column) + return ch +} + +// unread unreads the previous read Rune and updates the source position +func (s *Scanner) unread() { + if err := s.buf.UnreadRune(); err != nil { + panic(err) // this is user fault, we should catch it + } + s.srcPos = s.prevPos // put back last position +} + +// peek returns the next rune without advancing the reader. +func (s *Scanner) peek() rune { + peek, _, err := s.buf.ReadRune() + if err != nil { + return eof + } + + s.buf.UnreadRune() + return peek +} + +// Scan scans the next token and returns the token. +func (s *Scanner) Scan() token.Token { + ch := s.next() + + // skip white space + for isWhitespace(ch) { + ch = s.next() + } + + var tok token.Type + + // token text markings + s.tokStart = s.srcPos.Offset - s.lastCharLen + + // token position, initial next() is moving the offset by one(size of rune + // actually), though we are interested with the starting point + s.tokPos.Offset = s.srcPos.Offset - s.lastCharLen + if s.srcPos.Column > 0 { + // common case: last character was not a '\n' + s.tokPos.Line = s.srcPos.Line + s.tokPos.Column = s.srcPos.Column + } else { + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + s.tokPos.Line = s.srcPos.Line - 1 + s.tokPos.Column = s.lastLineLen + } + + switch { + case isLetter(ch): + lit := s.scanIdentifier() + if lit == "true" || lit == "false" { + tok = token.BOOL + } else if lit == "null" { + tok = token.NULL + } else { + s.err("illegal char") + } + case isDecimal(ch): + tok = s.scanNumber(ch) + default: + switch ch { + case eof: + tok = token.EOF + case '"': + tok = token.STRING + s.scanString() + case '.': + tok = token.PERIOD + ch = s.peek() + if isDecimal(ch) { + tok = token.FLOAT + ch = s.scanMantissa(ch) + ch = s.scanExponent(ch) + } + case '[': + tok = token.LBRACK + case ']': + tok = token.RBRACK + case '{': + tok = token.LBRACE + case '}': + tok = token.RBRACE + case ',': + tok = token.COMMA + case ':': + tok = token.COLON + case '-': + if isDecimal(s.peek()) { + ch := s.next() + tok = s.scanNumber(ch) + } else { + s.err("illegal char") + } + default: + s.err("illegal char: " + string(ch)) + } + } + + // finish token ending + s.tokEnd = s.srcPos.Offset + + // create token literal + var tokenText string + if s.tokStart >= 0 { + tokenText = string(s.src[s.tokStart:s.tokEnd]) + } + s.tokStart = s.tokEnd // ensure idempotency of tokenText() call + + return token.Token{ + Type: tok, + Pos: s.tokPos, + Text: tokenText, + } +} + +// scanNumber scans a HCL number definition starting with the given rune +func (s *Scanner) scanNumber(ch rune) token.Type { + zero := ch == '0' + pos := s.srcPos + + s.scanMantissa(ch) + ch = s.next() // seek forward + if ch == 'e' || ch == 'E' { + ch = s.scanExponent(ch) + return token.FLOAT + } + + if ch == '.' { + ch = s.scanFraction(ch) + if ch == 'e' || ch == 'E' { + ch = s.next() + ch = s.scanExponent(ch) + } + return token.FLOAT + } + + if ch != eof { + s.unread() + } + + // If we have a larger number and this is zero, error + if zero && pos != s.srcPos { + s.err("numbers cannot start with 0") + } + + return token.NUMBER +} + +// scanMantissa scans the mantissa beginning from the rune. It returns the next +// non decimal rune. It's used to determine wheter it's a fraction or exponent. +func (s *Scanner) scanMantissa(ch rune) rune { + scanned := false + for isDecimal(ch) { + ch = s.next() + scanned = true + } + + if scanned && ch != eof { + s.unread() + } + return ch +} + +// scanFraction scans the fraction after the '.' rune +func (s *Scanner) scanFraction(ch rune) rune { + if ch == '.' { + ch = s.peek() // we peek just to see if we can move forward + ch = s.scanMantissa(ch) + } + return ch +} + +// scanExponent scans the remaining parts of an exponent after the 'e' or 'E' +// rune. +func (s *Scanner) scanExponent(ch rune) rune { + if ch == 'e' || ch == 'E' { + ch = s.next() + if ch == '-' || ch == '+' { + ch = s.next() + } + ch = s.scanMantissa(ch) + } + return ch +} + +// scanString scans a quoted string +func (s *Scanner) scanString() { + braces := 0 + for { + // '"' opening already consumed + // read character after quote + ch := s.next() + + if ch == '\n' || ch < 0 || ch == eof { + s.err("literal not terminated") + return + } + + if ch == '"' { + break + } + + // If we're going into a ${} then we can ignore quotes for awhile + if braces == 0 && ch == '$' && s.peek() == '{' { + braces++ + s.next() + } else if braces > 0 && ch == '{' { + braces++ + } + if braces > 0 && ch == '}' { + braces-- + } + + if ch == '\\' { + s.scanEscape() + } + } + + return +} + +// scanEscape scans an escape sequence +func (s *Scanner) scanEscape() rune { + // http://en.cppreference.com/w/cpp/language/escape + ch := s.next() // read character after '/' + switch ch { + case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': + // nothing to do + case '0', '1', '2', '3', '4', '5', '6', '7': + // octal notation + ch = s.scanDigits(ch, 8, 3) + case 'x': + // hexademical notation + ch = s.scanDigits(s.next(), 16, 2) + case 'u': + // universal character name + ch = s.scanDigits(s.next(), 16, 4) + case 'U': + // universal character name + ch = s.scanDigits(s.next(), 16, 8) + default: + s.err("illegal char escape") + } + return ch +} + +// scanDigits scans a rune with the given base for n times. For example an +// octal notation \184 would yield in scanDigits(ch, 8, 3) +func (s *Scanner) scanDigits(ch rune, base, n int) rune { + for n > 0 && digitVal(ch) < base { + ch = s.next() + n-- + } + if n > 0 { + s.err("illegal char escape") + } + + // we scanned all digits, put the last non digit char back + s.unread() + return ch +} + +// scanIdentifier scans an identifier and returns the literal string +func (s *Scanner) scanIdentifier() string { + offs := s.srcPos.Offset - s.lastCharLen + ch := s.next() + for isLetter(ch) || isDigit(ch) || ch == '-' { + ch = s.next() + } + + if ch != eof { + s.unread() // we got identifier, put back latest char + } + + return string(s.src[offs:s.srcPos.Offset]) +} + +// recentPosition returns the position of the character immediately after the +// character or token returned by the last call to Scan. +func (s *Scanner) recentPosition() (pos token.Pos) { + pos.Offset = s.srcPos.Offset - s.lastCharLen + switch { + case s.srcPos.Column > 0: + // common case: last character was not a '\n' + pos.Line = s.srcPos.Line + pos.Column = s.srcPos.Column + case s.lastLineLen > 0: + // last character was a '\n' + // (we cannot be at the beginning of the source + // since we have called next() at least once) + pos.Line = s.srcPos.Line - 1 + pos.Column = s.lastLineLen + default: + // at the beginning of the source + pos.Line = 1 + pos.Column = 1 + } + return +} + +// err prints the error of any scanning to s.Error function. If the function is +// not defined, by default it prints them to os.Stderr +func (s *Scanner) err(msg string) { + s.ErrorCount++ + pos := s.recentPosition() + + if s.Error != nil { + s.Error(pos, msg) + return + } + + fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) +} + +// isHexadecimal returns true if the given rune is a letter +func isLetter(ch rune) bool { + return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) +} + +// isHexadecimal returns true if the given rune is a decimal digit +func isDigit(ch rune) bool { + return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) +} + +// isHexadecimal returns true if the given rune is a decimal number +func isDecimal(ch rune) bool { + return '0' <= ch && ch <= '9' +} + +// isHexadecimal returns true if the given rune is an hexadecimal number +func isHexadecimal(ch rune) bool { + return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' +} + +// isWhitespace returns true if the rune is a space, tab, newline or carriage return +func isWhitespace(ch rune) bool { + return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' +} + +// digitVal returns the integer value of a given octal,decimal or hexadecimal rune +func digitVal(ch rune) int { + switch { + case '0' <= ch && ch <= '9': + return int(ch - '0') + case 'a' <= ch && ch <= 'f': + return int(ch - 'a' + 10) + case 'A' <= ch && ch <= 'F': + return int(ch - 'A' + 10) + } + return 16 // larger than any legal digit val +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go b/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go new file mode 100644 index 0000000000..3033a57976 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go @@ -0,0 +1,362 @@ +package scanner + +import ( + "bytes" + "fmt" + "testing" + + "github.com/hashicorp/hcl/json/token" +) + +var f100 = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + +type tokenPair struct { + tok token.Type + text string +} + +var tokenLists = map[string][]tokenPair{ + "operator": []tokenPair{ + {token.LBRACK, "["}, + {token.LBRACE, "{"}, + {token.COMMA, ","}, + {token.PERIOD, "."}, + {token.RBRACK, "]"}, + {token.RBRACE, "}"}, + }, + "bool": []tokenPair{ + {token.BOOL, "true"}, + {token.BOOL, "false"}, + }, + "string": []tokenPair{ + {token.STRING, `" "`}, + {token.STRING, `"a"`}, + {token.STRING, `"本"`}, + {token.STRING, `"${file(\"foo\")}"`}, + {token.STRING, `"\a"`}, + {token.STRING, `"\b"`}, + {token.STRING, `"\f"`}, + {token.STRING, `"\n"`}, + {token.STRING, `"\r"`}, + {token.STRING, `"\t"`}, + {token.STRING, `"\v"`}, + {token.STRING, `"\""`}, + {token.STRING, `"\000"`}, + {token.STRING, `"\777"`}, + {token.STRING, `"\x00"`}, + {token.STRING, `"\xff"`}, + {token.STRING, `"\u0000"`}, + {token.STRING, `"\ufA16"`}, + {token.STRING, `"\U00000000"`}, + {token.STRING, `"\U0000ffAB"`}, + {token.STRING, `"` + f100 + `"`}, + }, + "number": []tokenPair{ + {token.NUMBER, "0"}, + {token.NUMBER, "1"}, + {token.NUMBER, "9"}, + {token.NUMBER, "42"}, + {token.NUMBER, "1234567890"}, + {token.NUMBER, "-0"}, + {token.NUMBER, "-1"}, + {token.NUMBER, "-9"}, + {token.NUMBER, "-42"}, + {token.NUMBER, "-1234567890"}, + }, + "float": []tokenPair{ + {token.FLOAT, "0."}, + {token.FLOAT, "1."}, + {token.FLOAT, "42."}, + {token.FLOAT, "01234567890."}, + {token.FLOAT, ".0"}, + {token.FLOAT, ".1"}, + {token.FLOAT, ".42"}, + {token.FLOAT, ".0123456789"}, + {token.FLOAT, "0.0"}, + {token.FLOAT, "1.0"}, + {token.FLOAT, "42.0"}, + {token.FLOAT, "01234567890.0"}, + {token.FLOAT, "0e0"}, + {token.FLOAT, "1e0"}, + {token.FLOAT, "42e0"}, + {token.FLOAT, "01234567890e0"}, + {token.FLOAT, "0E0"}, + {token.FLOAT, "1E0"}, + {token.FLOAT, "42E0"}, + {token.FLOAT, "01234567890E0"}, + {token.FLOAT, "0e+10"}, + {token.FLOAT, "1e-10"}, + {token.FLOAT, "42e+10"}, + {token.FLOAT, "01234567890e-10"}, + {token.FLOAT, "0E+10"}, + {token.FLOAT, "1E-10"}, + {token.FLOAT, "42E+10"}, + {token.FLOAT, "01234567890E-10"}, + {token.FLOAT, "01.8e0"}, + {token.FLOAT, "1.4e0"}, + {token.FLOAT, "42.2e0"}, + {token.FLOAT, "01234567890.12e0"}, + {token.FLOAT, "0.E0"}, + {token.FLOAT, "1.12E0"}, + {token.FLOAT, "42.123E0"}, + {token.FLOAT, "01234567890.213E0"}, + {token.FLOAT, "0.2e+10"}, + {token.FLOAT, "1.2e-10"}, + {token.FLOAT, "42.54e+10"}, + {token.FLOAT, "01234567890.98e-10"}, + {token.FLOAT, "0.1E+10"}, + {token.FLOAT, "1.1E-10"}, + {token.FLOAT, "42.1E+10"}, + {token.FLOAT, "01234567890.1E-10"}, + {token.FLOAT, "-0.0"}, + {token.FLOAT, "-1.0"}, + {token.FLOAT, "-42.0"}, + {token.FLOAT, "-01234567890.0"}, + {token.FLOAT, "-0e0"}, + {token.FLOAT, "-1e0"}, + {token.FLOAT, "-42e0"}, + {token.FLOAT, "-01234567890e0"}, + {token.FLOAT, "-0E0"}, + {token.FLOAT, "-1E0"}, + {token.FLOAT, "-42E0"}, + {token.FLOAT, "-01234567890E0"}, + {token.FLOAT, "-0e+10"}, + {token.FLOAT, "-1e-10"}, + {token.FLOAT, "-42e+10"}, + {token.FLOAT, "-01234567890e-10"}, + {token.FLOAT, "-0E+10"}, + {token.FLOAT, "-1E-10"}, + {token.FLOAT, "-42E+10"}, + {token.FLOAT, "-01234567890E-10"}, + {token.FLOAT, "-01.8e0"}, + {token.FLOAT, "-1.4e0"}, + {token.FLOAT, "-42.2e0"}, + {token.FLOAT, "-01234567890.12e0"}, + {token.FLOAT, "-0.E0"}, + {token.FLOAT, "-1.12E0"}, + {token.FLOAT, "-42.123E0"}, + {token.FLOAT, "-01234567890.213E0"}, + {token.FLOAT, "-0.2e+10"}, + {token.FLOAT, "-1.2e-10"}, + {token.FLOAT, "-42.54e+10"}, + {token.FLOAT, "-01234567890.98e-10"}, + {token.FLOAT, "-0.1E+10"}, + {token.FLOAT, "-1.1E-10"}, + {token.FLOAT, "-42.1E+10"}, + {token.FLOAT, "-01234567890.1E-10"}, + }, +} + +var orderedTokenLists = []string{ + "comment", + "operator", + "bool", + "string", + "number", + "float", +} + +func TestPosition(t *testing.T) { + // create artifical source code + buf := new(bytes.Buffer) + + for _, listName := range orderedTokenLists { + for _, ident := range tokenLists[listName] { + fmt.Fprintf(buf, "\t\t\t\t%s\n", ident.text) + } + } + + s := New(buf.Bytes()) + + pos := token.Pos{"", 4, 1, 5} + s.Scan() + for _, listName := range orderedTokenLists { + + for _, k := range tokenLists[listName] { + curPos := s.tokPos + // fmt.Printf("[%q] s = %+v:%+v\n", k.text, curPos.Offset, curPos.Column) + + if curPos.Offset != pos.Offset { + t.Fatalf("offset = %d, want %d for %q", curPos.Offset, pos.Offset, k.text) + } + if curPos.Line != pos.Line { + t.Fatalf("line = %d, want %d for %q", curPos.Line, pos.Line, k.text) + } + if curPos.Column != pos.Column { + t.Fatalf("column = %d, want %d for %q", curPos.Column, pos.Column, k.text) + } + pos.Offset += 4 + len(k.text) + 1 // 4 tabs + token bytes + newline + pos.Line += countNewlines(k.text) + 1 // each token is on a new line + + s.Error = func(pos token.Pos, msg string) { + t.Errorf("error %q for %q", msg, k.text) + } + + s.Scan() + } + } + // make sure there were no token-internal errors reported by scanner + if s.ErrorCount != 0 { + t.Errorf("%d errors", s.ErrorCount) + } +} + +func TestComment(t *testing.T) { + testTokenList(t, tokenLists["comment"]) +} + +func TestOperator(t *testing.T) { + testTokenList(t, tokenLists["operator"]) +} + +func TestBool(t *testing.T) { + testTokenList(t, tokenLists["bool"]) +} + +func TestIdent(t *testing.T) { + testTokenList(t, tokenLists["ident"]) +} + +func TestString(t *testing.T) { + testTokenList(t, tokenLists["string"]) +} + +func TestNumber(t *testing.T) { + testTokenList(t, tokenLists["number"]) +} + +func TestFloat(t *testing.T) { + testTokenList(t, tokenLists["float"]) +} + +func TestRealExample(t *testing.T) { + complexReal := ` +{ + "variable": { + "foo": { + "default": "bar", + "description": "bar", + "depends_on": ["something"] + } + } +}` + + literals := []struct { + tokenType token.Type + literal string + }{ + {token.LBRACE, `{`}, + {token.STRING, `"variable"`}, + {token.COLON, `:`}, + {token.LBRACE, `{`}, + {token.STRING, `"foo"`}, + {token.COLON, `:`}, + {token.LBRACE, `{`}, + {token.STRING, `"default"`}, + {token.COLON, `:`}, + {token.STRING, `"bar"`}, + {token.COMMA, `,`}, + {token.STRING, `"description"`}, + {token.COLON, `:`}, + {token.STRING, `"bar"`}, + {token.COMMA, `,`}, + {token.STRING, `"depends_on"`}, + {token.COLON, `:`}, + {token.LBRACK, `[`}, + {token.STRING, `"something"`}, + {token.RBRACK, `]`}, + {token.RBRACE, `}`}, + {token.RBRACE, `}`}, + {token.RBRACE, `}`}, + {token.EOF, ``}, + } + + s := New([]byte(complexReal)) + for _, l := range literals { + tok := s.Scan() + if l.tokenType != tok.Type { + t.Errorf("got: %s want %s for %s\n", tok, l.tokenType, tok.String()) + } + + if l.literal != tok.Text { + t.Errorf("got: %s want %s\n", tok, l.literal) + } + } + +} + +func TestError(t *testing.T) { + testError(t, "\x80", "1:1", "illegal UTF-8 encoding", token.ILLEGAL) + testError(t, "\xff", "1:1", "illegal UTF-8 encoding", token.ILLEGAL) + + testError(t, `"ab`+"\x80", "1:4", "illegal UTF-8 encoding", token.STRING) + testError(t, `"abc`+"\xff", "1:5", "illegal UTF-8 encoding", token.STRING) + + testError(t, `01238`, "1:7", "numbers cannot start with 0", token.NUMBER) + testError(t, `01238123`, "1:10", "numbers cannot start with 0", token.NUMBER) + testError(t, `'aa'`, "1:1", "illegal char: '", token.ILLEGAL) + + testError(t, `"`, "1:2", "literal not terminated", token.STRING) + testError(t, `"abc`, "1:5", "literal not terminated", token.STRING) + testError(t, `"abc`+"\n", "1:5", "literal not terminated", token.STRING) +} + +func testError(t *testing.T, src, pos, msg string, tok token.Type) { + s := New([]byte(src)) + + errorCalled := false + s.Error = func(p token.Pos, m string) { + if !errorCalled { + if pos != p.String() { + t.Errorf("pos = %q, want %q for %q", p, pos, src) + } + + if m != msg { + t.Errorf("msg = %q, want %q for %q", m, msg, src) + } + errorCalled = true + } + } + + tk := s.Scan() + if tk.Type != tok { + t.Errorf("tok = %s, want %s for %q", tk, tok, src) + } + if !errorCalled { + t.Errorf("error handler not called for %q", src) + } + if s.ErrorCount == 0 { + t.Errorf("count = %d, want > 0 for %q", s.ErrorCount, src) + } +} + +func testTokenList(t *testing.T, tokenList []tokenPair) { + // create artifical source code + buf := new(bytes.Buffer) + for _, ident := range tokenList { + fmt.Fprintf(buf, "%s\n", ident.text) + } + + s := New(buf.Bytes()) + for _, ident := range tokenList { + tok := s.Scan() + if tok.Type != ident.tok { + t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) + } + + if tok.Text != ident.text { + t.Errorf("text = %q want %q", tok.String(), ident.text) + } + + } +} + +func countNewlines(s string) int { + n := 0 + for _, ch := range s { + if ch == '\n' { + n++ + } + } + return n +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json new file mode 100644 index 0000000000..e320f17ab2 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json @@ -0,0 +1,4 @@ +{ + "foo": [1, 2, "bar"], + "bar": "baz" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json new file mode 100644 index 0000000000..b54bde96c1 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json new file mode 100644 index 0000000000..72168a3ccb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json @@ -0,0 +1,5 @@ +{ + "foo": { + "bar": [1,2] + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json new file mode 100644 index 0000000000..9a142a6ca6 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json @@ -0,0 +1,10 @@ +{ + "foo": "bar", + "bar": 7, + "baz": [1,2,3], + "foo": -12, + "bar": 3.14159, + "foo": true, + "bar": false, + "foo": null +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go b/test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go new file mode 100644 index 0000000000..59c1bb72d4 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go @@ -0,0 +1,46 @@ +package token + +import "fmt" + +// Pos describes an arbitrary source position +// including the file, line, and column location. +// A Position is valid if the line number is > 0. +type Pos struct { + Filename string // filename, if any + Offset int // offset, starting at 0 + Line int // line number, starting at 1 + Column int // column number, starting at 1 (character count) +} + +// IsValid returns true if the position is valid. +func (p *Pos) IsValid() bool { return p.Line > 0 } + +// String returns a string in one of several forms: +// +// file:line:column valid position with file name +// line:column valid position without file name +// file invalid position with file name +// - invalid position without file name +func (p Pos) String() string { + s := p.Filename + if p.IsValid() { + if s != "" { + s += ":" + } + s += fmt.Sprintf("%d:%d", p.Line, p.Column) + } + if s == "" { + s = "-" + } + return s +} + +// Before reports whether the position p is before u. +func (p Pos) Before(u Pos) bool { + return u.Offset > p.Offset || u.Line > p.Line +} + +// After reports whether the position p is after u. +func (p Pos) After(u Pos) bool { + return u.Offset < p.Offset || u.Line < p.Line +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go b/test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go new file mode 100644 index 0000000000..95a0c3eee6 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go @@ -0,0 +1,118 @@ +package token + +import ( + "fmt" + "strconv" + + hcltoken "github.com/hashicorp/hcl/hcl/token" +) + +// Token defines a single HCL token which can be obtained via the Scanner +type Token struct { + Type Type + Pos Pos + Text string +} + +// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) +type Type int + +const ( + // Special tokens + ILLEGAL Type = iota + EOF + + identifier_beg + literal_beg + NUMBER // 12345 + FLOAT // 123.45 + BOOL // true,false + STRING // "abc" + NULL // null + literal_end + identifier_end + + operator_beg + LBRACK // [ + LBRACE // { + COMMA // , + PERIOD // . + COLON // : + + RBRACK // ] + RBRACE // } + + operator_end +) + +var tokens = [...]string{ + ILLEGAL: "ILLEGAL", + + EOF: "EOF", + + NUMBER: "NUMBER", + FLOAT: "FLOAT", + BOOL: "BOOL", + STRING: "STRING", + NULL: "NULL", + + LBRACK: "LBRACK", + LBRACE: "LBRACE", + COMMA: "COMMA", + PERIOD: "PERIOD", + COLON: "COLON", + + RBRACK: "RBRACK", + RBRACE: "RBRACE", +} + +// String returns the string corresponding to the token tok. +func (t Type) String() string { + s := "" + if 0 <= t && t < Type(len(tokens)) { + s = tokens[t] + } + if s == "" { + s = "token(" + strconv.Itoa(int(t)) + ")" + } + return s +} + +// IsIdentifier returns true for tokens corresponding to identifiers and basic +// type literals; it returns false otherwise. +func (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end } + +// IsLiteral returns true for tokens corresponding to basic type literals; it +// returns false otherwise. +func (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end } + +// IsOperator returns true for tokens corresponding to operators and +// delimiters; it returns false otherwise. +func (t Type) IsOperator() bool { return operator_beg < t && t < operator_end } + +// String returns the token's literal text. Note that this is only +// applicable for certain token types, such as token.IDENT, +// token.STRING, etc.. +func (t Token) String() string { + return fmt.Sprintf("%s %s %s", t.Pos.String(), t.Type.String(), t.Text) +} + +// HCLToken converts this token to an HCL token. +// +// The token type must be a literal type or this will panic. +func (t Token) HCLToken() hcltoken.Token { + switch t.Type { + case BOOL: + return hcltoken.Token{Type: hcltoken.BOOL, Text: t.Text} + case FLOAT: + return hcltoken.Token{Type: hcltoken.FLOAT, Text: t.Text} + case NULL: + return hcltoken.Token{Type: hcltoken.STRING, Text: ""} + case NUMBER: + return hcltoken.Token{Type: hcltoken.NUMBER, Text: t.Text} + case STRING: + return hcltoken.Token{Type: hcltoken.STRING, Text: t.Text, JSON: true} + default: + panic(fmt.Sprintf("unimplemented HCLToken for type: %s", t.Type)) + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go b/test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go new file mode 100644 index 0000000000..a83fdd55bb --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go @@ -0,0 +1,34 @@ +package token + +import ( + "testing" +) + +func TestTypeString(t *testing.T) { + var tokens = []struct { + tt Type + str string + }{ + {ILLEGAL, "ILLEGAL"}, + {EOF, "EOF"}, + {NUMBER, "NUMBER"}, + {FLOAT, "FLOAT"}, + {BOOL, "BOOL"}, + {STRING, "STRING"}, + {NULL, "NULL"}, + {LBRACK, "LBRACK"}, + {LBRACE, "LBRACE"}, + {COMMA, "COMMA"}, + {PERIOD, "PERIOD"}, + {RBRACK, "RBRACK"}, + {RBRACE, "RBRACE"}, + } + + for _, token := range tokens { + if token.tt.String() != token.str { + t.Errorf("want: %q got:%q\n", token.str, token.tt) + + } + } + +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/lex.go b/test/integration/licenses/github.com/hashicorp/hcl/lex.go new file mode 100644 index 0000000000..d9993c2928 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/lex.go @@ -0,0 +1,38 @@ +package hcl + +import ( + "unicode" + "unicode/utf8" +) + +type lexModeValue byte + +const ( + lexModeUnknown lexModeValue = iota + lexModeHcl + lexModeJson +) + +// lexMode returns whether we're going to be parsing in JSON +// mode or HCL mode. +func lexMode(v []byte) lexModeValue { + var ( + r rune + w int + offset int + ) + + for { + r, w = utf8.DecodeRune(v[offset:]) + offset += w + if unicode.IsSpace(r) { + continue + } + if r == '{' { + return lexModeJson + } + break + } + + return lexModeHcl +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/lex_test.go b/test/integration/licenses/github.com/hashicorp/hcl/lex_test.go new file mode 100644 index 0000000000..8062764446 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/lex_test.go @@ -0,0 +1,37 @@ +package hcl + +import ( + "testing" +) + +func TestLexMode(t *testing.T) { + cases := []struct { + Input string + Mode lexModeValue + }{ + { + "", + lexModeHcl, + }, + { + "foo", + lexModeHcl, + }, + { + "{}", + lexModeJson, + }, + { + " {}", + lexModeJson, + }, + } + + for i, tc := range cases { + actual := lexMode([]byte(tc.Input)) + + if actual != tc.Mode { + t.Fatalf("%d: %#v", i, actual) + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/parse.go b/test/integration/licenses/github.com/hashicorp/hcl/parse.go new file mode 100644 index 0000000000..1fca53c4ce --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/parse.go @@ -0,0 +1,39 @@ +package hcl + +import ( + "fmt" + + "github.com/hashicorp/hcl/hcl/ast" + hclParser "github.com/hashicorp/hcl/hcl/parser" + jsonParser "github.com/hashicorp/hcl/json/parser" +) + +// ParseBytes accepts as input byte slice and returns ast tree. +// +// Input can be either JSON or HCL +func ParseBytes(in []byte) (*ast.File, error) { + return parse(in) +} + +// ParseString accepts input as a string and returns ast tree. +func ParseString(input string) (*ast.File, error) { + return parse([]byte(input)) +} + +func parse(in []byte) (*ast.File, error) { + switch lexMode(in) { + case lexModeHcl: + return hclParser.Parse(in) + case lexModeJson: + return jsonParser.Parse(in) + } + + return nil, fmt.Errorf("unknown config format") +} + +// Parse parses the given input and returns the root object. +// +// The input format can be either HCL or JSON. +func Parse(input string) (*ast.File, error) { + return parse([]byte(input)) +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl new file mode 100644 index 0000000000..dd3151cb7d --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl @@ -0,0 +1,5 @@ +resource = [{ + foo = [{ + bar = {} + }] +}] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl new file mode 100644 index 0000000000..9499944872 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl @@ -0,0 +1,2 @@ +foo = "bar" +bar = "${file("bing/bong.txt")}" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json new file mode 100644 index 0000000000..7bdddc84b0 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json @@ -0,0 +1,4 @@ +{ + "foo": "bar", + "bar": "${file(\"bing/bong.txt\")}" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl new file mode 100644 index 0000000000..4e415da20e --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl @@ -0,0 +1 @@ +count = "3" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl new file mode 100644 index 0000000000..363697b496 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl @@ -0,0 +1,3 @@ +foo="bar" +bar="${file("bing/bong.txt")}" +foo-bar="baz" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl new file mode 100644 index 0000000000..ee8b06fe3c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl @@ -0,0 +1,2 @@ +environment = "aws" { +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl new file mode 100644 index 0000000000..5b185cc918 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl @@ -0,0 +1,15 @@ +key "" { + policy = "read" +} + +key "foo/" { + policy = "write" +} + +key "foo/bar/" { + policy = "read" +} + +key "foo/bar/baz" { + policy = "deny" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json new file mode 100644 index 0000000000..151864ee89 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json @@ -0,0 +1,19 @@ +{ + "key": { + "": { + "policy": "read" + }, + + "foo/": { + "policy": "write" + }, + + "foo/bar/": { + "policy": "read" + }, + + "foo/bar/baz": { + "policy": "deny" + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl new file mode 100644 index 0000000000..52dcaa1bc3 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl @@ -0,0 +1,10 @@ +variable "foo" { + default = "bar" + description = "bar" +} + +variable "amis" { + default = { + east = "foo" + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json new file mode 100644 index 0000000000..49f921ed0b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json @@ -0,0 +1,14 @@ +{ + "variable": { + "foo": { + "default": "bar", + "description": "bar" + }, + + "amis": { + "default": { + "east": "foo" + } + } + } +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl new file mode 100644 index 0000000000..5be1b23154 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl @@ -0,0 +1 @@ +resource "foo" {} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl new file mode 100644 index 0000000000..f818b15e02 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl @@ -0,0 +1,6 @@ +foo = "bar\"baz\\n" +bar = "new\nline" +qux = "back\\slash" +qax = "slash\\:colon" +nested = "${HH\\:mm\\:ss}" +nestedquotes = "${"\"stringwrappedinquotes\""}" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl new file mode 100644 index 0000000000..bc337fb7cc --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl @@ -0,0 +1,5 @@ +output { + one = "${replace(var.sub_domain, ".", "\\.")}" + two = "${replace(var.sub_domain, ".", "\\\\.")}" + many = "${replace(var.sub_domain, ".", "\\\\\\\\.")}" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl new file mode 100644 index 0000000000..9bca551f89 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl @@ -0,0 +1,2 @@ +foo = "bar" +Key = 7 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl new file mode 100644 index 0000000000..edf355e38a --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl @@ -0,0 +1,2 @@ +a = 1.02 +b = 2 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json new file mode 100644 index 0000000000..580868043c --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json @@ -0,0 +1,4 @@ +{ + "a": 1.02, + "b": 2 +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl new file mode 100644 index 0000000000000000000000000000000000000000..f691948e1b4238d680e670973bbae039c809e5ca GIT binary patch literal 10 RcmZQ@_Y83kiVO(h0ssw90)YSk literal 0 HcmV?d00001 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json new file mode 100644 index 0000000000..cad0151985 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json @@ -0,0 +1,3 @@ +{ + "default": "${replace(\"europe-west\", \"-\", \" \")}" +} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl new file mode 100644 index 0000000000..8af3458499 --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl @@ -0,0 +1,2 @@ +foo = [["foo"], ["bar"]] + diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl new file mode 100644 index 0000000000..985a33baee --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl @@ -0,0 +1,4 @@ +foo = [ + {somekey1 = "someval1"}, + {somekey2 = "someval2", someextrakey = "someextraval"}, +] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl new file mode 100644 index 0000000000..f883bd707b --- /dev/null +++ b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl @@ -0,0 +1,4 @@ +foo = < + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/test/integration/licenses/github.com/juju/clock/Makefile b/test/integration/licenses/github.com/juju/clock/Makefile new file mode 100644 index 0000000000..900ccf7573 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/Makefile @@ -0,0 +1,20 @@ +PROJECT := github.com/juju/clock + +.PHONY: check-licence check-go check + +check: check-licence check-go + go test $(PROJECT)/... + +check-licence: + @(fgrep -rl "Licensed under the LGPLv3" --exclude *.s .;\ + fgrep -rl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" --exclude *.s .;\ + find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ + xargs -I {} echo FAIL: licence missed: {} + +check-go: + $(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g"))) + @(if [ x$(GOFMT) != x"" ]; then \ + echo go fmt is sad: $(GOFMT); \ + exit 1; \ + fi ) + @(go vet -all -composites=false -copylocks=false .) diff --git a/test/integration/licenses/github.com/juju/clock/README.md b/test/integration/licenses/github.com/juju/clock/README.md new file mode 100644 index 0000000000..a5ac464d31 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/README.md @@ -0,0 +1,7 @@ +# clock + +An interface definition for a fully defined clock. + +An WallClock implementation of that interface using the time package. + +A testing clock. diff --git a/test/integration/licenses/github.com/juju/clock/clock.go b/test/integration/licenses/github.com/juju/clock/clock.go new file mode 100644 index 0000000000..59a511d053 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/clock.go @@ -0,0 +1,53 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package clock + +import "time" + +// Clock provides an interface for dealing with clocks. +type Clock interface { + // Now returns the current clock time. + Now() time.Time + + // After waits for the duration to elapse and then sends the + // current time on the returned channel. + After(time.Duration) <-chan time.Time + + // AfterFunc waits for the duration to elapse and then calls f in its own goroutine. + // It returns a Timer that can be used to cancel the call using its Stop method. + AfterFunc(d time.Duration, f func()) Timer + + // NewTimer creates a new Timer that will send the current time + // on its channel after at least duration d. + NewTimer(d time.Duration) Timer +} + +// Alarm returns a channel that will have the time sent on it at some point +// after the supplied time occurs. +// +// This is short for c.After(t.Sub(c.Now())). +func Alarm(c Clock, t time.Time) <-chan time.Time { + return c.After(t.Sub(c.Now())) +} + +// The Timer type represents a single event. +// A Timer must be created with AfterFunc. +// This interface follows time.Timer's methods but provides easier mocking. +type Timer interface { + // When the Timer expires, the current time will be sent on the + // channel returned from Chan, unless the Timer was created by + // AfterFunc. + Chan() <-chan time.Time + + // Reset changes the timer to expire after duration d. + // It returns true if the timer had been active, false if + // the timer had expired or been stopped. + Reset(time.Duration) bool + + // Stop prevents the Timer from firing. It returns true if + // the call stops the timer, false if the timer has already expired or been stopped. + // Stop does not close the channel, to prevent a read + // from the channel succeeding incorrectly. + Stop() bool +} diff --git a/test/integration/licenses/github.com/juju/clock/go.mod b/test/integration/licenses/github.com/juju/clock/go.mod new file mode 100644 index 0000000000..eebad3ac8c --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/go.mod @@ -0,0 +1,23 @@ +module github.com/juju/clock + +go 1.18 + +require ( + github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 + github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 + github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c +) + +require ( + github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 // indirect + github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 // indirect + github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect + github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a // indirect + github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 // indirect + github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect + golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect + golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) diff --git a/test/integration/licenses/github.com/juju/clock/go.sum b/test/integration/licenses/github.com/juju/clock/go.sum new file mode 100644 index 0000000000..3541c1ac0a --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/go.sum @@ -0,0 +1,87 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= +github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= +github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= +github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= +github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 h1:4R626WTwa7pRYQFiIRLVPepMhm05eZMEx+wIurRnMLc= +github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= +github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 h1:EJHbsNpQyupmMeWTq7inn+5L/WZ7JfzCVPJ+DP9McCQ= +github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9/go.mod h1:TRm7EVGA3mQOqSVcBySRY7a9Y1/gyVhh/WTCnc5sD4U= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= +github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 h1:NO5tuyw++EGLnz56Q8KMyDZRwJwWO8jQnj285J3FOmY= +github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= +github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= +github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= +github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= +github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU= +github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= +github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 h1:XEDzpuZb8Ma7vLja3+5hzUqVTvAqm5Y+ygvnDs5iTMM= +github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494/go.mod h1:rUquetT0ALL48LHZhyRGvjjBH8xZaZ8dFClulKK5wK4= +github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= +github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= +github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= +github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a h1:5ZWDCeCF0RaITrZGemzmDFIhjR/MVSvBUqgSyaeTMbE= +github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= +github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 h1:wtEPbidt1VyHlb8RSztU6ySQj29FLsOQiI9XiJhXDM4= +github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23/go.mod h1:Ljlbryh9sYaUSGXucslAEDf0A2XUSGvDbHJgW8ps6nc= +github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= +github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= +github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= +github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= +github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +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/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= +gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= +gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= +gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +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= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= +launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= diff --git a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go new file mode 100644 index 0000000000..6941ed4557 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go @@ -0,0 +1,22 @@ +// Copyright 2017 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package monotonic + +import ( + "time" + _ "unsafe" +) + +//go:noescape +//go:linkname nanotime runtime.nanotime +func nanotime() int64 + +// Now returns the current time in nanoseconds from a monotonic clock. +// +// The result is guaranteed to not jump due to NTP or other changes to +// system time, which may jump forward or backwards. Instead, in response to +// such changes, the clock frequency is adjusted slowly. +func Now() time.Duration { + return time.Duration(nanotime()) +} diff --git a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s new file mode 100644 index 0000000000..6f9f4945f1 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s @@ -0,0 +1,4 @@ +// Copyright 2017 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +// Deliberately empty - see https://github.com/golang/go/issues/15006 diff --git a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go new file mode 100644 index 0000000000..b57fe4298b --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go @@ -0,0 +1,33 @@ +// Copyright 2017 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package monotonic_test + +import ( + "testing" + "time" + + gc "gopkg.in/check.v1" + + "github.com/juju/clock/monotonic" +) + +func TestPackage(t *testing.T) { + gc.TestingT(t) +} + +type MonotonicSuite struct { +} + +var _ = gc.Suite(&MonotonicSuite{}) + +func (s *MonotonicSuite) TestNow(c *gc.C) { + var prev time.Duration + for i := 0; i < 1000; i++ { + val := monotonic.Now() + if val < prev { + c.Fatal("now is less than previous value") + } + prev = val + } +} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/clock.go b/test/integration/licenses/github.com/juju/clock/testclock/clock.go new file mode 100644 index 0000000000..dfa95aa258 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/testclock/clock.go @@ -0,0 +1,274 @@ +// Copyright 2015-2018 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package testclock + +import ( + "fmt" + "runtime/debug" + "sort" + "sync" + "time" + + "github.com/juju/clock" + "github.com/juju/errors" + "github.com/juju/loggo" +) + +// timer implements a mock clock.Timer for testing purposes. +type timer struct { + deadline time.Time + clock *Clock + c chan time.Time + // trigger is called when the timer expires. It is + // called with the clock mutex held and will not block. + trigger func() + stack []byte +} + +// Reset is part of the clock.Timer interface. +func (t *timer) Reset(d time.Duration) bool { + return t.clock.reset(t, d) +} + +// Stop is part of the clock.Timer interface. +func (t *timer) Stop() bool { + return t.clock.stop(t) +} + +// Chan is part of the clock.Timer interface. +func (t *timer) Chan() <-chan time.Time { + return t.c +} + +// Clock implements a mock clock.Clock for testing purposes. +type Clock struct { + mu sync.Mutex + now time.Time + waiting []*timer // timers waiting to fire, sorted by deadline. + notifyAlarms chan struct{} +} + +var _ AdvanceableClock = (*Clock)(nil) + +// NewClock returns a new clock set to the supplied time. If your SUT needs to +// call After, AfterFunc, NewTimer or Timer.Reset more than 10000 times: (1) +// you have probably written a bad test; and (2) you'll need to read from the +// Alarms chan to keep the buffer clear. +func NewClock(now time.Time) *Clock { + return &Clock{ + now: now, + notifyAlarms: make(chan struct{}, 10000), + } +} + +// Now is part of the clock.Clock interface. +func (clock *Clock) Now() time.Time { + clock.mu.Lock() + defer clock.mu.Unlock() + return clock.now +} + +// After is part of the clock.Clock interface. +func (clock *Clock) After(d time.Duration) <-chan time.Time { + return clock.NewTimer(d).Chan() +} + +func (clock *Clock) NewTimer(d time.Duration) clock.Timer { + c := make(chan time.Time, 1) + return clock.addAlarm(d, c, func() { + c <- clock.now + }) +} + +// AfterFunc is part of the clock.Clock interface. +func (clock *Clock) AfterFunc(d time.Duration, f func()) clock.Timer { + return clock.addAlarm(d, nil, func() { + go f() + }) +} + +func (clock *Clock) addAlarm(d time.Duration, c chan time.Time, trigger func()) *timer { + defer clock.notifyAlarm() + clock.mu.Lock() + defer clock.mu.Unlock() + t := &timer{ + c: c, + deadline: clock.now.Add(d), + clock: clock, + trigger: trigger, + stack: debug.Stack(), + } + clock.addTimer(t) + clock.triggerAll() + return t +} + +// Advance advances the result of Now by the supplied duration, and sends +// the "current" time on all alarms which are no longer "in the future". +func (clock *Clock) Advance(d time.Duration) { + clock.mu.Lock() + defer clock.mu.Unlock() + clock.now = clock.now.Add(d) + if len(clock.waiting) == 0 { + loggo.GetLogger("juju.clock").Debugf("advancing a clock that has nothing waiting: cf. https://github.com/juju/juju/wiki/Intermittent-failures") + } + clock.triggerAll() +} + +// WaitAdvance functions the same as Advance, but only if there is n timers in +// clock.waiting. This came about while fixing lp:1607044 intermittent +// failures. It turns out that testing.Clock.Advance might advance the time +// and trigger notifications before triggers are set. So we wait a limited time +// 'w' for 'n' timers to show up in clock.waiting, and if they do we advance +// 'd'. +func (clock *Clock) WaitAdvance(d, w time.Duration, n int) error { + pause := w / 10 + if pause > 10*time.Millisecond { + pause = 10 * time.Millisecond + } + finalTimeout := time.After(w) + next := time.After(0) + for { + select { + case <-finalTimeout: + if clock.hasNWaiters(n) { + clock.Advance(d) + return nil + } + clock.mu.Lock() + got := len(clock.waiting) + var stacks string + for _, t := range clock.waiting { + stacks += fmt.Sprintf("timer deadline: %v\n%s", t.deadline, string(t.stack)) + } + clock.mu.Unlock() + return errors.Errorf( + "got %d timers added after waiting %s: wanted %d, stacks:\n%s", + got, w.String(), n, stacks) + case <-next: + if clock.hasNWaiters(n) { + clock.Advance(d) + return nil + } + next = time.After(pause) + } + } +} + +// hasNWaiters checks if the clock currently has 'n' timers waiting to fire. +func (clock *Clock) hasNWaiters(n int) bool { + clock.mu.Lock() + hasWaiters := len(clock.waiting) == n + clock.mu.Unlock() + return hasWaiters +} + +// Alarms returns a channel on which you can read one value for every call to +// After and AfterFunc; and for every successful Timer.Reset backed by this +// Clock. It might not be elegant but it's necessary when testing time logic +// that runs on a goroutine other than that of the test. +func (clock *Clock) Alarms() <-chan struct{} { + return clock.notifyAlarms +} + +// triggerAll triggers any alarms that are currently due and removes them +// from clock.waiting. +func (clock *Clock) triggerAll() { + triggered := 0 + for _, t := range clock.waiting { + if clock.now.Before(t.deadline) { + break + } + t.trigger() + triggered++ + } + clock.waiting = clock.waiting[triggered:] +} + +// reset is the underlying implementation of clock.Timer.Reset, which may be +// called by any Timer backed by this Clock. +func (clock *Clock) reset(t *timer, d time.Duration) bool { + defer clock.notifyAlarm() + clock.mu.Lock() + defer clock.mu.Unlock() + + found := false + for _, wt := range clock.waiting { + if wt == t { + found = true + } + } + if !found { + clock.waiting = append(clock.waiting, t) + } + t.deadline = clock.now.Add(d) + sort.Sort(byDeadline(clock.waiting)) + if d <= 0 { + // If duration is <= 0, that means we should be triggering the + // Timer right away, as "now" has already occured. + clock.triggerAll() + } + return found +} + +// stop is the underlying implementation of clock.Timer.Reset, which may be +// called by any Timer backed by this Clock. +func (clock *Clock) stop(t *timer) bool { + clock.mu.Lock() + defer clock.mu.Unlock() + + for i, wt := range clock.waiting { + if wt == t { + clock.waiting = removeFromSlice(clock.waiting, i) + return true + } + } + return false +} + +// addTimer adds an alarm at time t. +func (clock *Clock) addTimer(t *timer) { + clock.waiting = append(clock.waiting, t) + sort.Sort(byDeadline(clock.waiting)) +} + +// notifyAlarm sends a value on the channel exposed by Alarms(). +func (clock *Clock) notifyAlarm() { + select { + case clock.notifyAlarms <- struct{}{}: + default: + panic("alarm notification buffer full") + } +} + +// byDeadline is used to sort alarms by time. +type byDeadline []*timer + +func (a byDeadline) Len() int { return len(a) } +func (a byDeadline) Less(i, j int) bool { return a[i].deadline.Before(a[j].deadline) } +func (a byDeadline) Swap(i, j int) { a[i], a[j] = a[j], a[i] } + +// removeFromSlice removes item at the specified index from the slice. +func removeFromSlice(sl []*timer, index int) []*timer { + return append(sl[:index], sl[index+1:]...) +} + +// AutoAdvancingClock wraps a clock.Clock, calling the Advance +// function whenever After or AfterFunc are called. +type AutoAdvancingClock struct { + clock.Clock + Advance func(time.Duration) +} + +func (c *AutoAdvancingClock) After(d time.Duration) <-chan time.Time { + ch := c.Clock.After(d) + c.Advance(d) + return ch +} + +func (c *AutoAdvancingClock) AfterFunc(d time.Duration, f func()) clock.Timer { + t := c.Clock.AfterFunc(d, f) + c.Advance(d) + return t +} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/clock_test.go b/test/integration/licenses/github.com/juju/clock/testclock/clock_test.go new file mode 100644 index 0000000000..df453b8655 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/testclock/clock_test.go @@ -0,0 +1,325 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package testclock_test + +import ( + "sync" + "time" + + "github.com/juju/loggo" + "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/clock/testclock" +) + +type clockSuite struct { + testing.LoggingSuite +} + +var _ = gc.Suite(&clockSuite{}) + +func (*clockSuite) TestNow(c *gc.C) { + t0 := time.Now() + cl := testclock.NewClock(t0) + c.Assert(cl.Now(), gc.Equals, t0) +} + +func (*clockSuite) TestAdvanceLogs(c *gc.C) { + loggo.GetLogger("juju.clock").SetLogLevel(loggo.DEBUG) + t0 := time.Now() + cl := testclock.NewClock(t0) + + // Shouldn't log anything. + t := cl.After(time.Second) + cl.Advance(time.Minute) + <-t + c.Check(c.GetTestLog(), jc.DeepEquals, "") + + // Should log since nothing's waiting. + cl.Advance(time.Hour) + c.Check(c.GetTestLog(), jc.Contains, "advancing a clock that has nothing waiting: cf. https://github.com/juju/juju/wiki/Intermittent-failures") +} + +func (*clockSuite) TestWaitAdvance(c *gc.C) { + t0 := time.Now() + cl := testclock.NewClock(t0) + + // It is legal to just say 'nothing is waiting' + err := cl.WaitAdvance(0, 0, 0) + c.Check(err, jc.ErrorIsNil) + + // Test that no timers errors out. + err = cl.WaitAdvance(time.Millisecond, 10*time.Millisecond, 1) + c.Check(err, gc.ErrorMatches, "got 0 timers added after waiting 10ms: wanted 1, stacks:\n") + + // Test that a timer doesn't error. + _ = cl.After(time.Nanosecond) + err = cl.WaitAdvance(time.Millisecond, 10*time.Millisecond, 1) + c.Check(err, jc.ErrorIsNil) +} + +func (*clockSuite) TestAdvanceWithAfter(c *gc.C) { + t0 := time.Now() + cl := testclock.NewClock(t0) + ch := cl.After(time.Second) + select { + case <-ch: + c.Fatalf("received unexpected event") + case <-time.After(shortWait): + } + + cl.Advance(time.Second - 1) + + select { + case <-ch: + c.Fatalf("received unexpected event") + case <-time.After(shortWait): + } + + cl.Advance(1) + + select { + case <-ch: + case <-time.After(longWait): + c.Fatalf("expected event to be triggered") + } + + cl.Advance(time.Second) + select { + case <-ch: + c.Fatalf("received unexpected event") + case <-time.After(shortWait): + } + + // Test that we can do it again + ch = cl.After(time.Second) + cl.Advance(2 * time.Second) + select { + case <-ch: + case <-time.After(longWait): + c.Fatalf("expected event to be triggered") + } + c.Assert(cl.Now().UTC(), gc.Equals, t0.Add(4*time.Second).UTC()) +} + +func (*clockSuite) TestAdvanceWithAfterFunc(c *gc.C) { + // Most of the details have been checked in TestAdvanceWithAfter, + // so just check that AfterFunc is wired up correctly. + t0 := time.Now() + cl := testclock.NewClock(t0) + fired := make(chan struct{}) + cl.AfterFunc(time.Second, func() { + close(fired) + }) + cl.Advance(2 * time.Second) + select { + case <-fired: + case <-time.After(longWait): + c.Fatalf("expected event to be triggered") + } +} + +func (*clockSuite) TestAfterFuncStop(c *gc.C) { + t0 := time.Now() + cl := testclock.NewClock(t0) + fired := make(chan struct{}) + timer := cl.AfterFunc(time.Second, func() { + close(fired) + }) + cl.Advance(50 * time.Millisecond) + timer.Stop() + select { + case <-fired: + c.Fatalf("received unexpected event") + case <-time.After(shortWait): + } +} + +func (*clockSuite) TestNewTimerReset(c *gc.C) { + t0 := time.Now() + cl := testclock.NewClock(t0) + timer := cl.NewTimer(time.Second) + cl.Advance(time.Second) + select { + case t := <-timer.Chan(): + c.Assert(t.UTC(), gc.Equals, t0.Add(time.Second).UTC()) + case <-time.After(longWait): + c.Fatalf("expected event to be triggered") + } + + timer.Reset(50 * time.Millisecond) + cl.Advance(100 * time.Millisecond) + select { + case t := <-timer.Chan(): + c.Assert(t.UTC(), gc.Equals, t0.Add(time.Second+100*time.Millisecond).UTC()) + case <-time.After(longWait): + c.Fatalf("expected event to be triggered") + } +} + +func (*clockSuite) TestNewTimerAsyncReset(c *gc.C) { + t0 := time.Now() + clock := testclock.NewClock(t0) + timer := clock.NewTimer(time.Hour) + stop := make(chan struct{}) + stopped := make(chan struct{}) + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + select { + case <-stop: + case t := <-timer.Chan(): + c.Errorf("timer accidentally ticked at: %v", t) + case <-time.After(longWait): + c.Errorf("test took too long") + } + close(stopped) + }() + // Just our goroutine, but we don't go so far as to trigger the wakeup. + clock.WaitAdvance(1*time.Minute, 10*time.Millisecond, 1) + // Reset shouldn't trigger a wakeup, just move when it thinks it will wake up. + timer.Reset(time.Hour) + clock.WaitAdvance(1*time.Minute, 10*time.Millisecond, 1) + timer.Reset(time.Minute) + clock.WaitAdvance(30*time.Second, 10*time.Millisecond, 1) + // Now tell the goroutine to stop and start another one that *does* want to + // wake up + close(stop) + select { + case <-stopped: + case <-time.After(longWait): + c.Errorf("goroutine failed to stop") + } + wg.Add(1) + go func() { + defer wg.Done() + select { + case t := <-timer.Chan(): + c.Logf("timer successfully ticked: %v", t) + case <-time.After(longWait): + c.Errorf("timer took too long") + } + }() + // And advance the clock long enough to cause it to notice + clock.WaitAdvance(30*time.Second, 10*time.Millisecond, 1) + wg.Wait() +} + +func (*clockSuite) TestNewTimerResetCausesWakeup(c *gc.C) { + t0 := time.Now() + clock := testclock.NewClock(t0) + timer1 := clock.NewTimer(time.Hour) + timer2 := clock.NewTimer(time.Hour) + timer3 := clock.NewTimer(time.Hour) + var wg sync.WaitGroup + wg.Add(1) + go func() { + defer wg.Done() + select { + case t := <-timer1.Chan(): + c.Check(t0, gc.Equals, t) + case <-time.After(longWait): + c.Errorf("timer1 took too long to wake up") + } + }() + wg.Add(1) + go func() { + defer wg.Done() + select { + case <-timer2.Chan(): + c.Errorf("timer2 should not wake up") + case <-time.After(shortWait): + c.Logf("timer2 succesfully slept for 50ms") + } + }() + wg.Add(1) + go func() { + defer wg.Done() + select { + case t := <-timer3.Chan(): + // Even though the reset was negative, it triggers at 'now' + c.Check(t0, gc.Equals, t) + case <-time.After(longWait): + c.Errorf("timer3 took too long to wake up") + } + }() + // Reseting the timer to a time <= 0 should cause it to wake up on its + // own, without needing an Advance or WaitAdvance to be done + timer1.Reset(0) + timer3.Reset(-1 * time.Second) + wg.Wait() +} + +func (*clockSuite) TestMultipleWaiters(c *gc.C) { + var wg sync.WaitGroup + t0 := time.Date(2000, 01, 01, 01, 0, 0, 0, time.UTC) + cl := testclock.NewClock(t0) + + total := 0 + start := func(f func()) { + total++ + wg.Add(1) + go func() { + defer wg.Done() + f() + }() + } + start(func() { + <-cl.After(50 * time.Millisecond) + }) + start(func() { + ch := make(chan struct{}) + cl.AfterFunc(100*time.Millisecond, func() { + close(ch) + }) + <-ch + }) + start(func() { + timer := cl.NewTimer(150 * time.Millisecond) + <-timer.Chan() + timer.Reset(50 * time.Millisecond) + <-timer.Chan() + }) + + done := make(chan struct{}) + go func() { + wg.Wait() + close(done) + }() + + // Wait for all the alarms to be waited on. + for i := 0; i < total; i++ { + select { + case <-cl.Alarms(): + case <-time.After(longWait): + c.Fatalf("expected a notification on the alarms channel") + } + } + select { + case <-cl.Alarms(): + c.Fatalf("unexpected extra notification on alarms channel") + case <-time.After(shortWait): + } + + cl.Advance(150 * time.Millisecond) + + // Wait for the extra notification after reset. + select { + case <-cl.Alarms(): + case <-time.After(longWait): + c.Fatalf("expected a notification on the alarms channel") + } + + cl.Advance(50 * time.Millisecond) + + select { + case <-done: + case <-time.After(longWait): + c.Fatalf("expected all waits to complete") + } + +} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/dilated.go b/test/integration/licenses/github.com/juju/clock/testclock/dilated.go new file mode 100644 index 0000000000..4333b11f77 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/testclock/dilated.go @@ -0,0 +1,221 @@ +// Copyright 2022 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package testclock + +import ( + "sync" + "sync/atomic" + "time" + + "github.com/juju/clock" +) + +// NewDilatedWallClock returns a clock that can be sped up or slowed down. +// realSecondDuration is the real duration of a second. +func NewDilatedWallClock(realSecondDuration time.Duration) AdvanceableClock { + dc := &dilationClock{ + epoch: time.Now(), + realSecondDuration: realSecondDuration, + offsetChanged: make(chan any), + } + dc.offsetChangedCond = sync.NewCond(dc.offsetChangedMutex.RLocker()) + return dc +} + +type dilationClock struct { + epoch time.Time + realSecondDuration time.Duration + + // offsetAtomic is the current dilated offset to allow for time jumps/advances. + offsetAtomic int64 + // offsetChanged is a channel that is closed when timers need to be signaled + // that there is a offset change coming. + offsetChanged chan any + // offsetChangedMutex is a mutex protecting the offsetChanged and is used by + // the offsetChangedCond. + offsetChangedMutex sync.RWMutex + // offsetChangedCond is used to signal timers that they may try to pull the new + // offset. + offsetChangedCond *sync.Cond +} + +// Now is part of the Clock interface. +func (dc *dilationClock) Now() time.Time { + dt, _ := dc.nowWithOffset() + return dt +} + +func (dc *dilationClock) nowWithOffset() (time.Time, time.Duration) { + offset := time.Duration(atomic.LoadInt64(&dc.offsetAtomic)) + realNow := time.Now() + dt := dilateTime(dc.epoch, realNow, dc.realSecondDuration, offset) + return dt, offset +} + +// After implements Clock.After +func (dc *dilationClock) After(d time.Duration) <-chan time.Time { + t := newDilatedWallTimer(dc, d, nil) + return t.c +} + +// AfterFunc implements Clock.AfterFunc +func (dc *dilationClock) AfterFunc(d time.Duration, f func()) clock.Timer { + return newDilatedWallTimer(dc, d, f) +} + +// NewTimer implements Clock.NewTimer +func (dc *dilationClock) NewTimer(d time.Duration) clock.Timer { + return newDilatedWallTimer(dc, d, nil) +} + +// Advance implements AdvanceableClock.Advance +func (dc *dilationClock) Advance(d time.Duration) { + close(dc.offsetChanged) + dc.offsetChangedMutex.Lock() + dc.offsetChanged = make(chan any) + atomic.AddInt64(&dc.offsetAtomic, int64(d)) + dc.offsetChangedCond.Broadcast() + dc.offsetChangedMutex.Unlock() +} + +// dilatedWallTimer implements the Timer interface. +type dilatedWallTimer struct { + timer *time.Timer + dc *dilationClock + c chan time.Time + target time.Time + offset time.Duration + after func() + done chan any + resetChan chan resetReq + resetMutex sync.Mutex + stopChan chan chan bool +} + +type resetReq struct { + d time.Duration + r chan bool +} + +func newDilatedWallTimer(dc *dilationClock, d time.Duration, after func()) *dilatedWallTimer { + t := &dilatedWallTimer{ + dc: dc, + c: make(chan time.Time), + resetChan: make(chan resetReq), + stopChan: make(chan chan bool), + } + t.start(d, after) + return t +} + +func (t *dilatedWallTimer) start(d time.Duration, after func()) { + t.dc.offsetChangedMutex.RLock() + dialatedNow, offset := t.dc.nowWithOffset() + realDuration := time.Duration(float64(d) * t.dc.realSecondDuration.Seconds()) + t.target = dialatedNow.Add(d) + t.timer = time.NewTimer(realDuration) + t.offset = offset + t.after = after + t.done = make(chan any) + go t.run() +} + +func (t *dilatedWallTimer) run() { + defer t.dc.offsetChangedMutex.RUnlock() + defer close(t.done) + var sendChan chan time.Time + var sendTime time.Time + for { + select { + case reset := <-t.resetChan: + realNow := time.Now() + dialatedNow := dilateTime(t.dc.epoch, realNow, t.dc.realSecondDuration, t.offset) + realDuration := time.Duration(float64(reset.d) * t.dc.realSecondDuration.Seconds()) + t.target = dialatedNow.Add(reset.d) + sendChan = nil + sendTime = time.Time{} + reset.r <- t.timer.Reset(realDuration) + case stop := <-t.stopChan: + stop <- t.timer.Stop() + return + case tt := <-t.timer.C: + if t.after != nil { + t.after() + return + } + if sendChan != nil { + panic("reset should have been called") + } + sendChan = t.c + sendTime = tt + case sendChan <- sendTime: + sendChan = nil + sendTime = time.Time{} + return + case <-t.dc.offsetChanged: + t.dc.offsetChangedCond.Wait() + newOffset := time.Duration(atomic.LoadInt64(&t.dc.offsetAtomic)) + if newOffset == t.offset { + continue + } + t.offset = newOffset + stopped := t.timer.Stop() + if !stopped { + continue + } + realNow := time.Now() + dialatedNow := dilateTime(t.dc.epoch, realNow, t.dc.realSecondDuration, t.offset) + dialatedDuration := t.target.Sub(dialatedNow) + if dialatedDuration <= 0 { + sendChan = t.c + sendTime = dialatedNow + continue + } + realDuration := time.Duration(float64(dialatedDuration) * t.dc.realSecondDuration.Seconds()) + t.timer.Reset(realDuration) + } + } +} + +// Chan implements Timer.Chan +func (t *dilatedWallTimer) Chan() <-chan time.Time { + return t.c +} + +// Chan implements Timer.Reset +func (t *dilatedWallTimer) Reset(d time.Duration) bool { + t.resetMutex.Lock() + defer t.resetMutex.Unlock() + reset := resetReq{ + d: d, + r: make(chan bool), + } + select { + case <-t.done: + t.start(d, nil) + return true + case t.resetChan <- reset: + return <-reset.r + } +} + +// Chan implements Timer.Stop +func (t *dilatedWallTimer) Stop() bool { + stop := make(chan bool) + select { + case <-t.done: + return false + case t.stopChan <- stop: + return <-stop + } +} + +func dilateTime(epoch, realNow time.Time, + realSecondDuration, dilatedOffset time.Duration) time.Time { + delta := realNow.Sub(epoch) + if delta < 0 { + delta = time.Duration(0) + } + return epoch.Add(dilatedOffset).Add(time.Duration(float64(delta) / realSecondDuration.Seconds())) +} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go b/test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go new file mode 100644 index 0000000000..3d41472091 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go @@ -0,0 +1,224 @@ +// Copyright 2022 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package testclock_test + +import ( + "runtime" + "sync" + "time" + + "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/clock/testclock" +) + +const ( + halfSecond = 500 * time.Millisecond + doubleSecond = 2 * time.Second +) + +type dilatedClockSuite struct { + testing.LoggingSuite +} + +var _ = gc.Suite(&dilatedClockSuite{}) + +func (*dilatedClockSuite) TestSlowedAfter(c *gc.C) { + t0 := time.Now() + cl := testclock.NewDilatedWallClock(doubleSecond) + t1 := <-cl.After(time.Second) + c.Assert(t1.Sub(t0).Seconds(), jc.GreaterThan, 1.9) +} + +func (*dilatedClockSuite) TestFastAfter(c *gc.C) { + t0 := time.Now() + cl := testclock.NewDilatedWallClock(halfSecond) + t1 := <-cl.After(time.Second) + c.Assert(t1.Sub(t0).Milliseconds(), jc.LessThan, 600) +} + +func (*dilatedClockSuite) TestSlowedAfterFunc(c *gc.C) { + t0 := time.Now() + cl := testclock.NewDilatedWallClock(doubleSecond) + mut := sync.Mutex{} + mut.Lock() + cl.AfterFunc(time.Second, func() { + defer mut.Unlock() + c.Check(time.Since(t0).Seconds(), jc.GreaterThan, 1.9) + }) + mut.Lock() +} + +func (*dilatedClockSuite) TestFastAfterFunc(c *gc.C) { + t0 := time.Now() + cl := testclock.NewDilatedWallClock(halfSecond) + mut := sync.Mutex{} + mut.Lock() + cl.AfterFunc(time.Second, func() { + defer mut.Unlock() + c.Check(time.Since(t0).Milliseconds(), jc.LessThan, 600) + }) + mut.Lock() +} + +func (*dilatedClockSuite) TestSlowedNow(c *gc.C) { + t0 := time.Now() + cl := testclock.NewDilatedWallClock(doubleSecond) + <-time.After(time.Second) + t2 := cl.Now() + c.Assert(t2.Sub(t0).Milliseconds(), jc.GreaterThan, 400) + c.Assert(t2.Sub(t0).Milliseconds(), jc.LessThan, 600) + <-time.After(time.Second) + t3 := cl.Now() + c.Assert(t3.Sub(t0).Milliseconds(), jc.GreaterThan, 900) + c.Assert(t3.Sub(t0).Milliseconds(), jc.LessThan, 1100) +} + +func (*dilatedClockSuite) TestFastNow(c *gc.C) { + t0 := time.Now() + cl := testclock.NewDilatedWallClock(halfSecond) + <-time.After(time.Second) + t2 := cl.Now() + c.Assert(t2.Sub(t0).Milliseconds(), jc.GreaterThan, 1900) + c.Assert(t2.Sub(t0).Milliseconds(), jc.LessThan, 2100) + <-time.After(time.Second) + t3 := cl.Now() + c.Assert(t3.Sub(t0).Milliseconds(), jc.GreaterThan, 3900) + c.Assert(t3.Sub(t0).Milliseconds(), jc.LessThan, 4100) +} + +func (*dilatedClockSuite) TestAdvance(c *gc.C) { + t0 := time.Now() + cl := testclock.NewDilatedWallClock(halfSecond) + first := cl.After(time.Second) + cl.Advance(halfSecond) + <-time.After(250 * time.Millisecond) + select { + case t := <-first: + c.Assert(t.Sub(t0).Milliseconds(), jc.GreaterThan, 249) + case <-time.After(shortWait): + c.Fatal("timer failed to trigger early") + } +} + +func (*dilatedClockSuite) TestAdvanceMulti(c *gc.C) { + cl := testclock.NewDilatedWallClock(halfSecond) + first := cl.After(time.Second) + second := cl.After(2 * time.Second) + third := cl.After(1 * time.Hour) + + done := time.After(longWait) + fourth := cl.After(12*time.Hour + longWait*2 + time.Second) + + cl.Advance(12 * time.Hour) + + n := 0 +out: + for { + select { + case <-first: + n++ + case <-second: + n++ + case <-third: + n++ + case <-fourth: + c.Fatal("timer that fired that should not have") + case <-done: + break out + } + } + c.Assert(n, gc.Equals, 3) +} + +func (*dilatedClockSuite) TestStop(c *gc.C) { + numGo := runtime.NumGoroutine() + cl := testclock.NewDilatedWallClock(halfSecond) + a := cl.NewTimer(time.Second) + time.Sleep(shortWait) + ok := a.Stop() + c.Assert(ok, jc.IsTrue) + ok = a.Stop() + c.Assert(ok, jc.IsFalse) + select { + case <-a.Chan(): + c.Fatal("stopped clock fired") + case <-time.After(time.Second): + } + for i := 0; i < 3; i++ { + if runtime.NumGoroutine() == numGo { + break + } + time.Sleep(shortWait) + } + c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) +} + +func (*dilatedClockSuite) TestReset(c *gc.C) { + numGo := runtime.NumGoroutine() + cl := testclock.NewDilatedWallClock(halfSecond) + a := cl.NewTimer(time.Second) + time.Sleep(250 * time.Millisecond) + ok := a.Reset(time.Second) + c.Assert(ok, jc.IsTrue) + <-time.After(halfSecond) + select { + case <-a.Chan(): + case <-time.After(shortWait): + c.Fatal("timer did not fire") + } + for i := 0; i < 3; i++ { + if runtime.NumGoroutine() == numGo { + break + } + time.Sleep(shortWait) + } + c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) +} + +func (*dilatedClockSuite) TestStopReset(c *gc.C) { + numGo := runtime.NumGoroutine() + cl := testclock.NewDilatedWallClock(halfSecond) + a := cl.NewTimer(time.Second) + time.Sleep(250 * time.Millisecond) + ok := a.Stop() + c.Assert(ok, jc.IsTrue) + ok = a.Reset(time.Second) + c.Assert(ok, jc.IsTrue) + <-time.After(halfSecond) + select { + case <-a.Chan(): + case <-time.After(shortWait): + c.Fatal("timer did not fire") + } + for i := 0; i < 3; i++ { + if runtime.NumGoroutine() == numGo { + break + } + time.Sleep(shortWait) + } + c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) +} + +func (*dilatedClockSuite) TestAdvanceAlreadyFired(c *gc.C) { + numGo := runtime.NumGoroutine() + cl := testclock.NewDilatedWallClock(time.Second) + t := cl.NewTimer(time.Millisecond) + time.Sleep(shortWait) + cl.Advance(time.Second) + select { + case <-t.Chan(): + case <-time.After(shortWait): + c.Fatal("timer did not fire") + } + for i := 0; i < 3; i++ { + if runtime.NumGoroutine() == numGo { + break + } + time.Sleep(shortWait) + } + c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) +} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/interfaces.go b/test/integration/licenses/github.com/juju/clock/testclock/interfaces.go new file mode 100644 index 0000000000..df329b6d49 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/testclock/interfaces.go @@ -0,0 +1,17 @@ +// Copyright 2022 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package testclock + +import ( + "time" + + "github.com/juju/clock" +) + +// AdvanceableClock is a clock that can be advanced to trigger timers/trigger timers earlier +// than they would otherwise. +type AdvanceableClock interface { + clock.Clock + Advance(time.Duration) +} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/package_test.go b/test/integration/licenses/github.com/juju/clock/testclock/package_test.go new file mode 100644 index 0000000000..1ca04afd96 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/testclock/package_test.go @@ -0,0 +1,20 @@ +// Copyright 2022 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package testclock_test + +import ( + gotesting "testing" + "time" + + gc "gopkg.in/check.v1" +) + +func TestAll(t *gotesting.T) { + gc.TestingT(t) +} + +const ( + shortWait = 50 * time.Millisecond + longWait = time.Second +) diff --git a/test/integration/licenses/github.com/juju/clock/wall.go b/test/integration/licenses/github.com/juju/clock/wall.go new file mode 100644 index 0000000000..9bfc351855 --- /dev/null +++ b/test/integration/licenses/github.com/juju/clock/wall.go @@ -0,0 +1,47 @@ +// Copyright 2015 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package clock + +import ( + "time" +) + +// WallClock exposes wall-clock time via the Clock interface. +var WallClock wallClock + +// ensure that WallClock does actually implement the Clock interface. +var _ Clock = WallClock + +// WallClock exposes wall-clock time as returned by time.Now. +type wallClock struct{} + +// Now is part of the Clock interface. +func (wallClock) Now() time.Time { + return time.Now() +} + +// After implements Clock.After. +func (wallClock) After(d time.Duration) <-chan time.Time { + return time.After(d) +} + +// AfterFunc implements Clock.AfterFunc. +func (wallClock) AfterFunc(d time.Duration, f func()) Timer { + return wallTimer{time.AfterFunc(d, f)} +} + +// NewTimer implements Clock.NewTimer. +func (wallClock) NewTimer(d time.Duration) Timer { + return wallTimer{time.NewTimer(d)} +} + +// wallTimer implements the Timer interface. +type wallTimer struct { + *time.Timer +} + +// Chan implements Timer.Chan. +func (t wallTimer) Chan() <-chan time.Time { + return t.C +} diff --git a/test/integration/licenses/github.com/juju/errors/.gitignore b/test/integration/licenses/github.com/juju/errors/.gitignore new file mode 100644 index 0000000000..836562412f --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/.gitignore @@ -0,0 +1,23 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test diff --git a/test/integration/licenses/github.com/juju/errors/LICENSE b/test/integration/licenses/github.com/juju/errors/LICENSE new file mode 100644 index 0000000000..ade9307b39 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/LICENSE @@ -0,0 +1,191 @@ +All files in this repository are licensed as follows. If you contribute +to this repository, it is assumed that you license your contribution +under the same license unless you state otherwise. + +All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. + +This software is licensed under the LGPLv3, included below. + +As a special exception to the GNU Lesser General Public License version 3 +("LGPL3"), the copyright holders of this Library give you permission to +convey to a third party a Combined Work that links statically or dynamically +to this Library without providing any Minimal Corresponding Source or +Minimal Application Code as set out in 4d or providing the installation +information set out in section 4e, provided that you comply with the other +provisions of LGPL3 and provided that you meet, for the Application the +terms and conditions of the license(s) which apply to the Application. + +Except as stated in this special exception, the provisions of LGPL3 will +continue to comply in full to this Library. If you modify this Library, you +may apply this exception to your version of this Library, but you are not +obliged to do so. If you do not wish to do so, delete this exception +statement from your version. This exception does not (and cannot) modify any +license terms which apply to the Application, with which you must still +comply. + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/test/integration/licenses/github.com/juju/errors/Makefile b/test/integration/licenses/github.com/juju/errors/Makefile new file mode 100644 index 0000000000..a5bc81e66b --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/Makefile @@ -0,0 +1,24 @@ +PROJECT := github.com/juju/errors + +.PHONY: check-licence check-go check docs + +check: check-licence check-go + go test $(PROJECT)/... + +check-licence: + @(fgrep -rl "Licensed under the LGPLv3" --exclude *.s .;\ + fgrep -rl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" --exclude *.s .;\ + find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ + xargs -I {} echo FAIL: licence missed: {} + +check-go: + $(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g"))) + @(if [ x$(GOFMT) != x"" ]; then \ + echo go fmt is sad: $(GOFMT); \ + exit 1; \ + fi ) + @(go vet -all -composites=false -copylocks=false .) + +docs: + godoc2md github.com/juju/errors > README.md + sed -i '5i[\[GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors)' README.md diff --git a/test/integration/licenses/github.com/juju/errors/README.md b/test/integration/licenses/github.com/juju/errors/README.md new file mode 100644 index 0000000000..271aa78c79 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/README.md @@ -0,0 +1,707 @@ + +# errors + import "github.com/juju/errors" + +[![GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors) + +The juju/errors provides an easy way to annotate errors without losing the +original error context. + +The exported `New` and `Errorf` functions are designed to replace the +`errors.New` and `fmt.Errorf` functions respectively. The same underlying +error is there, but the package also records the location at which the error +was created. + +A primary use case for this library is to add extra context any time an +error is returned from a function. + + + if err := SomeFunc(); err != nil { + return err + } + +This instead becomes: + + + if err := SomeFunc(); err != nil { + return errors.Trace(err) + } + +which just records the file and line number of the Trace call, or + + + if err := SomeFunc(); err != nil { + return errors.Annotate(err, "more context") + } + +which also adds an annotation to the error. + +When you want to check to see if an error is of a particular type, a helper +function is normally exported by the package that returned the error, like the +`os` package does. The underlying cause of the error is available using the +`Cause` function. + + + os.IsNotExist(errors.Cause(err)) + +The result of the `Error()` call on an annotated error is the annotations joined +with colons, then the result of the `Error()` method for the underlying error +that was the cause. + + + err := errors.Errorf("original") + err = errors.Annotatef(err, "context") + err = errors.Annotatef(err, "more context") + err.Error() -> "more context: context: original" + +Obviously recording the file, line and functions is not very useful if you +cannot get them back out again. + + + errors.ErrorStack(err) + +will return something like: + + + first error + github.com/juju/errors/annotation_test.go:193: + github.com/juju/errors/annotation_test.go:194: annotation + github.com/juju/errors/annotation_test.go:195: + github.com/juju/errors/annotation_test.go:196: more context + github.com/juju/errors/annotation_test.go:197: + +The first error was generated by an external system, so there was no location +associated. The second, fourth, and last lines were generated with Trace calls, +and the other two through Annotate. + +Sometimes when responding to an error you want to return a more specific error +for the situation. + + + if err := FindField(field); err != nil { + return errors.Wrap(err, errors.NotFoundf(field)) + } + +This returns an error where the complete error stack is still available, and +`errors.Cause()` will return the `NotFound` error. + + + + + + +## func AlreadyExistsf +``` go +func AlreadyExistsf(format string, args ...interface{}) error +``` +AlreadyExistsf returns an error which satisfies IsAlreadyExists(). + + +## func Annotate +``` go +func Annotate(other error, message string) error +``` +Annotate is used to add extra context to an existing error. The location of +the Annotate call is recorded with the annotations. The file, line and +function are also recorded. + +For example: + + + if err := SomeFunc(); err != nil { + return errors.Annotate(err, "failed to frombulate") + } + + +## func Annotatef +``` go +func Annotatef(other error, format string, args ...interface{}) error +``` +Annotatef is used to add extra context to an existing error. The location of +the Annotate call is recorded with the annotations. The file, line and +function are also recorded. + +For example: + + + if err := SomeFunc(); err != nil { + return errors.Annotatef(err, "failed to frombulate the %s", arg) + } + + +## func BadRequestf +``` go +func BadRequestf(format string, args ...interface{}) error +``` +BadRequestf returns an error which satisfies IsBadRequest(). + + +## func Cause +``` go +func Cause(err error) error +``` +Cause returns the cause of the given error. This will be either the +original error, or the result of a Wrap or Mask call. + +Cause is the usual way to diagnose errors that may have been wrapped by +the other errors functions. + + +## func DeferredAnnotatef +``` go +func DeferredAnnotatef(err *error, format string, args ...interface{}) +``` +DeferredAnnotatef annotates the given error (when it is not nil) with the given +format string and arguments (like fmt.Sprintf). If *err is nil, DeferredAnnotatef +does nothing. This method is used in a defer statement in order to annotate any +resulting error with the same message. + +For example: + + + defer DeferredAnnotatef(&err, "failed to frombulate the %s", arg) + + +## func Details +``` go +func Details(err error) string +``` +Details returns information about the stack of errors wrapped by err, in +the format: + + + [{filename:99: error one} {otherfile:55: cause of error one}] + +This is a terse alternative to ErrorStack as it returns a single line. + + +## func ErrorStack +``` go +func ErrorStack(err error) string +``` +ErrorStack returns a string representation of the annotated error. If the +error passed as the parameter is not an annotated error, the result is +simply the result of the Error() method on that error. + +If the error is an annotated error, a multi-line string is returned where +each line represents one entry in the annotation stack. The full filename +from the call stack is used in the output. + + + first error + github.com/juju/errors/annotation_test.go:193: + github.com/juju/errors/annotation_test.go:194: annotation + github.com/juju/errors/annotation_test.go:195: + github.com/juju/errors/annotation_test.go:196: more context + github.com/juju/errors/annotation_test.go:197: + + +## func Errorf +``` go +func Errorf(format string, args ...interface{}) error +``` +Errorf creates a new annotated error and records the location that the +error is created. This should be a drop in replacement for fmt.Errorf. + +For example: + + + return errors.Errorf("validation failed: %s", message) + + +## func Forbiddenf +``` go +func Forbiddenf(format string, args ...interface{}) error +``` +Forbiddenf returns an error which satistifes IsForbidden() + + +## func IsAlreadyExists +``` go +func IsAlreadyExists(err error) bool +``` +IsAlreadyExists reports whether the error was created with +AlreadyExistsf() or NewAlreadyExists(). + + +## func IsBadRequest +``` go +func IsBadRequest(err error) bool +``` +IsBadRequest reports whether err was created with BadRequestf() or +NewBadRequest(). + + +## func IsForbidden +``` go +func IsForbidden(err error) bool +``` +IsForbidden reports whether err was created with Forbiddenf() or +NewForbidden(). + + +## func IsMethodNotAllowed +``` go +func IsMethodNotAllowed(err error) bool +``` +IsMethodNotAllowed reports whether err was created with MethodNotAllowedf() or +NewMethodNotAllowed(). + + +## func IsNotAssigned +``` go +func IsNotAssigned(err error) bool +``` +IsNotAssigned reports whether err was created with NotAssignedf() or +NewNotAssigned(). + + +## func IsNotFound +``` go +func IsNotFound(err error) bool +``` +IsNotFound reports whether err was created with NotFoundf() or +NewNotFound(). + + +## func IsNotImplemented +``` go +func IsNotImplemented(err error) bool +``` +IsNotImplemented reports whether err was created with +NotImplementedf() or NewNotImplemented(). + + +## func IsNotProvisioned +``` go +func IsNotProvisioned(err error) bool +``` +IsNotProvisioned reports whether err was created with NotProvisionedf() or +NewNotProvisioned(). + + +## func IsNotSupported +``` go +func IsNotSupported(err error) bool +``` +IsNotSupported reports whether the error was created with +NotSupportedf() or NewNotSupported(). + + +## func IsNotValid +``` go +func IsNotValid(err error) bool +``` +IsNotValid reports whether the error was created with NotValidf() or +NewNotValid(). + + +## func IsUnauthorized +``` go +func IsUnauthorized(err error) bool +``` +IsUnauthorized reports whether err was created with Unauthorizedf() or +NewUnauthorized(). + + +## func IsUserNotFound +``` go +func IsUserNotFound(err error) bool +``` +IsUserNotFound reports whether err was created with UserNotFoundf() or +NewUserNotFound(). + + +## func Mask +``` go +func Mask(other error) error +``` +Mask hides the underlying error type, and records the location of the masking. + + +## func Maskf +``` go +func Maskf(other error, format string, args ...interface{}) error +``` +Mask masks the given error with the given format string and arguments (like +fmt.Sprintf), returning a new error that maintains the error stack, but +hides the underlying error type. The error string still contains the full +annotations. If you want to hide the annotations, call Wrap. + + +## func MethodNotAllowedf +``` go +func MethodNotAllowedf(format string, args ...interface{}) error +``` +MethodNotAllowedf returns an error which satisfies IsMethodNotAllowed(). + + +## func New +``` go +func New(message string) error +``` +New is a drop in replacement for the standard library errors module that records +the location that the error is created. + +For example: + + + return errors.New("validation failed") + + +## func NewAlreadyExists +``` go +func NewAlreadyExists(err error, msg string) error +``` +NewAlreadyExists returns an error which wraps err and satisfies +IsAlreadyExists(). + + +## func NewBadRequest +``` go +func NewBadRequest(err error, msg string) error +``` +NewBadRequest returns an error which wraps err that satisfies +IsBadRequest(). + + +## func NewForbidden +``` go +func NewForbidden(err error, msg string) error +``` +NewForbidden returns an error which wraps err that satisfies +IsForbidden(). + + +## func NewMethodNotAllowed +``` go +func NewMethodNotAllowed(err error, msg string) error +``` +NewMethodNotAllowed returns an error which wraps err that satisfies +IsMethodNotAllowed(). + + +## func NewNotAssigned +``` go +func NewNotAssigned(err error, msg string) error +``` +NewNotAssigned returns an error which wraps err that satisfies +IsNotAssigned(). + + +## func NewNotFound +``` go +func NewNotFound(err error, msg string) error +``` +NewNotFound returns an error which wraps err that satisfies +IsNotFound(). + + +## func NewNotImplemented +``` go +func NewNotImplemented(err error, msg string) error +``` +NewNotImplemented returns an error which wraps err and satisfies +IsNotImplemented(). + + +## func NewNotProvisioned +``` go +func NewNotProvisioned(err error, msg string) error +``` +NewNotProvisioned returns an error which wraps err that satisfies +IsNotProvisioned(). + + +## func NewNotSupported +``` go +func NewNotSupported(err error, msg string) error +``` +NewNotSupported returns an error which wraps err and satisfies +IsNotSupported(). + + +## func NewNotValid +``` go +func NewNotValid(err error, msg string) error +``` +NewNotValid returns an error which wraps err and satisfies IsNotValid(). + + +## func NewUnauthorized +``` go +func NewUnauthorized(err error, msg string) error +``` +NewUnauthorized returns an error which wraps err and satisfies +IsUnauthorized(). + + +## func NewUserNotFound +``` go +func NewUserNotFound(err error, msg string) error +``` +NewUserNotFound returns an error which wraps err and satisfies +IsUserNotFound(). + + +## func NotAssignedf +``` go +func NotAssignedf(format string, args ...interface{}) error +``` +NotAssignedf returns an error which satisfies IsNotAssigned(). + + +## func NotFoundf +``` go +func NotFoundf(format string, args ...interface{}) error +``` +NotFoundf returns an error which satisfies IsNotFound(). + + +## func NotImplementedf +``` go +func NotImplementedf(format string, args ...interface{}) error +``` +NotImplementedf returns an error which satisfies IsNotImplemented(). + + +## func NotProvisionedf +``` go +func NotProvisionedf(format string, args ...interface{}) error +``` +NotProvisionedf returns an error which satisfies IsNotProvisioned(). + + +## func NotSupportedf +``` go +func NotSupportedf(format string, args ...interface{}) error +``` +NotSupportedf returns an error which satisfies IsNotSupported(). + + +## func NotValidf +``` go +func NotValidf(format string, args ...interface{}) error +``` +NotValidf returns an error which satisfies IsNotValid(). + + +## func Trace +``` go +func Trace(other error) error +``` +Trace adds the location of the Trace call to the stack. The Cause of the +resulting error is the same as the error parameter. If the other error is +nil, the result will be nil. + +For example: + + + if err := SomeFunc(); err != nil { + return errors.Trace(err) + } + + +## func Unauthorizedf +``` go +func Unauthorizedf(format string, args ...interface{}) error +``` +Unauthorizedf returns an error which satisfies IsUnauthorized(). + + +## func UserNotFoundf +``` go +func UserNotFoundf(format string, args ...interface{}) error +``` +UserNotFoundf returns an error which satisfies IsUserNotFound(). + + +## func Wrap +``` go +func Wrap(other, newDescriptive error) error +``` +Wrap changes the Cause of the error. The location of the Wrap call is also +stored in the error stack. + +For example: + + + if err := SomeFunc(); err != nil { + newErr := &packageError{"more context", private_value} + return errors.Wrap(err, newErr) + } + + +## func Wrapf +``` go +func Wrapf(other, newDescriptive error, format string, args ...interface{}) error +``` +Wrapf changes the Cause of the error, and adds an annotation. The location +of the Wrap call is also stored in the error stack. + +For example: + + + if err := SomeFunc(); err != nil { + return errors.Wrapf(err, simpleErrorType, "invalid value %q", value) + } + + + +## type Err +``` go +type Err struct { + // contains filtered or unexported fields +} +``` +Err holds a description of an error along with information about +where the error was created. + +It may be embedded in custom error types to add extra information that +this errors package can understand. + + + + + + + + + +### func NewErr +``` go +func NewErr(format string, args ...interface{}) Err +``` +NewErr is used to return an Err for the purpose of embedding in other +structures. The location is not specified, and needs to be set with a call +to SetLocation. + +For example: + + + type FooError struct { + errors.Err + code int + } + + func NewFooError(code int) error { + err := &FooError{errors.NewErr("foo"), code} + err.SetLocation(1) + return err + } + + +### func NewErrWithCause +``` go +func NewErrWithCause(other error, format string, args ...interface{}) Err +``` +NewErrWithCause is used to return an Err with cause by other error for the purpose of embedding in other +structures. The location is not specified, and needs to be set with a call +to SetLocation. + +For example: + + + type FooError struct { + errors.Err + code int + } + + func (e *FooError) Annotate(format string, args ...interface{}) error { + err := &FooError{errors.NewErrWithCause(e.Err, format, args...), e.code} + err.SetLocation(1) + return err + }) + + + + +### func (\*Err) Cause +``` go +func (e *Err) Cause() error +``` +The Cause of an error is the most recent error in the error stack that +meets one of these criteria: the original error that was raised; the new +error that was passed into the Wrap function; the most recently masked +error; or nil if the error itself is considered the Cause. Normally this +method is not invoked directly, but instead through the Cause stand alone +function. + + + +### func (\*Err) Error +``` go +func (e *Err) Error() string +``` +Error implements error.Error. + + + +### func (\*Err) Format +``` go +func (e *Err) Format(s fmt.State, verb rune) +``` +Format implements fmt.Formatter +When printing errors with %+v it also prints the stack trace. +%#v unsurprisingly will print the real underlying type. + + + +### func (\*Err) Location +``` go +func (e *Err) Location() (filename string, line int) +``` +Location is the file and line of where the error was most recently +created or annotated. + + + +### func (\*Err) Message +``` go +func (e *Err) Message() string +``` +Message returns the message stored with the most recent location. This is +the empty string if the most recent call was Trace, or the message stored +with Annotate or Mask. + + + +### func (\*Err) SetLocation +``` go +func (e *Err) SetLocation(callDepth int) +``` +SetLocation records the source location of the error at callDepth stack +frames above the call. + + + +### func (\*Err) StackTrace +``` go +func (e *Err) StackTrace() []string +``` +StackTrace returns one string for each location recorded in the stack of +errors. The first value is the originating error, with a line for each +other annotation or tracing of the error. + + + +### func (\*Err) Underlying +``` go +func (e *Err) Underlying() error +``` +Underlying returns the previous error in the error stack, if any. A client +should not ever really call this method. It is used to build the error +stack and should not be introspected by client calls. Or more +specifically, clients should not depend on anything but the `Cause` of an +error. + + + + + + + + + +- - - +Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) diff --git a/test/integration/licenses/github.com/juju/errors/dependencies.tsv b/test/integration/licenses/github.com/juju/errors/dependencies.tsv new file mode 100644 index 0000000000..e324344944 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/dependencies.tsv @@ -0,0 +1,5 @@ +github.com/juju/loggo git 8232ab8918d91c72af1a9fb94d3edbe31d88b790 2017-06-05T01:46:07Z +github.com/juju/testing git 72703b1e95eb8ce4737fd8a3d8496c6b0be280a6 2018-05-17T13:41:05Z +gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z +gopkg.in/mgo.v2 git f2b6f6c918c452ad107eec89615f074e3bd80e33 2016-08-18T01:52:18Z +gopkg.in/yaml.v2 git 1be3d31502d6eabc0dd7ce5b0daab022e14a5538 2017-07-12T05:45:46Z diff --git a/test/integration/licenses/github.com/juju/errors/doc.go b/test/integration/licenses/github.com/juju/errors/doc.go new file mode 100644 index 0000000000..d4403662aa --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/doc.go @@ -0,0 +1,79 @@ +// Copyright 2013, 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +/* +Package errors provides an easy way to annotate errors without losing the +original error context. + +The exported `New` and `Errorf` functions are designed to replace the +`errors.New` and `fmt.Errorf` functions respectively. The same underlying +error is there, but the package also records the location at which the error +was created. + +A primary use case for this library is to add extra context any time an +error is returned from a function. + + if err := SomeFunc(); err != nil { + return err + } + +This instead becomes: + + if err := SomeFunc(); err != nil { + return errors.Trace(err) + } + +which just records the file and line number of the Trace call, or + + if err := SomeFunc(); err != nil { + return errors.Annotate(err, "more context") + } + +which also adds an annotation to the error. + +When you want to check to see if an error is of a particular type, a helper +function is normally exported by the package that returned the error, like the +`os` package does. The underlying cause of the error is available using the +`Cause` function. + + os.IsNotExist(errors.Cause(err)) + +The result of the `Error()` call on an annotated error is the annotations joined +with colons, then the result of the `Error()` method for the underlying error +that was the cause. + + err := errors.Errorf("original") + err = errors.Annotatef(err, "context") + err = errors.Annotatef(err, "more context") + err.Error() -> "more context: context: original" + +Obviously recording the file, line and functions is not very useful if you +cannot get them back out again. + + errors.ErrorStack(err) + +will return something like: + + first error + github.com/juju/errors/annotation_test.go:193: + github.com/juju/errors/annotation_test.go:194: annotation + github.com/juju/errors/annotation_test.go:195: + github.com/juju/errors/annotation_test.go:196: more context + github.com/juju/errors/annotation_test.go:197: + +The first error was generated by an external system, so there was no location +associated. The second, fourth, and last lines were generated with Trace calls, +and the other two through Annotate. + +Sometimes when responding to an error you want to return a more specific error +for the situation. + + if err := FindField(field); err != nil { + return errors.Wrap(err, errors.NotFoundf(field)) + } + +This returns an error where the complete error stack is still available, and +`errors.Cause()` will return the `NotFound` error. + +*/ +package errors diff --git a/test/integration/licenses/github.com/juju/errors/error.go b/test/integration/licenses/github.com/juju/errors/error.go new file mode 100644 index 0000000000..2796b9f29b --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/error.go @@ -0,0 +1,176 @@ +// Copyright 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors + +import ( + "fmt" + "reflect" + "runtime" +) + +// Err holds a description of an error along with information about +// where the error was created. +// +// It may be embedded in custom error types to add extra information that +// this errors package can understand. +type Err struct { + // message holds an annotation of the error. + message string + + // cause holds the cause of the error as returned + // by the Cause method. + cause error + + // previous holds the previous error in the error stack, if any. + previous error + + // file and line hold the source code location where the error was + // created. + file string + line int +} + +// NewErr is used to return an Err for the purpose of embedding in other +// structures. The location is not specified, and needs to be set with a call +// to SetLocation. +// +// For example: +// type FooError struct { +// errors.Err +// code int +// } +// +// func NewFooError(code int) error { +// err := &FooError{errors.NewErr("foo"), code} +// err.SetLocation(1) +// return err +// } +func NewErr(format string, args ...interface{}) Err { + return Err{ + message: fmt.Sprintf(format, args...), + } +} + +// NewErrWithCause is used to return an Err with cause by other error for the purpose of embedding in other +// structures. The location is not specified, and needs to be set with a call +// to SetLocation. +// +// For example: +// type FooError struct { +// errors.Err +// code int +// } +// +// func (e *FooError) Annotate(format string, args ...interface{}) error { +// err := &FooError{errors.NewErrWithCause(e.Err, format, args...), e.code} +// err.SetLocation(1) +// return err +// }) +func NewErrWithCause(other error, format string, args ...interface{}) Err { + return Err{ + message: fmt.Sprintf(format, args...), + cause: Cause(other), + previous: other, + } +} + +// Location is the file and line of where the error was most recently +// created or annotated. +func (e *Err) Location() (filename string, line int) { + return e.file, e.line +} + +// Underlying returns the previous error in the error stack, if any. A client +// should not ever really call this method. It is used to build the error +// stack and should not be introspected by client calls. Or more +// specifically, clients should not depend on anything but the `Cause` of an +// error. +func (e *Err) Underlying() error { + return e.previous +} + +// Cause returns the most recent error in the error stack that +// meets one of these criteria: the original error that was raised; the new +// error that was passed into the Wrap function; the most recently masked +// error; or nil if the error itself is considered the Cause. Normally this +// method is not invoked directly, but instead through the Cause stand alone +// function. +func (e *Err) Cause() error { + return e.cause +} + +// Message returns the message stored with the most recent location. This is +// the empty string if the most recent call was Trace, or the message stored +// with Annotate or Mask. +func (e *Err) Message() string { + return e.message +} + +// Error implements error.Error. +func (e *Err) Error() string { + // We want to walk up the stack of errors showing the annotations + // as long as the cause is the same. + err := e.previous + if !sameError(Cause(err), e.cause) && e.cause != nil { + err = e.cause + } + switch { + case err == nil: + return e.message + case e.message == "": + return err.Error() + } + return fmt.Sprintf("%s: %v", e.message, err) +} + +// Format implements fmt.Formatter +// When printing errors with %+v it also prints the stack trace. +// %#v unsurprisingly will print the real underlying type. +func (e *Err) Format(s fmt.State, verb rune) { + switch verb { + case 'v': + switch { + case s.Flag('+'): + fmt.Fprintf(s, "%s", ErrorStack(e)) + return + case s.Flag('#'): + // avoid infinite recursion by wrapping e into a type + // that doesn't implement Formatter. + fmt.Fprintf(s, "%#v", (*unformatter)(e)) + return + } + fallthrough + case 's': + fmt.Fprintf(s, "%s", e.Error()) + case 'q': + fmt.Fprintf(s, "%q", e.Error()) + default: + fmt.Fprintf(s, "%%!%c(%T=%s)", verb, e, e.Error()) + } +} + +// helper for Format +type unformatter Err + +func (unformatter) Format() { /* break the fmt.Formatter interface */ } + +// SetLocation records the source location of the error at callDepth stack +// frames above the call. +func (e *Err) SetLocation(callDepth int) { + _, file, line, _ := runtime.Caller(callDepth + 1) + e.file = trimSourcePath(file) + e.line = line +} + +// StackTrace returns one string for each location recorded in the stack of +// errors. The first value is the originating error, with a line for each +// other annotation or tracing of the error. +func (e *Err) StackTrace() []string { + return errorStack(e) +} + +// Ideally we'd have a way to check identity, but deep equals will do. +func sameError(e1, e2 error) bool { + return reflect.DeepEqual(e1, e2) +} diff --git a/test/integration/licenses/github.com/juju/errors/error_test.go b/test/integration/licenses/github.com/juju/errors/error_test.go new file mode 100644 index 0000000000..ba9b71878e --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/error_test.go @@ -0,0 +1,178 @@ +// Copyright 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors_test + +import ( + "fmt" + "runtime" + + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/errors" +) + +type errorsSuite struct{} + +var _ = gc.Suite(&errorsSuite{}) + +var someErr = errors.New("some error") //err varSomeErr + +func (*errorsSuite) TestErrorString(c *gc.C) { + for i, test := range []struct { + message string + generator func() error + expected string + }{ + { + message: "uncomparable errors", + generator: func() error { + err := errors.Annotatef(newNonComparableError("uncomparable"), "annotation") + return errors.Annotatef(err, "another") + }, + expected: "another: annotation: uncomparable", + }, { + message: "Errorf", + generator: func() error { + return errors.Errorf("first error") + }, + expected: "first error", + }, { + message: "annotated error", + generator: func() error { + err := errors.Errorf("first error") + return errors.Annotatef(err, "annotation") + }, + expected: "annotation: first error", + }, { + message: "test annotation format", + generator: func() error { + err := errors.Errorf("first %s", "error") + return errors.Annotatef(err, "%s", "annotation") + }, + expected: "annotation: first error", + }, { + message: "wrapped error", + generator: func() error { + err := newError("first error") + return errors.Wrap(err, newError("detailed error")) + }, + expected: "detailed error", + }, { + message: "wrapped annotated error", + generator: func() error { + err := errors.Errorf("first error") + err = errors.Annotatef(err, "annotated") + return errors.Wrap(err, fmt.Errorf("detailed error")) + }, + expected: "detailed error", + }, { + message: "annotated wrapped error", + generator: func() error { + err := errors.Errorf("first error") + err = errors.Wrap(err, fmt.Errorf("detailed error")) + return errors.Annotatef(err, "annotated") + }, + expected: "annotated: detailed error", + }, { + message: "traced, and annotated", + generator: func() error { + err := errors.New("first error") + err = errors.Trace(err) + err = errors.Annotate(err, "some context") + err = errors.Trace(err) + err = errors.Annotate(err, "more context") + return errors.Trace(err) + }, + expected: "more context: some context: first error", + }, { + message: "traced, and annotated, masked and annotated", + generator: func() error { + err := errors.New("first error") + err = errors.Trace(err) + err = errors.Annotate(err, "some context") + err = errors.Maskf(err, "masked") + err = errors.Annotate(err, "more context") + return errors.Trace(err) + }, + expected: "more context: masked: some context: first error", + }, + } { + c.Logf("%v: %s", i, test.message) + err := test.generator() + ok := c.Check(err.Error(), gc.Equals, test.expected) + if !ok { + c.Logf("%#v", test.generator()) + } + } +} + +type embed struct { + errors.Err +} + +func newEmbed(format string, args ...interface{}) *embed { + err := &embed{errors.NewErr(format, args...)} + err.SetLocation(1) + return err +} + +func (*errorsSuite) TestNewErr(c *gc.C) { + if runtime.Compiler == "gccgo" { + c.Skip("gccgo can't determine the location") + } + err := newEmbed("testing %d", 42) //err embedErr + c.Assert(err.Error(), gc.Equals, "testing 42") + c.Assert(errors.Cause(err), gc.Equals, err) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["embedErr"].String()) +} + +func newEmbedWithCause(other error, format string, args ...interface{}) *embed { + err := &embed{errors.NewErrWithCause(other, format, args...)} + err.SetLocation(1) + return err +} + +func (*errorsSuite) TestNewErrWithCause(c *gc.C) { + if runtime.Compiler == "gccgo" { + c.Skip("gccgo can't determine the location") + } + causeErr := fmt.Errorf("external error") + err := newEmbedWithCause(causeErr, "testing %d", 43) //err embedCause + c.Assert(err.Error(), gc.Equals, "testing 43: external error") + c.Assert(errors.Cause(err), gc.Equals, causeErr) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["embedCause"].String()) +} + +var _ error = (*embed)(nil) + +// This is an uncomparable error type, as it is a struct that supports the +// error interface (as opposed to a pointer type). +type error_ struct { + info string + slice []string +} + +// Create a non-comparable error +func newNonComparableError(message string) error { + return error_{info: message} +} + +func (e error_) Error() string { + return e.info +} + +func newError(message string) error { + return testError{message} +} + +// The testError is a value type error for ease of seeing results +// when the test fails. +type testError struct { + message string +} + +func (e testError) Error() string { + return e.message +} diff --git a/test/integration/licenses/github.com/juju/errors/errortypes.go b/test/integration/licenses/github.com/juju/errors/errortypes.go new file mode 100644 index 0000000000..8647c7ae39 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/errortypes.go @@ -0,0 +1,382 @@ +// Copyright 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors + +import ( + "fmt" +) + +// wrap is a helper to construct an *wrapper. +func wrap(err error, format, suffix string, args ...interface{}) Err { + newErr := Err{ + message: fmt.Sprintf(format+suffix, args...), + previous: err, + } + newErr.SetLocation(2) + return newErr +} + +// timeout represents an error on timeout. +type timeout struct { + Err +} + +// Timeoutf returns an error which satisfies IsTimeout(). +func Timeoutf(format string, args ...interface{}) error { + return &timeout{wrap(nil, format, " timeout", args...)} +} + +// NewTimeout returns an error which wraps err that satisfies +// IsTimeout(). +func NewTimeout(err error, msg string) error { + return &timeout{wrap(err, msg, "")} +} + +// IsTimeout reports whether err was created with Timeoutf() or +// NewTimeout(). +func IsTimeout(err error) bool { + err = Cause(err) + _, ok := err.(*timeout) + return ok +} + +// notFound represents an error when something has not been found. +type notFound struct { + Err +} + +// NotFoundf returns an error which satisfies IsNotFound(). +func NotFoundf(format string, args ...interface{}) error { + return ¬Found{wrap(nil, format, " not found", args...)} +} + +// NewNotFound returns an error which wraps err that satisfies +// IsNotFound(). +func NewNotFound(err error, msg string) error { + return ¬Found{wrap(err, msg, "")} +} + +// IsNotFound reports whether err was created with NotFoundf() or +// NewNotFound(). +func IsNotFound(err error) bool { + err = Cause(err) + _, ok := err.(*notFound) + return ok +} + +// userNotFound represents an error when an inexistent user is looked up. +type userNotFound struct { + Err +} + +// UserNotFoundf returns an error which satisfies IsUserNotFound(). +func UserNotFoundf(format string, args ...interface{}) error { + return &userNotFound{wrap(nil, format, " user not found", args...)} +} + +// NewUserNotFound returns an error which wraps err and satisfies +// IsUserNotFound(). +func NewUserNotFound(err error, msg string) error { + return &userNotFound{wrap(err, msg, "")} +} + +// IsUserNotFound reports whether err was created with UserNotFoundf() or +// NewUserNotFound(). +func IsUserNotFound(err error) bool { + err = Cause(err) + _, ok := err.(*userNotFound) + return ok +} + +// unauthorized represents an error when an operation is unauthorized. +type unauthorized struct { + Err +} + +// Unauthorizedf returns an error which satisfies IsUnauthorized(). +func Unauthorizedf(format string, args ...interface{}) error { + return &unauthorized{wrap(nil, format, "", args...)} +} + +// NewUnauthorized returns an error which wraps err and satisfies +// IsUnauthorized(). +func NewUnauthorized(err error, msg string) error { + return &unauthorized{wrap(err, msg, "")} +} + +// IsUnauthorized reports whether err was created with Unauthorizedf() or +// NewUnauthorized(). +func IsUnauthorized(err error) bool { + err = Cause(err) + _, ok := err.(*unauthorized) + return ok +} + +// notImplemented represents an error when something is not +// implemented. +type notImplemented struct { + Err +} + +// NotImplementedf returns an error which satisfies IsNotImplemented(). +func NotImplementedf(format string, args ...interface{}) error { + return ¬Implemented{wrap(nil, format, " not implemented", args...)} +} + +// NewNotImplemented returns an error which wraps err and satisfies +// IsNotImplemented(). +func NewNotImplemented(err error, msg string) error { + return ¬Implemented{wrap(err, msg, "")} +} + +// IsNotImplemented reports whether err was created with +// NotImplementedf() or NewNotImplemented(). +func IsNotImplemented(err error) bool { + err = Cause(err) + _, ok := err.(*notImplemented) + return ok +} + +// alreadyExists represents and error when something already exists. +type alreadyExists struct { + Err +} + +// AlreadyExistsf returns an error which satisfies IsAlreadyExists(). +func AlreadyExistsf(format string, args ...interface{}) error { + return &alreadyExists{wrap(nil, format, " already exists", args...)} +} + +// NewAlreadyExists returns an error which wraps err and satisfies +// IsAlreadyExists(). +func NewAlreadyExists(err error, msg string) error { + return &alreadyExists{wrap(err, msg, "")} +} + +// IsAlreadyExists reports whether the error was created with +// AlreadyExistsf() or NewAlreadyExists(). +func IsAlreadyExists(err error) bool { + err = Cause(err) + _, ok := err.(*alreadyExists) + return ok +} + +// notSupported represents an error when something is not supported. +type notSupported struct { + Err +} + +// NotSupportedf returns an error which satisfies IsNotSupported(). +func NotSupportedf(format string, args ...interface{}) error { + return ¬Supported{wrap(nil, format, " not supported", args...)} +} + +// NewNotSupported returns an error which wraps err and satisfies +// IsNotSupported(). +func NewNotSupported(err error, msg string) error { + return ¬Supported{wrap(err, msg, "")} +} + +// IsNotSupported reports whether the error was created with +// NotSupportedf() or NewNotSupported(). +func IsNotSupported(err error) bool { + err = Cause(err) + _, ok := err.(*notSupported) + return ok +} + +// notValid represents an error when something is not valid. +type notValid struct { + Err +} + +// NotValidf returns an error which satisfies IsNotValid(). +func NotValidf(format string, args ...interface{}) error { + return ¬Valid{wrap(nil, format, " not valid", args...)} +} + +// NewNotValid returns an error which wraps err and satisfies IsNotValid(). +func NewNotValid(err error, msg string) error { + return ¬Valid{wrap(err, msg, "")} +} + +// IsNotValid reports whether the error was created with NotValidf() or +// NewNotValid(). +func IsNotValid(err error) bool { + err = Cause(err) + _, ok := err.(*notValid) + return ok +} + +// notProvisioned represents an error when something is not yet provisioned. +type notProvisioned struct { + Err +} + +// NotProvisionedf returns an error which satisfies IsNotProvisioned(). +func NotProvisionedf(format string, args ...interface{}) error { + return ¬Provisioned{wrap(nil, format, " not provisioned", args...)} +} + +// NewNotProvisioned returns an error which wraps err that satisfies +// IsNotProvisioned(). +func NewNotProvisioned(err error, msg string) error { + return ¬Provisioned{wrap(err, msg, "")} +} + +// IsNotProvisioned reports whether err was created with NotProvisionedf() or +// NewNotProvisioned(). +func IsNotProvisioned(err error) bool { + err = Cause(err) + _, ok := err.(*notProvisioned) + return ok +} + +// notAssigned represents an error when something is not yet assigned to +// something else. +type notAssigned struct { + Err +} + +// NotAssignedf returns an error which satisfies IsNotAssigned(). +func NotAssignedf(format string, args ...interface{}) error { + return ¬Assigned{wrap(nil, format, " not assigned", args...)} +} + +// NewNotAssigned returns an error which wraps err that satisfies +// IsNotAssigned(). +func NewNotAssigned(err error, msg string) error { + return ¬Assigned{wrap(err, msg, "")} +} + +// IsNotAssigned reports whether err was created with NotAssignedf() or +// NewNotAssigned(). +func IsNotAssigned(err error) bool { + err = Cause(err) + _, ok := err.(*notAssigned) + return ok +} + +// badRequest represents an error when a request has bad parameters. +type badRequest struct { + Err +} + +// BadRequestf returns an error which satisfies IsBadRequest(). +func BadRequestf(format string, args ...interface{}) error { + return &badRequest{wrap(nil, format, "", args...)} +} + +// NewBadRequest returns an error which wraps err that satisfies +// IsBadRequest(). +func NewBadRequest(err error, msg string) error { + return &badRequest{wrap(err, msg, "")} +} + +// IsBadRequest reports whether err was created with BadRequestf() or +// NewBadRequest(). +func IsBadRequest(err error) bool { + err = Cause(err) + _, ok := err.(*badRequest) + return ok +} + +// methodNotAllowed represents an error when an HTTP request +// is made with an inappropriate method. +type methodNotAllowed struct { + Err +} + +// MethodNotAllowedf returns an error which satisfies IsMethodNotAllowed(). +func MethodNotAllowedf(format string, args ...interface{}) error { + return &methodNotAllowed{wrap(nil, format, "", args...)} +} + +// NewMethodNotAllowed returns an error which wraps err that satisfies +// IsMethodNotAllowed(). +func NewMethodNotAllowed(err error, msg string) error { + return &methodNotAllowed{wrap(err, msg, "")} +} + +// IsMethodNotAllowed reports whether err was created with MethodNotAllowedf() or +// NewMethodNotAllowed(). +func IsMethodNotAllowed(err error) bool { + err = Cause(err) + _, ok := err.(*methodNotAllowed) + return ok +} + +// forbidden represents an error when a request cannot be completed because of +// missing privileges +type forbidden struct { + Err +} + +// Forbiddenf returns an error which satistifes IsForbidden() +func Forbiddenf(format string, args ...interface{}) error { + return &forbidden{wrap(nil, format, "", args...)} +} + +// NewForbidden returns an error which wraps err that satisfies +// IsForbidden(). +func NewForbidden(err error, msg string) error { + return &forbidden{wrap(err, msg, "")} +} + +// IsForbidden reports whether err was created with Forbiddenf() or +// NewForbidden(). +func IsForbidden(err error) bool { + err = Cause(err) + _, ok := err.(*forbidden) + return ok +} + +// quotaLimitExceeded is emitted when an action failed due to a quota limit check. +type quotaLimitExceeded struct { + Err +} + +// QuotaLimitExceededf returns an error which satisfies IsQuotaLimitExceeded. +func QuotaLimitExceededf(format string, args ...interface{}) error { + return "aLimitExceeded{wrap(nil, format, "", args...)} +} + +// NewQuotaLimitExceeded returns an error which wraps err and satisfies +// IsQuotaLimitExceeded. +func NewQuotaLimitExceeded(err error, msg string) error { + return "aLimitExceeded{wrap(err, msg, "")} +} + +// IsQuotaLimitExceeded returns true if the given error represents a +// QuotaLimitExceeded error. +func IsQuotaLimitExceeded(err error) bool { + err = Cause(err) + _, ok := err.(*quotaLimitExceeded) + return ok +} + +// notYetAvailable is the error returned when a resource is not yet available +// but it might be in the future. +type notYetAvailable struct { + Err +} + +// IsNotYetAvailable reports err was created with NotYetAvailableF or +// NewNotYetAvailable. +func IsNotYetAvailable(err error) bool { + err = Cause(err) + _, ok := err.(*notYetAvailable) + return ok +} + +// NotYetAvailablef returns an error which satisfies IsNotYetAvailable. +func NotYetAvailablef(format string, args ...interface{}) error { + return ¬YetAvailable{wrap(nil, format, "", args...)} +} + +// NewNotYetAvailable returns an error which wraps err and satisfies +// IsNotYetAvailable. +func NewNotYetAvailable(err error, msg string) error { + return ¬YetAvailable{wrap(err, msg, "")} +} diff --git a/test/integration/licenses/github.com/juju/errors/errortypes_test.go b/test/integration/licenses/github.com/juju/errors/errortypes_test.go new file mode 100644 index 0000000000..4a652a8f96 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/errortypes_test.go @@ -0,0 +1,177 @@ +// Copyright 2013, 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors_test + +import ( + stderrors "errors" + "fmt" + "reflect" + "runtime" + + "github.com/juju/errors" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" +) + +// errorInfo holds information about a single error type: a satisfier +// function, wrapping and variable arguments constructors and message +// suffix. +type errorInfo struct { + satisfier func(error) bool + argsConstructor func(string, ...interface{}) error + wrapConstructor func(error, string) error + suffix string +} + +// allErrors holds information for all defined errors. When adding new +// errors, add them here as well to include them in tests. +var allErrors = []*errorInfo{ + {errors.IsTimeout, errors.Timeoutf, errors.NewTimeout, " timeout"}, + {errors.IsNotFound, errors.NotFoundf, errors.NewNotFound, " not found"}, + {errors.IsUserNotFound, errors.UserNotFoundf, errors.NewUserNotFound, " user not found"}, + {errors.IsUnauthorized, errors.Unauthorizedf, errors.NewUnauthorized, ""}, + {errors.IsNotImplemented, errors.NotImplementedf, errors.NewNotImplemented, " not implemented"}, + {errors.IsAlreadyExists, errors.AlreadyExistsf, errors.NewAlreadyExists, " already exists"}, + {errors.IsNotSupported, errors.NotSupportedf, errors.NewNotSupported, " not supported"}, + {errors.IsNotValid, errors.NotValidf, errors.NewNotValid, " not valid"}, + {errors.IsNotProvisioned, errors.NotProvisionedf, errors.NewNotProvisioned, " not provisioned"}, + {errors.IsNotAssigned, errors.NotAssignedf, errors.NewNotAssigned, " not assigned"}, + {errors.IsMethodNotAllowed, errors.MethodNotAllowedf, errors.NewMethodNotAllowed, ""}, + {errors.IsBadRequest, errors.BadRequestf, errors.NewBadRequest, ""}, + {errors.IsForbidden, errors.Forbiddenf, errors.NewForbidden, ""}, + {errors.IsQuotaLimitExceeded, errors.QuotaLimitExceededf, errors.NewQuotaLimitExceeded, ""}, + {errors.IsNotYetAvailable, errors.NotYetAvailablef, errors.NewNotYetAvailable, ""}, +} + +type errorTypeSuite struct{} + +var _ = gc.Suite(&errorTypeSuite{}) + +func (t *errorInfo) satisfierName() string { + value := reflect.ValueOf(t.satisfier) + f := runtime.FuncForPC(value.Pointer()) + return f.Name() +} + +func (t *errorInfo) equal(t0 *errorInfo) bool { + if t0 == nil { + return false + } + return t.satisfierName() == t0.satisfierName() +} + +type errorTest struct { + err error + message string + errInfo *errorInfo +} + +func deferredAnnotatef(err error, format string, args ...interface{}) error { + errors.DeferredAnnotatef(&err, format, args...) + return err +} + +func mustSatisfy(c *gc.C, err error, errInfo *errorInfo) { + if errInfo != nil { + msg := fmt.Sprintf("%#v must satisfy %v", err, errInfo.satisfierName()) + c.Check(err, jc.Satisfies, errInfo.satisfier, gc.Commentf(msg)) + } +} + +func mustNotSatisfy(c *gc.C, err error, errInfo *errorInfo) { + if errInfo != nil { + msg := fmt.Sprintf("%#v must not satisfy %v", err, errInfo.satisfierName()) + c.Check(err, gc.Not(jc.Satisfies), errInfo.satisfier, gc.Commentf(msg)) + } +} + +func checkErrorMatches(c *gc.C, err error, message string, errInfo *errorInfo) { + if message == "" { + c.Check(err, gc.IsNil) + c.Check(errInfo, gc.IsNil) + } else { + c.Check(err, gc.ErrorMatches, message) + } +} + +func runErrorTests(c *gc.C, errorTests []errorTest, checkMustSatisfy bool) { + for i, t := range errorTests { + c.Logf("test %d: %T: %v", i, t.err, t.err) + checkErrorMatches(c, t.err, t.message, t.errInfo) + if checkMustSatisfy { + mustSatisfy(c, t.err, t.errInfo) + } + + // Check all other satisfiers to make sure none match. + for _, otherErrInfo := range allErrors { + if checkMustSatisfy && otherErrInfo.equal(t.errInfo) { + continue + } + mustNotSatisfy(c, t.err, otherErrInfo) + } + } +} + +func (*errorTypeSuite) TestDeferredAnnotatef(c *gc.C) { + // Ensure DeferredAnnotatef annotates the errors. + errorTests := []errorTest{} + for _, errInfo := range allErrors { + errorTests = append(errorTests, []errorTest{{ + deferredAnnotatef(nil, "comment"), + "", + nil, + }, { + deferredAnnotatef(stderrors.New("blast"), "comment"), + "comment: blast", + nil, + }, { + deferredAnnotatef(errInfo.argsConstructor("foo %d", 42), "comment %d", 69), + "comment 69: foo 42" + errInfo.suffix, + errInfo, + }, { + deferredAnnotatef(errInfo.argsConstructor(""), "comment"), + "comment: " + errInfo.suffix, + errInfo, + }, { + deferredAnnotatef(errInfo.wrapConstructor(stderrors.New("pow!"), "woo"), "comment"), + "comment: woo: pow!", + errInfo, + }}...) + } + + runErrorTests(c, errorTests, true) +} + +func (*errorTypeSuite) TestAllErrors(c *gc.C) { + errorTests := []errorTest{} + for _, errInfo := range allErrors { + errorTests = append(errorTests, []errorTest{{ + nil, + "", + nil, + }, { + errInfo.argsConstructor("foo %d", 42), + "foo 42" + errInfo.suffix, + errInfo, + }, { + errInfo.argsConstructor(""), + errInfo.suffix, + errInfo, + }, { + errInfo.wrapConstructor(stderrors.New("pow!"), "prefix"), + "prefix: pow!", + errInfo, + }, { + errInfo.wrapConstructor(stderrors.New("pow!"), ""), + "pow!", + errInfo, + }, { + errInfo.wrapConstructor(nil, "prefix"), + "prefix", + errInfo, + }}...) + } + + runErrorTests(c, errorTests, true) +} diff --git a/test/integration/licenses/github.com/juju/errors/example_test.go b/test/integration/licenses/github.com/juju/errors/example_test.go new file mode 100644 index 0000000000..2a79cf4898 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/example_test.go @@ -0,0 +1,23 @@ +// Copyright 2013, 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors_test + +import ( + "fmt" + + "github.com/juju/errors" +) + +func ExampleTrace() { + var err1 error = fmt.Errorf("something wicked this way comes") + var err2 error = nil + + // Tracing a non nil error will return an error + fmt.Println(errors.Trace(err1)) + // Tracing nil will return nil + fmt.Println(errors.Trace(err2)) + + // Output: something wicked this way comes + // +} diff --git a/test/integration/licenses/github.com/juju/errors/export_test.go b/test/integration/licenses/github.com/juju/errors/export_test.go new file mode 100644 index 0000000000..8e6bb7c0ba --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/export_test.go @@ -0,0 +1,12 @@ +// Copyright 2013, 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors + +// Since variables are declared before the init block, in order to get the goPath +// we need to return it rather than just reference it. +func TrimDefault() string { + return trimDefault +} + +var TrimSourcePath = trimSourcePath diff --git a/test/integration/licenses/github.com/juju/errors/functions.go b/test/integration/licenses/github.com/juju/errors/functions.go new file mode 100644 index 0000000000..1bf7c9e257 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/functions.go @@ -0,0 +1,330 @@ +// Copyright 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors + +import ( + "fmt" + "strings" +) + +// New is a drop in replacement for the standard library errors module that records +// the location that the error is created. +// +// For example: +// return errors.New("validation failed") +// +func New(message string) error { + err := &Err{message: message} + err.SetLocation(1) + return err +} + +// Errorf creates a new annotated error and records the location that the +// error is created. This should be a drop in replacement for fmt.Errorf. +// +// For example: +// return errors.Errorf("validation failed: %s", message) +// +func Errorf(format string, args ...interface{}) error { + err := &Err{message: fmt.Sprintf(format, args...)} + err.SetLocation(1) + return err +} + +// Trace adds the location of the Trace call to the stack. The Cause of the +// resulting error is the same as the error parameter. If the other error is +// nil, the result will be nil. +// +// For example: +// if err := SomeFunc(); err != nil { +// return errors.Trace(err) +// } +// +func Trace(other error) error { + if other == nil { + return nil + } + err := &Err{previous: other, cause: Cause(other)} + err.SetLocation(1) + return err +} + +// Annotate is used to add extra context to an existing error. The location of +// the Annotate call is recorded with the annotations. The file, line and +// function are also recorded. +// +// For example: +// if err := SomeFunc(); err != nil { +// return errors.Annotate(err, "failed to frombulate") +// } +// +func Annotate(other error, message string) error { + if other == nil { + return nil + } + err := &Err{ + previous: other, + cause: Cause(other), + message: message, + } + err.SetLocation(1) + return err +} + +// Annotatef is used to add extra context to an existing error. The location of +// the Annotate call is recorded with the annotations. The file, line and +// function are also recorded. +// +// For example: +// if err := SomeFunc(); err != nil { +// return errors.Annotatef(err, "failed to frombulate the %s", arg) +// } +// +func Annotatef(other error, format string, args ...interface{}) error { + if other == nil { + return nil + } + err := &Err{ + previous: other, + cause: Cause(other), + message: fmt.Sprintf(format, args...), + } + err.SetLocation(1) + return err +} + +// DeferredAnnotatef annotates the given error (when it is not nil) with the given +// format string and arguments (like fmt.Sprintf). If *err is nil, DeferredAnnotatef +// does nothing. This method is used in a defer statement in order to annotate any +// resulting error with the same message. +// +// For example: +// +// defer DeferredAnnotatef(&err, "failed to frombulate the %s", arg) +// +func DeferredAnnotatef(err *error, format string, args ...interface{}) { + if *err == nil { + return + } + newErr := &Err{ + message: fmt.Sprintf(format, args...), + cause: Cause(*err), + previous: *err, + } + newErr.SetLocation(1) + *err = newErr +} + +// Wrap changes the Cause of the error. The location of the Wrap call is also +// stored in the error stack. +// +// For example: +// if err := SomeFunc(); err != nil { +// newErr := &packageError{"more context", private_value} +// return errors.Wrap(err, newErr) +// } +// +func Wrap(other, newDescriptive error) error { + err := &Err{ + previous: other, + cause: newDescriptive, + } + err.SetLocation(1) + return err +} + +// Wrapf changes the Cause of the error, and adds an annotation. The location +// of the Wrap call is also stored in the error stack. +// +// For example: +// if err := SomeFunc(); err != nil { +// return errors.Wrapf(err, simpleErrorType, "invalid value %q", value) +// } +// +func Wrapf(other, newDescriptive error, format string, args ...interface{}) error { + err := &Err{ + message: fmt.Sprintf(format, args...), + previous: other, + cause: newDescriptive, + } + err.SetLocation(1) + return err +} + +// Maskf masks the given error with the given format string and arguments (like +// fmt.Sprintf), returning a new error that maintains the error stack, but +// hides the underlying error type. The error string still contains the full +// annotations. If you want to hide the annotations, call Wrap. +func Maskf(other error, format string, args ...interface{}) error { + if other == nil { + return nil + } + err := &Err{ + message: fmt.Sprintf(format, args...), + previous: other, + } + err.SetLocation(1) + return err +} + +// Mask hides the underlying error type, and records the location of the masking. +func Mask(other error) error { + if other == nil { + return nil + } + err := &Err{ + previous: other, + } + err.SetLocation(1) + return err +} + +// Cause returns the cause of the given error. This will be either the +// original error, or the result of a Wrap or Mask call. +// +// Cause is the usual way to diagnose errors that may have been wrapped by +// the other errors functions. +func Cause(err error) error { + var diag error + if err, ok := err.(causer); ok { + diag = err.Cause() + } + if diag != nil { + return diag + } + return err +} + +type causer interface { + Cause() error +} + +type wrapper interface { + // Message returns the top level error message, + // not including the message from the Previous + // error. + Message() string + + // Underlying returns the Previous error, or nil + // if there is none. + Underlying() error +} + +type locationer interface { + Location() (string, int) +} + +var ( + _ wrapper = (*Err)(nil) + _ locationer = (*Err)(nil) + _ causer = (*Err)(nil) +) + +// Details returns information about the stack of errors wrapped by err, in +// the format: +// +// [{filename:99: error one} {otherfile:55: cause of error one}] +// +// This is a terse alternative to ErrorStack as it returns a single line. +func Details(err error) string { + if err == nil { + return "[]" + } + var s []byte + s = append(s, '[') + for { + s = append(s, '{') + if err, ok := err.(locationer); ok { + file, line := err.Location() + if file != "" { + s = append(s, fmt.Sprintf("%s:%d", file, line)...) + s = append(s, ": "...) + } + } + if cerr, ok := err.(wrapper); ok { + s = append(s, cerr.Message()...) + err = cerr.Underlying() + } else { + s = append(s, err.Error()...) + err = nil + } + s = append(s, '}') + if err == nil { + break + } + s = append(s, ' ') + } + s = append(s, ']') + return string(s) +} + +// ErrorStack returns a string representation of the annotated error. If the +// error passed as the parameter is not an annotated error, the result is +// simply the result of the Error() method on that error. +// +// If the error is an annotated error, a multi-line string is returned where +// each line represents one entry in the annotation stack. The full filename +// from the call stack is used in the output. +// +// first error +// github.com/juju/errors/annotation_test.go:193: +// github.com/juju/errors/annotation_test.go:194: annotation +// github.com/juju/errors/annotation_test.go:195: +// github.com/juju/errors/annotation_test.go:196: more context +// github.com/juju/errors/annotation_test.go:197: +func ErrorStack(err error) string { + return strings.Join(errorStack(err), "\n") +} + +func errorStack(err error) []string { + if err == nil { + return nil + } + + // We want the first error first + var lines []string + for { + var buff []byte + if err, ok := err.(locationer); ok { + file, line := err.Location() + // Strip off the leading GOPATH/src path elements. + file = trimSourcePath(file) + if file != "" { + buff = append(buff, fmt.Sprintf("%s:%d", file, line)...) + buff = append(buff, ": "...) + } + } + if cerr, ok := err.(wrapper); ok { + message := cerr.Message() + buff = append(buff, message...) + // If there is a cause for this error, and it is different to the cause + // of the underlying error, then output the error string in the stack trace. + var cause error + if err1, ok := err.(causer); ok { + cause = err1.Cause() + } + err = cerr.Underlying() + if cause != nil && !sameError(Cause(err), cause) { + if message != "" { + buff = append(buff, ": "...) + } + buff = append(buff, cause.Error()...) + } + } else { + buff = append(buff, err.Error()...) + err = nil + } + lines = append(lines, string(buff)) + if err == nil { + break + } + } + // reverse the lines to get the original error, which was at the end of + // the list, back to the start. + var result []string + for i := len(lines); i > 0; i-- { + result = append(result, lines[i-1]) + } + return result +} diff --git a/test/integration/licenses/github.com/juju/errors/functions_test.go b/test/integration/licenses/github.com/juju/errors/functions_test.go new file mode 100644 index 0000000000..de43e43923 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/functions_test.go @@ -0,0 +1,334 @@ +// Copyright 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors_test + +import ( + "fmt" + "os" + "path/filepath" + "runtime" + "strings" + + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/errors" +) + +type functionSuite struct { +} + +var _ = gc.Suite(&functionSuite{}) + +func (*functionSuite) TestNew(c *gc.C) { + err := errors.New("testing") //err newTest + c.Assert(err.Error(), gc.Equals, "testing") + c.Assert(errors.Cause(err), gc.Equals, err) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["newTest"].String()) +} + +func (*functionSuite) TestErrorf(c *gc.C) { + err := errors.Errorf("testing %d", 42) //err errorfTest + c.Assert(err.Error(), gc.Equals, "testing 42") + c.Assert(errors.Cause(err), gc.Equals, err) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["errorfTest"].String()) +} + +func (*functionSuite) TestTrace(c *gc.C) { + first := errors.New("first") + err := errors.Trace(first) //err traceTest + c.Assert(err.Error(), gc.Equals, "first") + c.Assert(errors.Cause(err), gc.Equals, first) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["traceTest"].String()) + + c.Assert(errors.Trace(nil), gc.IsNil) +} + +func (*functionSuite) TestAnnotate(c *gc.C) { + first := errors.New("first") + err := errors.Annotate(first, "annotation") //err annotateTest + c.Assert(err.Error(), gc.Equals, "annotation: first") + c.Assert(errors.Cause(err), gc.Equals, first) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["annotateTest"].String()) + + c.Assert(errors.Annotate(nil, "annotate"), gc.IsNil) +} + +func (*functionSuite) TestAnnotatef(c *gc.C) { + first := errors.New("first") + err := errors.Annotatef(first, "annotation %d", 2) //err annotatefTest + c.Assert(err.Error(), gc.Equals, "annotation 2: first") + c.Assert(errors.Cause(err), gc.Equals, first) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["annotatefTest"].String()) + + c.Assert(errors.Annotatef(nil, "annotate"), gc.IsNil) +} + +func (*functionSuite) TestDeferredAnnotatef(c *gc.C) { + // NOTE: this test fails with gccgo + if runtime.Compiler == "gccgo" { + c.Skip("gccgo can't determine the location") + } + first := errors.New("first") + test := func() (err error) { + defer errors.DeferredAnnotatef(&err, "deferred %s", "annotate") + return first //err deferredAnnotate + } + err := test() + c.Assert(err.Error(), gc.Equals, "deferred annotate: first") + c.Assert(errors.Cause(err), gc.Equals, first) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["deferredAnnotate"].String()) + + err = nil + errors.DeferredAnnotatef(&err, "deferred %s", "annotate") + c.Assert(err, gc.IsNil) +} + +func (*functionSuite) TestWrap(c *gc.C) { + first := errors.New("first") //err wrapFirst + detailed := errors.New("detailed") + err := errors.Wrap(first, detailed) //err wrapTest + c.Assert(err.Error(), gc.Equals, "detailed") + c.Assert(errors.Cause(err), gc.Equals, detailed) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapFirst"].String()) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapTest"].String()) +} + +func (*functionSuite) TestWrapOfNil(c *gc.C) { + detailed := errors.New("detailed") + err := errors.Wrap(nil, detailed) //err nilWrapTest + c.Assert(err.Error(), gc.Equals, "detailed") + c.Assert(errors.Cause(err), gc.Equals, detailed) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["nilWrapTest"].String()) +} + +func (*functionSuite) TestWrapf(c *gc.C) { + first := errors.New("first") //err wrapfFirst + detailed := errors.New("detailed") + err := errors.Wrapf(first, detailed, "value %d", 42) //err wrapfTest + c.Assert(err.Error(), gc.Equals, "value 42: detailed") + c.Assert(errors.Cause(err), gc.Equals, detailed) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapfFirst"].String()) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapfTest"].String()) +} + +func (*functionSuite) TestWrapfOfNil(c *gc.C) { + detailed := errors.New("detailed") + err := errors.Wrapf(nil, detailed, "value %d", 42) //err nilWrapfTest + c.Assert(err.Error(), gc.Equals, "value 42: detailed") + c.Assert(errors.Cause(err), gc.Equals, detailed) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["nilWrapfTest"].String()) +} + +func (*functionSuite) TestMask(c *gc.C) { + first := errors.New("first") + err := errors.Mask(first) //err maskTest + c.Assert(err.Error(), gc.Equals, "first") + c.Assert(errors.Cause(err), gc.Equals, err) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["maskTest"].String()) + + c.Assert(errors.Mask(nil), gc.IsNil) +} + +func (*functionSuite) TestMaskf(c *gc.C) { + first := errors.New("first") + err := errors.Maskf(first, "masked %d", 42) //err maskfTest + c.Assert(err.Error(), gc.Equals, "masked 42: first") + c.Assert(errors.Cause(err), gc.Equals, err) + c.Assert(errors.Details(err), jc.Contains, tagToLocation["maskfTest"].String()) + + c.Assert(errors.Maskf(nil, "mask"), gc.IsNil) +} + +func (*functionSuite) TestCause(c *gc.C) { + c.Assert(errors.Cause(nil), gc.IsNil) + c.Assert(errors.Cause(someErr), gc.Equals, someErr) + + fmtErr := fmt.Errorf("simple") + c.Assert(errors.Cause(fmtErr), gc.Equals, fmtErr) + + err := errors.Wrap(someErr, fmtErr) + c.Assert(errors.Cause(err), gc.Equals, fmtErr) + + err = errors.Annotate(err, "annotated") + c.Assert(errors.Cause(err), gc.Equals, fmtErr) + + err = errors.Maskf(err, "maksed") + c.Assert(errors.Cause(err), gc.Equals, err) + + // Look for a file that we know isn't there. + dir := c.MkDir() + _, err = os.Stat(filepath.Join(dir, "not-there")) + c.Assert(os.IsNotExist(err), jc.IsTrue) + + err = errors.Annotatef(err, "wrap it") + // Now the error itself isn't a 'IsNotExist'. + c.Assert(os.IsNotExist(err), jc.IsFalse) + // However if we use the Check method, it is. + c.Assert(os.IsNotExist(errors.Cause(err)), jc.IsTrue) +} + +func (s *functionSuite) TestDetails(c *gc.C) { + if runtime.Compiler == "gccgo" { + c.Skip("gccgo can't determine the location") + } + c.Assert(errors.Details(nil), gc.Equals, "[]") + + otherErr := fmt.Errorf("other") + checkDetails(c, otherErr, "[{other}]") + + err0 := newEmbed("foo") //err TestStack#0 + checkDetails(c, err0, "[{$TestStack#0$: foo}]") + + err1 := errors.Annotate(err0, "bar") //err TestStack#1 + checkDetails(c, err1, "[{$TestStack#1$: bar} {$TestStack#0$: foo}]") + + err2 := errors.Trace(err1) //err TestStack#2 + checkDetails(c, err2, "[{$TestStack#2$: } {$TestStack#1$: bar} {$TestStack#0$: foo}]") +} + +type tracer interface { + StackTrace() []string +} + +func (*functionSuite) TestErrorStack(c *gc.C) { + for i, test := range []struct { + message string + generator func() error + expected string + tracer bool + }{{ + message: "nil", + generator: func() error { + return nil + }, + }, { + message: "raw error", + generator: func() error { + return fmt.Errorf("raw") + }, + expected: "raw", + }, { + message: "single error stack", + generator: func() error { + return errors.New("first error") //err single + }, + expected: "$single$: first error", + tracer: true, + }, { + message: "annotated error", + generator: func() error { + err := errors.New("first error") //err annotated-0 + return errors.Annotate(err, "annotation") //err annotated-1 + }, + expected: "" + + "$annotated-0$: first error\n" + + "$annotated-1$: annotation", + tracer: true, + }, { + message: "wrapped error", + generator: func() error { + err := errors.New("first error") //err wrapped-0 + return errors.Wrap(err, newError("detailed error")) //err wrapped-1 + }, + expected: "" + + "$wrapped-0$: first error\n" + + "$wrapped-1$: detailed error", + tracer: true, + }, { + message: "annotated wrapped error", + generator: func() error { + err := errors.Errorf("first error") //err ann-wrap-0 + err = errors.Wrap(err, fmt.Errorf("detailed error")) //err ann-wrap-1 + return errors.Annotatef(err, "annotated") //err ann-wrap-2 + }, + expected: "" + + "$ann-wrap-0$: first error\n" + + "$ann-wrap-1$: detailed error\n" + + "$ann-wrap-2$: annotated", + tracer: true, + }, { + message: "traced, and annotated", + generator: func() error { + err := errors.New("first error") //err stack-0 + err = errors.Trace(err) //err stack-1 + err = errors.Annotate(err, "some context") //err stack-2 + err = errors.Trace(err) //err stack-3 + err = errors.Annotate(err, "more context") //err stack-4 + return errors.Trace(err) //err stack-5 + }, + expected: "" + + "$stack-0$: first error\n" + + "$stack-1$: \n" + + "$stack-2$: some context\n" + + "$stack-3$: \n" + + "$stack-4$: more context\n" + + "$stack-5$: ", + tracer: true, + }, { + message: "uncomparable, wrapped with a value error", + generator: func() error { + err := newNonComparableError("first error") //err mixed-0 + err = errors.Trace(err) //err mixed-1 + err = errors.Wrap(err, newError("value error")) //err mixed-2 + err = errors.Maskf(err, "masked") //err mixed-3 + err = errors.Annotate(err, "more context") //err mixed-4 + return errors.Trace(err) //err mixed-5 + }, + expected: "" + + "first error\n" + + "$mixed-1$: \n" + + "$mixed-2$: value error\n" + + "$mixed-3$: masked\n" + + "$mixed-4$: more context\n" + + "$mixed-5$: ", + tracer: true, + }} { + c.Logf("%v: %s", i, test.message) + err := test.generator() + expected := replaceLocations(test.expected) + stack := errors.ErrorStack(err) + ok := c.Check(stack, gc.Equals, expected) + if !ok { + c.Logf("%#v", err) + } + tracer, ok := err.(tracer) + c.Check(ok, gc.Equals, test.tracer) + if ok { + stackTrace := tracer.StackTrace() + c.Check(stackTrace, gc.DeepEquals, strings.Split(stack, "\n")) + } + } +} + +func (*functionSuite) TestFormat(c *gc.C) { + err := errors.New("TestFormat") //err testformat + err = errors.Mask(err) //err testformat-wrap + for i, test := range []struct { + format string + expect string + }{{ + format: "%s", + expect: "TestFormat", + }, { + format: "%v", + expect: "TestFormat", + }, { + format: "%q", + expect: `"TestFormat"`, + }, { + format: "%A", + expect: `%!A(*errors.Err=TestFormat)`, + }, { + format: "%+v", + expect: "" + + "$testformat$: TestFormat\n" + + "$testformat-wrap$: ", + }} { + c.Logf("test %d: %q", i, test.format) + s := fmt.Sprintf(test.format, err) + expect := replaceLocations(test.expect) + c.Check(s, gc.Equals, expect) + } +} diff --git a/test/integration/licenses/github.com/juju/errors/go.mod b/test/integration/licenses/github.com/juju/errors/go.mod new file mode 100644 index 0000000000..6079e4d656 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/go.mod @@ -0,0 +1,16 @@ +module github.com/juju/errors + +go 1.17 + +require ( + github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c +) + +require ( + github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e // indirect + github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 // indirect + github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) diff --git a/test/integration/licenses/github.com/juju/errors/go.sum b/test/integration/licenses/github.com/juju/errors/go.sum new file mode 100644 index 0000000000..0a8b662813 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/go.sum @@ -0,0 +1,76 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= +github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= +github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= +github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= +github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= +github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e h1:FdDd7bdI6cjq5vaoYlK1mfQYfF9sF2VZw8VEZMsl5t8= +github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= +github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= +github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= +github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= +github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6 h1:ulhR1Mns3DtuGP+dmHV92CBqgsNT7FsE3sFOePwHFVI= +github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6/go.mod h1:QgWc2UdIPJ8t3rnvv95tFNOsQDfpXYEZDbP281o3b2c= +github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= +github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= +github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= +github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= +github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= +github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= +github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= +github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= +github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= +gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= +gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= +gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +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= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= +launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= diff --git a/test/integration/licenses/github.com/juju/errors/package_test.go b/test/integration/licenses/github.com/juju/errors/package_test.go new file mode 100644 index 0000000000..5bbb8f04ef --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/package_test.go @@ -0,0 +1,95 @@ +// Copyright 2013, 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors_test + +import ( + "fmt" + "io/ioutil" + "strings" + "testing" + + gc "gopkg.in/check.v1" + + "github.com/juju/errors" +) + +func Test(t *testing.T) { + gc.TestingT(t) +} + +func checkDetails(c *gc.C, err error, details string) { + c.Assert(err, gc.NotNil) + expectedDetails := replaceLocations(details) + c.Assert(errors.Details(err), gc.Equals, expectedDetails) +} + +func checkErr(c *gc.C, err, cause error, msg string, details string) { + c.Assert(err, gc.NotNil) + c.Assert(err.Error(), gc.Equals, msg) + c.Assert(errors.Cause(err), gc.Equals, cause) + expectedDetails := replaceLocations(details) + c.Assert(errors.Details(err), gc.Equals, expectedDetails) +} + +func replaceLocations(line string) string { + result := "" + for { + i := strings.Index(line, "$") + if i == -1 { + break + } + result += line[0:i] + line = line[i+1:] + i = strings.Index(line, "$") + if i == -1 { + panic("no second $") + } + result += location(line[0:i]).String() + line = line[i+1:] + } + result += line + return result +} + +func location(tag string) Location { + loc, ok := tagToLocation[tag] + if !ok { + panic(fmt.Sprintf("tag %q not found", tag)) + } + return loc +} + +type Location struct { + file string + line int +} + +func (loc Location) String() string { + return fmt.Sprintf("%s:%d", loc.file, loc.line) +} + +var tagToLocation = make(map[string]Location) + +func setLocationsForErrorTags(filename string) { + data, err := ioutil.ReadFile(filename) + if err != nil { + panic(err) + } + filename = "github.com/juju/errors/" + filename + lines := strings.Split(string(data), "\n") + for i, line := range lines { + if j := strings.Index(line, "//err "); j >= 0 { + tag := line[j+len("//err "):] + if _, found := tagToLocation[tag]; found { + panic(fmt.Sprintf("tag %q already processed previously", tag)) + } + tagToLocation[tag] = Location{file: filename, line: i + 1} + } + } +} + +func init() { + setLocationsForErrorTags("error_test.go") + setLocationsForErrorTags("functions_test.go") +} diff --git a/test/integration/licenses/github.com/juju/errors/path.go b/test/integration/licenses/github.com/juju/errors/path.go new file mode 100644 index 0000000000..48968d9054 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/path.go @@ -0,0 +1,32 @@ +// Copyright 2013, 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors + +import ( + "go/build" + "os" + "path/filepath" + "strings" + "sync/atomic" +) + +var trimValue atomic.Value +var trimDefault = filepath.Join(build.Default.GOPATH, "src") + string(os.PathSeparator) + +func trimSourcePath(filename string) string { + prefix := trimDefault + if v := trimValue.Load(); v != nil { + prefix = v.(string) + } + return strings.TrimPrefix(filename, prefix) +} + +func SetSourceTrimPrefix(s string) string { + previous := trimDefault + if v := trimValue.Load(); v != nil { + previous = v.(string) + } + trimValue.Store(s) + return previous +} diff --git a/test/integration/licenses/github.com/juju/errors/path_test.go b/test/integration/licenses/github.com/juju/errors/path_test.go new file mode 100644 index 0000000000..334ddb6e67 --- /dev/null +++ b/test/integration/licenses/github.com/juju/errors/path_test.go @@ -0,0 +1,38 @@ +// Copyright 2013, 2014 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package errors_test + +import ( + "path/filepath" + + gc "gopkg.in/check.v1" + + "github.com/juju/errors" +) + +type pathSuite struct{} + +var _ = gc.Suite(&pathSuite{}) + +func (*pathSuite) TestTrimDefaultSet(c *gc.C) { + c.Assert(errors.TrimDefault(), gc.Not(gc.Equals), "") +} + +func (*pathSuite) TestTrimSourcePath(c *gc.C) { + relativeImport := "github.com/foo/bar/rel.go" + filename := filepath.Join(errors.TrimDefault(), relativeImport) + c.Assert(errors.TrimSourcePath(filename), gc.Equals, relativeImport) + + absoluteImport := "/usr/share/foo/bar/abs.go" + c.Assert(errors.TrimSourcePath(absoluteImport), gc.Equals, absoluteImport) +} + +func (*pathSuite) TestSetSourceTrimPrefix(c *gc.C) { + testPrefix := "/usr/share/" + savePrefix := errors.SetSourceTrimPrefix(testPrefix) + defer errors.SetSourceTrimPrefix(savePrefix) + relative := "github.com/foo/bar/rel.go" + filename := filepath.Join(testPrefix, relative) + c.Assert(errors.TrimSourcePath(filename), gc.Equals, relative) +} diff --git a/test/integration/licenses/github.com/juju/fslock/.gitignore b/test/integration/licenses/github.com/juju/fslock/.gitignore new file mode 100644 index 0000000000..daf913b1b3 --- /dev/null +++ b/test/integration/licenses/github.com/juju/fslock/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/test/integration/licenses/github.com/juju/fslock/LICENSE b/test/integration/licenses/github.com/juju/fslock/LICENSE new file mode 100644 index 0000000000..5cec73f3a4 --- /dev/null +++ b/test/integration/licenses/github.com/juju/fslock/LICENSE @@ -0,0 +1,191 @@ +All files in this repository are licensed as follows. If you contribute +to this repository, it is assumed that you license your contribution +under the same license unless you state otherwise. + +All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. + +This software is licensed under the LGPLv3, included below. + +As a special exception to the GNU Lesser General Public License version 3 +("LGPL3"), the copyright holders of this Library give you permission to +convey to a third party a Combined Work that links statically or dynamically +to this Library without providing any Minimal Corresponding Source or +Minimal Application Code as set out in 4d or providing the installation +information set out in section 4e, provided that you comply with the other +provisions of LGPL3 and provided that you meet, for the Application the +terms and conditions of the license(s) which apply to the Application. + +Except as stated in this special exception, the provisions of LGPL3 will +continue to comply in full to this Library. If you modify this Library, you +may apply this exception to your version of this Library, but you are not +obliged to do so. If you do not wish to do so, delete this exception +statement from your version. This exception does not (and cannot) modify any +license terms which apply to the Application, with which you must still +comply. + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/test/integration/licenses/github.com/juju/fslock/README.md b/test/integration/licenses/github.com/juju/fslock/README.md new file mode 100644 index 0000000000..4361b9dd0d --- /dev/null +++ b/test/integration/licenses/github.com/juju/fslock/README.md @@ -0,0 +1,74 @@ + +# fslock [![GoDoc](https://godoc.org/github.com/juju/fslock?status.svg)](https://godoc.org/github.com/juju/fslock) +fslock provides a cross-process mutex based on file locks that works on windows and *nix platforms. + + +![fslock](https://cloud.githubusercontent.com/assets/3185864/15507515/f3351498-2199-11e6-9f37-bc59657a9e8c.jpg) + +image: [public domain](https://pixabay.com/en/encrypted-privacy-policy-445155/) +(don't ask) + + +fslock relies on LockFileEx on Windows and flock on \*nix systems. The timeout +feature uses overlapped IO on Windows, but on \*nix platforms, timing out +requires the use of a goroutine that will run until the lock is acquired, +regardless of timeout. If you need to avoid this use of goroutines, poll +TryLock in a loop. + + + +## Variables +``` go +var ErrLocked error = trylockError("fslock is already locked") +``` +ErrLocked indicates TryLock failed because the lock was already locked. + +``` go +var ErrTimeout error = timeoutError("lock timeout exceeded") +``` +ErrTimeout indicates that the lock attempt timed out. + + +## type Lock +``` go +type Lock struct { + // contains filtered or unexported fields +} +``` +Lock implements cross-process locks using syscalls. + + +### func New +``` go +func New(filename string) *Lock +``` +New returns a new lock around the given file. + + +### func (\*Lock) Lock +``` go +func (l *Lock) Lock() error +``` +Lock locks the lock. This call will block until the lock is available. + +### func (\*Lock) LockWithTimeout +``` go +func (l *Lock) LockWithTimeout(timeout time.Duration) error +``` +LockWithTimeout tries to lock the lock until the timeout expires. If the +timeout expires, this method will return ErrTimeout. + +### func (\*Lock) TryLock +``` go +func (l *Lock) TryLock() error +``` +TryLock attempts to lock the lock. This method will return ErrLocked +immediately if the lock cannot be acquired. + +### func (\*Lock) Unlock +``` go +func (l *Lock) Unlock() error +``` +Unlock unlocks the lock. + + diff --git a/test/integration/licenses/github.com/juju/fslock/fslock.go b/test/integration/licenses/github.com/juju/fslock/fslock.go new file mode 100644 index 0000000000..f03c25e997 --- /dev/null +++ b/test/integration/licenses/github.com/juju/fslock/fslock.go @@ -0,0 +1,32 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +// Package fslock provides a cross-process mutex based on file locks. +// +// It is built on top of flock for linux and darwin, and LockFileEx on Windows. +package fslock + +// ErrTimeout indicates that the lock attempt timed out. +var ErrTimeout error = timeoutError("lock timeout exceeded") + +type timeoutError string + +func (t timeoutError) Error() string { + return string(t) +} +func (timeoutError) Timeout() bool { + return true +} + +// ErrLocked indicates TryLock failed because the lock was already locked. +var ErrLocked error = trylockError("fslock is already locked") + +type trylockError string + +func (t trylockError) Error() string { + return string(t) +} + +func (trylockError) Temporary() bool { + return true +} diff --git a/test/integration/licenses/github.com/juju/fslock/fslock_nix.go b/test/integration/licenses/github.com/juju/fslock/fslock_nix.go new file mode 100644 index 0000000000..55aabb67e1 --- /dev/null +++ b/test/integration/licenses/github.com/juju/fslock/fslock_nix.go @@ -0,0 +1,89 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd +// +build darwin dragonfly freebsd linux netbsd openbsd + +package fslock + +import ( + "syscall" + "time" +) + +// Lock implements cross-process locks using syscalls. +// This implementation is based on flock syscall. +type Lock struct { + filename string + fd int +} + +// New returns a new lock around the given file. +func New(filename string) *Lock { + return &Lock{filename: filename} +} + +// Lock locks the lock. This call will block until the lock is available. +func (l *Lock) Lock() error { + if err := l.open(); err != nil { + return err + } + return syscall.Flock(l.fd, syscall.LOCK_EX) +} + +// TryLock attempts to lock the lock. This method will return ErrLocked +// immediately if the lock cannot be acquired. +func (l *Lock) TryLock() error { + if err := l.open(); err != nil { + return err + } + err := syscall.Flock(l.fd, syscall.LOCK_EX|syscall.LOCK_NB) + if err != nil { + syscall.Close(l.fd) + } + if err == syscall.EWOULDBLOCK { + return ErrLocked + } + return err +} + +func (l *Lock) open() error { + fd, err := syscall.Open(l.filename, syscall.O_CREAT|syscall.O_RDONLY, 0600) + if err != nil { + return err + } + l.fd = fd + return nil +} + +// Unlock unlocks the lock. +func (l *Lock) Unlock() error { + return syscall.Close(l.fd) +} + +// LockWithTimeout tries to lock the lock until the timeout expires. If the +// timeout expires, this method will return ErrTimeout. +func (l *Lock) LockWithTimeout(timeout time.Duration) error { + if err := l.open(); err != nil { + return err + } + result := make(chan error) + cancel := make(chan struct{}) + go func() { + err := syscall.Flock(l.fd, syscall.LOCK_EX) + select { + case <-cancel: + // Timed out, cleanup if necessary. + syscall.Flock(l.fd, syscall.LOCK_UN) + syscall.Close(l.fd) + case result <- err: + } + }() + select { + case err := <-result: + return err + case <-time.After(timeout): + close(cancel) + return ErrTimeout + } +} diff --git a/test/integration/licenses/github.com/juju/fslock/fslock_test.go b/test/integration/licenses/github.com/juju/fslock/fslock_test.go new file mode 100644 index 0000000000..09d7aaea9b --- /dev/null +++ b/test/integration/licenses/github.com/juju/fslock/fslock_test.go @@ -0,0 +1,328 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package fslock_test + +import ( + "fmt" + "os" + "os/exec" + "path/filepath" + "runtime" + "sync" + "sync/atomic" + "testing" + "time" + + gc "gopkg.in/check.v1" + + "github.com/juju/fslock" +) + +func Test(t *testing.T) { + gc.TestingT(t) +} + +const ( + shortWait = 10 * time.Millisecond + longWait = 10 * shortWait +) + +type fslockSuite struct{} + +var _ = gc.Suite(&fslockSuite{}) + +func (s *fslockSuite) TestLockNoContention(c *gc.C) { + path := filepath.Join(c.MkDir(), "testing") + lock := fslock.New(path) + + started := make(chan struct{}) + acquired := make(chan struct{}) + go func() { + close(started) + err := lock.Lock() + close(acquired) + c.Assert(err, gc.IsNil) + }() + + select { + case <-started: + // good, goroutine started. + case <-time.After(shortWait * 2): + c.Fatalf("timeout waiting for goroutine to start") + } + + select { + case <-acquired: + // got the lock. good. + case <-time.After(shortWait * 2): + c.Fatalf("Timed out waiting for lock acquisition.") + } + + err := lock.Unlock() + c.Assert(err, gc.IsNil) +} + +func (s *fslockSuite) TestLockBlocks(c *gc.C) { + path := filepath.Join(c.MkDir(), "testing") + lock := fslock.New(path) + + kill := make(chan struct{}) + + // this will block until the other process has the lock. + procDone := LockFromAnotherProc(c, path, kill) + + defer func() { + close(kill) + // now wait for the other process to exit so the file will be unlocked. + select { + case <-procDone: + case <-time.After(time.Second): + } + }() + + started := make(chan struct{}) + acquired := make(chan struct{}) + go func() { + close(started) + err := lock.Lock() + close(acquired) + lock.Unlock() + c.Assert(err, gc.IsNil) + }() + + select { + case <-started: + // good, goroutine started. + case <-time.After(shortWait * 2): + c.Fatalf("timeout waiting for goroutine to start") + } + + // Waiting for something not to happen is inherently hard... + select { + case <-acquired: + c.Fatalf("Unexpected lock acquisition") + case <-time.After(shortWait * 2): + // all good. + } +} + +func (s *fslockSuite) TestTryLock(c *gc.C) { + lock := fslock.New(filepath.Join(c.MkDir(), "testing")) + + err := lock.TryLock() + c.Assert(err, gc.IsNil) + lock.Unlock() +} + +func (s *fslockSuite) TestTryLockNoBlock(c *gc.C) { + path := filepath.Join(c.MkDir(), "testing") + lock := fslock.New(path) + + kill := make(chan struct{}) + + // this will block until the other process has the lock. + procDone := LockFromAnotherProc(c, path, kill) + + defer func() { + close(kill) + // now wait for the other process to exit so the file will be unlocked. + select { + case <-procDone: + case <-time.After(time.Second): + } + }() + + started := make(chan struct{}) + result := make(chan error) + go func() { + close(started) + result <- lock.TryLock() + }() + + select { + case <-started: + // good, goroutine started. + case <-time.After(shortWait): + c.Fatalf("timeout waiting for goroutine to start") + } + + // Wait for trylock to fail. + select { + case err := <-result: + // yes, I know this is redundant with the assert below, but it makes the + // failed test message clearer. + if err == nil { + c.Fatalf("lock succeeded, but should have errored out") + } + // This should be the error from trylock failing. + c.Assert(err, gc.Equals, fslock.ErrLocked) + case <-time.After(shortWait): + c.Fatalf("took too long to fail trylock") + } +} + +func (s *fslockSuite) TestUnlockedWithTimeout(c *gc.C) { + lock := fslock.New(filepath.Join(c.MkDir(), "testing")) + + err := lock.LockWithTimeout(shortWait) + c.Assert(err, gc.IsNil) + lock.Unlock() +} + +func (s *fslockSuite) TestLockWithTimeout(c *gc.C) { + path := filepath.Join(c.MkDir(), "testing") + lock := fslock.New(path) + defer lock.Unlock() + + kill := make(chan struct{}) + + // this will block until the other process has the lock. + procDone := LockFromAnotherProc(c, path, kill) + + defer func() { + close(kill) + // now wait for the other process to exit so the file will be unlocked. + select { + case <-procDone: + case <-time.After(time.Second): + } + }() + + started := make(chan struct{}) + result := make(chan error) + go func() { + close(started) + result <- lock.LockWithTimeout(shortWait) + }() + + select { + case <-started: + // good, goroutine started. + case <-time.After(shortWait * 2): + c.Fatalf("timeout waiting for goroutine to start") + } + + // Wait for timeout. + select { + case err := <-result: + // yes, I know this is redundant with the assert below, but it makes the + // failed test message clearer. + if err == nil { + c.Fatalf("lock succeeded, but should have timed out") + } + // This should be the error from the lock timing out. + c.Assert(err, gc.Equals, fslock.ErrTimeout) + case <-time.After(shortWait * 2): + c.Fatalf("lock took too long to timeout") + } +} + +func (s *fslockSuite) TestStress(c *gc.C) { + const lockAttempts = 200 + const concurrentLocks = 10 + + var counter = new(int64) + // Use atomics to update lockState to make sure the lock isn't held by + // someone else. A value of 1 means locked, 0 means unlocked. + var lockState = new(int32) + + var wg sync.WaitGroup + + dir := c.MkDir() + + var stress = func(name string) { + defer wg.Done() + lock := fslock.New(filepath.Join(dir, "testing")) + for i := 0; i < lockAttempts; i++ { + err := lock.Lock() + c.Assert(err, gc.IsNil) + state := atomic.AddInt32(lockState, 1) + c.Assert(state, gc.Equals, int32(1)) + // Tell the go routine scheduler to give a slice to someone else + // while we have this locked. + runtime.Gosched() + // need to decrement prior to unlock to avoid the race of someone + // else grabbing the lock before we decrement the state. + atomic.AddInt32(lockState, -1) + err = lock.Unlock() + c.Assert(err, gc.IsNil) + // increment the general counter + atomic.AddInt64(counter, 1) + } + } + + for i := 0; i < concurrentLocks; i++ { + wg.Add(1) + go stress(fmt.Sprintf("Lock %d", i)) + } + wg.Wait() + c.Assert(*counter, gc.Equals, int64(lockAttempts*concurrentLocks)) +} + +// LockFromAnotherProc will launch a process and block until that process has +// created the lock file. If we time out waiting for the other process to take +// the lock, this function will fail the current test. +func LockFromAnotherProc(c *gc.C, path string, kill chan struct{}) (done chan struct{}) { + cmd := exec.Command(os.Args[0], "-test.run", "TestLockFromOtherProcess") + cmd.Env = append( + // We must preserve os.Environ() on Windows, + // or the subprocess will fail in weird and + // wonderful ways. + os.Environ(), + "FSLOCK_TEST_HELPER_WANTED=1", + "FSLOCK_TEST_HELPER_PATH="+path, + ) + + if err := cmd.Start(); err != nil { + c.Fatalf("error starting other proc: %v", err) + } + + done = make(chan struct{}) + + go func() { + cmd.Wait() + close(done) + }() + + go func() { + select { + case <-kill: + // this may fail, but there's not much we can do about it + _ = cmd.Process.Kill() + case <-done: + } + }() + + for x := 0; x < 10; x++ { + time.Sleep(shortWait) + if _, err := os.Stat(path); err == nil { + // file created by other process, let's continue + break + } + if x == 9 { + c.Fatalf("timed out waiting for other process to start") + } + } + return done +} + +func TestLockFromOtherProcess(t *testing.T) { + if os.Getenv("FSLOCK_TEST_HELPER_WANTED") == "" { + return + } + filename := os.Getenv("FSLOCK_TEST_HELPER_PATH") + lock := fslock.New(filename) + err := lock.Lock() + if err != nil { + fmt.Fprintf(os.Stderr, "error locking %q: %v", filename, err) + os.Exit(1) + } + time.Sleep(longWait) + err = lock.Unlock() + if err != nil { + fmt.Fprintf(os.Stderr, "error unlocking %q: %v", filename, err) + os.Exit(1) + } + os.Exit(0) +} diff --git a/test/integration/licenses/github.com/juju/fslock/fslock_windows.go b/test/integration/licenses/github.com/juju/fslock/fslock_windows.go new file mode 100644 index 0000000000..f29b00e4b4 --- /dev/null +++ b/test/integration/licenses/github.com/juju/fslock/fslock_windows.go @@ -0,0 +1,165 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package fslock + +import ( + "log" + "syscall" + "time" + "unsafe" +) + +var ( + modkernel32 = syscall.NewLazyDLL("kernel32.dll") + procLockFileEx = modkernel32.NewProc("LockFileEx") + procCreateEventW = modkernel32.NewProc("CreateEventW") +) + +const ( + lockfileExclusiveLock = 2 + fileFlagNormal = 0x00000080 +) + +func init() { + log.SetFlags(log.Lmicroseconds | log.Ldate) +} + +// Lock implements cross-process locks using syscalls. +// This implementation is based on LockFileEx syscall. +type Lock struct { + filename string + handle syscall.Handle +} + +// New returns a new lock around the given file. +func New(filename string) *Lock { + return &Lock{filename: filename} +} + +// TryLock attempts to lock the lock. This method will return ErrLocked +// immediately if the lock cannot be acquired. +func (l *Lock) TryLock() error { + err := l.LockWithTimeout(0) + if err == ErrTimeout { + // in our case, timing out immediately just means it was already locked. + return ErrLocked + } + return err +} + +// Lock locks the lock. This call will block until the lock is available. +func (l *Lock) Lock() error { + return l.LockWithTimeout(-1) +} + +// Unlock unlocks the lock. +func (l *Lock) Unlock() error { + return syscall.Close(l.handle) +} + +// LockWithTimeout tries to lock the lock until the timeout expires. If the +// timeout expires, this method will return ErrTimeout. +func (l *Lock) LockWithTimeout(timeout time.Duration) (err error) { + name, err := syscall.UTF16PtrFromString(l.filename) + if err != nil { + return err + } + + // Open for asynchronous I/O so that we can timeout waiting for the lock. + // Also open shared so that other processes can open the file (but will + // still need to lock it). + handle, err := syscall.CreateFile( + name, + syscall.GENERIC_READ, + syscall.FILE_SHARE_READ, + nil, + syscall.OPEN_ALWAYS, + syscall.FILE_FLAG_OVERLAPPED|fileFlagNormal, + 0) + if err != nil { + return err + } + l.handle = handle + defer func() { + if err != nil { + syscall.Close(handle) + } + }() + + millis := uint32(syscall.INFINITE) + if timeout >= 0 { + millis = uint32(timeout.Nanoseconds() / 1000000) + } + + ol, err := newOverlapped() + if err != nil { + return err + } + defer syscall.CloseHandle(ol.HEvent) + err = lockFileEx(handle, lockfileExclusiveLock, 0, 1, 0, ol) + if err == nil { + return nil + } + + // ERROR_IO_PENDING is expected when we're waiting on an asychronous event + // to occur. + if err != syscall.ERROR_IO_PENDING { + return err + } + s, err := syscall.WaitForSingleObject(ol.HEvent, millis) + + switch s { + case syscall.WAIT_OBJECT_0: + // success! + return nil + case syscall.WAIT_TIMEOUT: + return ErrTimeout + default: + return err + } +} + +// newOverlapped creates a structure used to track asynchronous +// I/O requests that have been issued. +func newOverlapped() (*syscall.Overlapped, error) { + event, err := createEvent(nil, true, false, nil) + if err != nil { + return nil, err + } + return &syscall.Overlapped{HEvent: event}, nil +} + +func lockFileEx(h syscall.Handle, flags, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { + r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, uintptr(h), uintptr(flags), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol))) + if r1 == 0 { + if e1 != 0 { + err = error(e1) + } else { + err = syscall.EINVAL + } + } + return +} + +func createEvent(sa *syscall.SecurityAttributes, manualReset bool, initialState bool, name *uint16) (handle syscall.Handle, err error) { + var _p0 uint32 + if manualReset { + _p0 = 1 + } + var _p1 uint32 + if initialState { + _p1 = 1 + } + + r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(sa)), uintptr(_p0), uintptr(_p1), uintptr(unsafe.Pointer(name)), 0, 0) + handle = syscall.Handle(r0) + if handle == syscall.InvalidHandle { + if e1 != 0 { + err = error(e1) + } else { + err = syscall.EINVAL + } + } + return +} diff --git a/test/integration/licenses/github.com/juju/mutex/LICENSE b/test/integration/licenses/github.com/juju/mutex/LICENSE new file mode 100644 index 0000000000..ade9307b39 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/LICENSE @@ -0,0 +1,191 @@ +All files in this repository are licensed as follows. If you contribute +to this repository, it is assumed that you license your contribution +under the same license unless you state otherwise. + +All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. + +This software is licensed under the LGPLv3, included below. + +As a special exception to the GNU Lesser General Public License version 3 +("LGPL3"), the copyright holders of this Library give you permission to +convey to a third party a Combined Work that links statically or dynamically +to this Library without providing any Minimal Corresponding Source or +Minimal Application Code as set out in 4d or providing the installation +information set out in section 4e, provided that you comply with the other +provisions of LGPL3 and provided that you meet, for the Application the +terms and conditions of the license(s) which apply to the Application. + +Except as stated in this special exception, the provisions of LGPL3 will +continue to comply in full to this Library. If you modify this Library, you +may apply this exception to your version of this Library, but you are not +obliged to do so. If you do not wish to do so, delete this exception +statement from your version. This exception does not (and cannot) modify any +license terms which apply to the Application, with which you must still +comply. + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/test/integration/licenses/github.com/juju/mutex/Makefile b/test/integration/licenses/github.com/juju/mutex/Makefile new file mode 100644 index 0000000000..a33c434b45 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/Makefile @@ -0,0 +1,20 @@ +PROJECT := github.com/juju/mutex/v2 + +.PHONY: check-licence check-go check + +check: check-licence check-go + go test $(PROJECT)/... + +check-licence: + @(fgrep -rl "Licensed under the LGPLv3" .;\ + fgrep -rl "Code generated by MockGen. DO NOT EDIT." .;\ + find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ + xargs -I {} echo FAIL: licence missed: {} + +check-go: + $(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g"))) + @(if [ x$(GOFMT) != x"" ]; then \ + echo go fmt is sad: $(GOFMT); \ + exit 1; \ + fi ) + @(go vet -all -composites=false -copylocks=false .) diff --git a/test/integration/licenses/github.com/juju/mutex/README.md b/test/integration/licenses/github.com/juju/mutex/README.md new file mode 100644 index 0000000000..8c25248bef --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/README.md @@ -0,0 +1,147 @@ + + +# mutex +`import "github.com/juju/mutex/v2"` + +* [Overview](#pkg-overview) +* [Index](#pkg-index) + +## Overview +package mutex provides a named machine level mutex shareable between processes. +[![GoDoc](https://godoc.org/github.com/juju/mutex?status.svg)](https://godoc.org/github.com/juju/mutex) + +Mutexes have names. Each each name, only one mutex for that name can be +acquired at the same time, within and across process boundaries. If a +process dies while the mutex is held, the mutex is automatically released. + +The Linux/MacOS implementation uses flock, while the Windows implementation +uses a named mutex. + + + + +## Index +* [Variables](#pkg-variables) +* [type Clock](#Clock) +* [type Releaser](#Releaser) + * [func Acquire(spec Spec) (Releaser, error)](#Acquire) +* [type Spec](#Spec) + * [func (s *Spec) Validate() error](#Spec.Validate) + + +#### Package files +[doc.go](/src/github.com/juju/mutex/doc.go) [errors.go](/src/github.com/juju/mutex/errors.go) [legacy_mutex_linux.go](/src/github.com/juju/mutex/legacy_mutex_linux.go) [mutex.go](/src/github.com/juju/mutex/mutex.go) [mutex_flock.go](/src/github.com/juju/mutex/mutex_flock.go) + + + +## Variables +``` go +var ( + ErrTimeout = errors.New("timeout acquiring mutex") + ErrCancelled = errors.New("cancelled acquiring mutex") +) +``` + + + +## type [Clock](/src/target/mutex.go?s=682:907#L28) +``` go +type Clock interface { + // After waits for the duration to elapse and then sends the + // current time on the returned channel. + After(time.Duration) <-chan time.Time + + // Now returns the current clock time. + Now() time.Time +} +``` +Clock provides an interface for dealing with clocks. + + + + + + + + + + +## type [Releaser](/src/target/mutex.go?s=337:624#L19) +``` go +type Releaser interface { + // Release releases the mutex. Release may be called multiple times, but + // only the first call will release this instance of the mutex. Release is + // unable to release the mutex successfully it will call panic to forcibly + // release the mutex. + Release() +} +``` +Releaser defines the Release method that is the only thing that can be done +to a acquired mutex. + + + + + + + +### func [Acquire](/src/target/mutex.go?s=1757:1798#L61) +``` go +func Acquire(spec Spec) (Releaser, error) +``` +Acquire will attempt to acquire the named mutex. If the Timout value +is hit, ErrTimeout is returned. If the Cancel channel is signalled, +ErrCancelled is returned. + + + + + +## type [Spec](/src/target/mutex.go?s=986:1583#L38) +``` go +type Spec struct { + // Name is required, and must start with a letter and contain at most + // 40 letters, numbers or dashes. + Name string + + // Clock must be provided and is exposed for testing purposes. + Clock Clock + + // Delay defines how often to check for lock acquisition, for + // compatibility code that requires polling. + Delay time.Duration + + // Timeout allows the caller to specify how long to wait. If Timeout + // is zero, then the call will block forever. + Timeout time.Duration + + // Cancel if signalled will cause the Acquire method to return with ErrCancelled. + Cancel <-chan struct{} +} +``` +Spec defines the name of the mutex and behaviour of the Acquire function. + + + + + + + + + + +### func (\*Spec) [Validate](/src/target/mutex.go?s=2640:2671#L105) +``` go +func (s *Spec) Validate() error +``` +Validate checks the attributes of Spec for validity. + + + + + + + + +- - - +Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) diff --git a/test/integration/licenses/github.com/juju/mutex/doc.go b/test/integration/licenses/github.com/juju/mutex/doc.go new file mode 100644 index 0000000000..103836f7d5 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/doc.go @@ -0,0 +1,16 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +/* +package mutex provides a named machine level mutex shareable between processes. +[godoc-link-here] + +Mutexes have names. Each each name, only one mutex for that name can be +acquired at the same time, within and across process boundaries. If a +process dies while the mutex is held, the mutex is automatically released. + +The Linux/MacOS implementation uses flock, while the Windows implementation +uses a named mutex. On Linux, we also acquire an abstract domain socket for +compatibility with older implementations. +*/ +package mutex diff --git a/test/integration/licenses/github.com/juju/mutex/errors.go b/test/integration/licenses/github.com/juju/mutex/errors.go new file mode 100644 index 0000000000..0f10799005 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/errors.go @@ -0,0 +1,13 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package mutex + +import ( + "github.com/juju/errors" +) + +var ( + ErrTimeout = errors.New("timeout acquiring mutex") + ErrCancelled = errors.New("cancelled acquiring mutex") +) diff --git a/test/integration/licenses/github.com/juju/mutex/export_test.go b/test/integration/licenses/github.com/juju/mutex/export_test.go new file mode 100644 index 0000000000..06da9106cf --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/export_test.go @@ -0,0 +1,9 @@ +// Copyright 2016-2017 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package mutex + +var ( + // Export the Envars so we can test it via mocks + Envars = &envars +) diff --git a/test/integration/licenses/github.com/juju/mutex/go.mod b/test/integration/licenses/github.com/juju/mutex/go.mod new file mode 100644 index 0000000000..448a60c46f --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/go.mod @@ -0,0 +1,25 @@ +module github.com/juju/mutex/v2 + +go 1.17 + +require ( + github.com/golang/mock v1.5.0 + github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 + github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c +) + +require ( + github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c // indirect + github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 // indirect + github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 // indirect + github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 // indirect + github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect + github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a // indirect + github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 // indirect + github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect + golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect + golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) diff --git a/test/integration/licenses/github.com/juju/mutex/go.sum b/test/integration/licenses/github.com/juju/mutex/go.sum new file mode 100644 index 0000000000..60ab53e100 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/go.sum @@ -0,0 +1,101 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= +github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= +github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c h1:3UvYABOQRhJAApj9MdCN+Ydv841ETSoy6xLzdmmr/9A= +github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= +github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= +github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 h1:4R626WTwa7pRYQFiIRLVPepMhm05eZMEx+wIurRnMLc= +github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= +github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 h1:EJHbsNpQyupmMeWTq7inn+5L/WZ7JfzCVPJ+DP9McCQ= +github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9/go.mod h1:TRm7EVGA3mQOqSVcBySRY7a9Y1/gyVhh/WTCnc5sD4U= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= +github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 h1:NO5tuyw++EGLnz56Q8KMyDZRwJwWO8jQnj285J3FOmY= +github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= +github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= +github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= +github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a h1:fFpWkIPzpzxd3CC+qfU5adsawpG371Ie4TmRkhxwyNU= +github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= +github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU= +github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= +github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= +github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6/go.mod h1:QgWc2UdIPJ8t3rnvv95tFNOsQDfpXYEZDbP281o3b2c= +github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 h1:XEDzpuZb8Ma7vLja3+5hzUqVTvAqm5Y+ygvnDs5iTMM= +github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494/go.mod h1:rUquetT0ALL48LHZhyRGvjjBH8xZaZ8dFClulKK5wK4= +github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= +github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647 h1:wQpkHVbIIpz1PCcLYku9KFWsJ7aEMQXHBBmLy3tRBTk= +github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= +github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= +github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a h1:5ZWDCeCF0RaITrZGemzmDFIhjR/MVSvBUqgSyaeTMbE= +github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= +github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6 h1:nrqc9b4YKpKV4lPI3GPPFbo5FUuxkWxgZE2Z8O4lgaw= +github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 h1:wtEPbidt1VyHlb8RSztU6ySQj29FLsOQiI9XiJhXDM4= +github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23/go.mod h1:Ljlbryh9sYaUSGXucslAEDf0A2XUSGvDbHJgW8ps6nc= +github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= +github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= +github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= +github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= +github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +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/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= +gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= +gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= +gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +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= +launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= +launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= diff --git a/test/integration/licenses/github.com/juju/mutex/mutex.go b/test/integration/licenses/github.com/juju/mutex/mutex.go new file mode 100644 index 0000000000..0cca9bb652 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/mutex.go @@ -0,0 +1,92 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package mutex + +import ( + "regexp" + "time" + + "github.com/juju/errors" +) + +var ( + validName = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]*$") +) + +// Releaser defines the Release method that is the only thing that can be done +// to a acquired mutex. +type Releaser interface { + // Release releases the mutex. Release may be called multiple times, but + // only the first call will release this instance of the mutex. Release is + // unable to release the mutex successfully it will call panic to forcibly + // release the mutex. + Release() +} + +// Clock provides an interface for dealing with clocks. +type Clock interface { + // After waits for the duration to elapse and then sends the + // current time on the returned channel. + After(time.Duration) <-chan time.Time + + // Now returns the current clock time. + Now() time.Time +} + +// Spec defines the name of the mutex and behaviour of the Acquire function. +type Spec struct { + // Name is required, and must start with a letter and contain at most + // 40 letters, numbers or dashes. + Name string + + // Clock must be provided and is exposed for testing purposes. + Clock Clock + + // Delay defines how often to check for lock acquisition, for + // compatibility code that requires polling. + Delay time.Duration + + // Timeout allows the caller to specify how long to wait. If Timeout + // is zero, then the call will block forever. + Timeout time.Duration + + // Cancel if signalled will cause the Acquire method to return with ErrCancelled. + Cancel <-chan struct{} +} + +// Acquire will attempt to acquire the named mutex. If the Timout value +// is hit, ErrTimeout is returned. If the Cancel channel is signalled, +// ErrCancelled is returned. +func Acquire(spec Spec) (Releaser, error) { + if err := spec.Validate(); err != nil { + return nil, errors.Trace(err) + } + + var timeout <-chan time.Time + if spec.Timeout > 0 { + timeout = spec.Clock.After(spec.Timeout) + } + + return acquire(spec, timeout) +} + +// Validate checks the attributes of Spec for validity. +func (s *Spec) Validate() error { + if len(s.Name) > 40 { + return errors.NotValidf("Name longer than 40 characters") + } + if !validName.MatchString(s.Name) { + return errors.NotValidf("Name %q", s.Name) + } + if s.Clock == nil { + return errors.NotValidf("missing Clock") + } + if s.Delay <= 0 { + return errors.NotValidf("non positive Delay") + } + if s.Timeout < 0 { + return errors.NotValidf("negative Timeout") + } + return nil +} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_flock.go b/test/integration/licenses/github.com/juju/mutex/mutex_flock.go new file mode 100644 index 0000000000..73f76ccc25 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/mutex_flock.go @@ -0,0 +1,202 @@ +// Copyright 2016-2017 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +//go:build !windows +// +build !windows + +package mutex + +import ( + "os" + "path/filepath" + "strconv" + "sync" + "syscall" + "time" + + "github.com/juju/errors" +) + +func acquire(spec Spec, timeout <-chan time.Time) (Releaser, error) { + done := make(chan struct{}) + defer close(done) + select { + case result := <-acquireFlock(spec.Name, done): + if result.err != nil { + return nil, errors.Trace(result.err) + } + return result.m, nil + case <-timeout: + return nil, ErrTimeout + case <-spec.Cancel: + return nil, ErrCancelled + } +} + +var envars Environment = osEnvironment{} + +var ( + mu sync.Mutex + active = make(map[string][]*waiter) +) + +type waiter struct { + ch chan<- acquireResult + done <-chan struct{} +} + +type acquireResult struct { + m Releaser + err error +} + +// acquireFlock returns a channel on which an acquireResult will be +// sent when the mutex acquisition completes, successfully or not. +// +// In Go, there is no natural way to cancel a flock syscall, so we +// allow a flock syscall to continue on even when there is nothing +// waiting for it, and then release the lock in that case. To avoid +// an unbounded collection of goroutines, we ensure that there is +// only one goroutine making a flock syscall at a time, per mutex +// name. +func acquireFlock(name string, done <-chan struct{}) <-chan acquireResult { + result := make(chan acquireResult) + w := &waiter{result, done} + + mu.Lock() + defer mu.Unlock() + if waiters, ok := active[name]; ok { + active[name] = append(waiters, w) + return result + } + + flockName := filepath.Join(os.TempDir(), "juju-"+name) + chownFromRoot := func() error { + if cmd, ok := envars.LookupEnv("SUDO_COMMAND"); ok && cmd != "" { + var uid, gid int + uid, err := strconv.Atoi(envars.Getenv("SUDO_UID")) + if err != nil { + return errors.Annotate(err, "parsing SUDO_UID") + } + gid, err = strconv.Atoi(envars.Getenv("SUDO_GID")) + if err != nil { + return errors.Annotate(err, "parsing SUDO_GID") + } + return syscall.Chown(flockName, uid, gid) + } + return nil + } + open := func() (int, error) { + fd, err := syscall.Open(flockName, syscall.O_CREAT|syscall.O_RDONLY|syscall.O_CLOEXEC, 0600) + if err != nil { + if os.IsPermission(err) { + err = errors.Annotatef(err, "unable to open %s", flockName) + } + return fd, err + } + // Attempting to open a lock file as root whilst using sudo can cause + // the lock file to have the wrong permissions for a non-sudo user. + // Subsequent calls to acquire the lock file can then lead to cryptic + // error messages. Let's attempt to help people out, either by + // correcting the permissions, or explaining why we can't help them. + // info: lp 1758369 + if chownErr := chownFromRoot(); chownErr != nil { + // The file has the wrong permissions, but we should let the acquire + // continue. + } + return fd, err + } + flock := func() (Releaser, error) { + fd, err := open() + if err != nil { + return nil, errors.Trace(err) + } + if err := syscall.Flock(fd, syscall.LOCK_EX); err != nil { + syscall.Close(fd) + return nil, errors.Trace(err) + } + return &mutex{fd: fd}, nil + } + acquire := func() bool { + releaser, err := flock() + result := acquireResult{releaser, err} + mu.Lock() + defer mu.Unlock() + + var sent bool + waiters := active[name] + for !sent && len(waiters) > 0 { + w, waiters = waiters[0], waiters[1:] + select { + case w.ch <- result: + sent = true + case <-w.done: + // waiter is done, so just + // remove it from the list + // and try the next one + } + } + if !sent && releaser != nil { + // No active waiters, release the lock. + releaser.Release() + } + if len(waiters) > 0 { + active[name] = waiters + return true + } + delete(active, name) + return false + } + go func() { + for acquire() { + } + }() + + active[name] = []*waiter{w} + return result +} + +// mutex implements Releaser using the flock syscall. +type mutex struct { + mu sync.Mutex + fd int +} + +// Release is part of the Releaser interface. +func (m *mutex) Release() { + m.mu.Lock() + defer m.mu.Unlock() + if m.fd == 0 { + return + } + err := syscall.Close(m.fd) + if err != nil { + panic(err) + } + m.fd = 0 +} + +// Environment defines a simple interface with interacting with environmental +// variables. +//go:generate mockgen -package mutex_test -destination mutex_mock_test.go github.com/juju/mutex Environment +type Environment interface { + + // LookupEnv retrieves the value of the environment variable named + // by the key. + LookupEnv(string) (string, bool) + + // Getenv retrieves the value of the environment variable named by the key. + Getenv(string) string +} + +// osEnvironment provides a default way to access environmental values to the +// acquire method. +type osEnvironment struct{} + +func (osEnvironment) LookupEnv(key string) (string, bool) { + return os.LookupEnv(key) +} + +func (osEnvironment) Getenv(key string) string { + return os.Getenv(key) +} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go b/test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go new file mode 100644 index 0000000000..ce34941b86 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go @@ -0,0 +1,58 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/juju/mutex (interfaces: Environment) + +// Package mutex_test is a generated GoMock package. +package mutex_test + +import ( + gomock "github.com/golang/mock/gomock" + reflect "reflect" +) + +// MockEnvironment is a mock of Environment interface +type MockEnvironment struct { + ctrl *gomock.Controller + recorder *MockEnvironmentMockRecorder +} + +// MockEnvironmentMockRecorder is the mock recorder for MockEnvironment +type MockEnvironmentMockRecorder struct { + mock *MockEnvironment +} + +// NewMockEnvironment creates a new mock instance +func NewMockEnvironment(ctrl *gomock.Controller) *MockEnvironment { + mock := &MockEnvironment{ctrl: ctrl} + mock.recorder = &MockEnvironmentMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockEnvironment) EXPECT() *MockEnvironmentMockRecorder { + return m.recorder +} + +// Getenv mocks base method +func (m *MockEnvironment) Getenv(arg0 string) string { + ret := m.ctrl.Call(m, "Getenv", arg0) + ret0, _ := ret[0].(string) + return ret0 +} + +// Getenv indicates an expected call of Getenv +func (mr *MockEnvironmentMockRecorder) Getenv(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Getenv", reflect.TypeOf((*MockEnvironment)(nil).Getenv), arg0) +} + +// LookupEnv mocks base method +func (m *MockEnvironment) LookupEnv(arg0 string) (string, bool) { + ret := m.ctrl.Call(m, "LookupEnv", arg0) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(bool) + return ret0, ret1 +} + +// LookupEnv indicates an expected call of LookupEnv +func (mr *MockEnvironmentMockRecorder) LookupEnv(arg0 interface{}) *gomock.Call { + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LookupEnv", reflect.TypeOf((*MockEnvironment)(nil).LookupEnv), arg0) +} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_test.go b/test/integration/licenses/github.com/juju/mutex/mutex_test.go new file mode 100644 index 0000000000..8438cc70c8 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/mutex_test.go @@ -0,0 +1,526 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package mutex_test + +import ( + "fmt" + "net" + "os" + "os/exec" + "os/user" + "path/filepath" + "runtime" + "sync" + "sync/atomic" + "syscall" + "testing" + "time" + + "github.com/golang/mock/gomock" + + jt "github.com/juju/testing" + jc "github.com/juju/testing/checkers" + gc "gopkg.in/check.v1" + + "github.com/juju/mutex/v2" +) + +const ( + shortWait = 10 * time.Millisecond + longWait = 10 * shortWait + appWait = 5 * time.Second +) + +type mutexSuite struct{} + +var _ = gc.Suite(&mutexSuite{}) + +func (s *mutexSuite) TestSpecValidity(c *gc.C) { + for i, test := range []struct { + spec mutex.Spec + err string + }{{ + spec: mutex.Spec{Name: "", Clock: &fakeClock{}, Delay: time.Millisecond}, + err: `Name "" not valid`, + }, { + spec: mutex.Spec{Name: "42", Clock: &fakeClock{}, Delay: time.Millisecond}, + err: `Name "42" not valid`, + }, { + spec: mutex.Spec{Name: "a", Clock: &fakeClock{}, Delay: time.Millisecond}, + }, { + spec: mutex.Spec{Name: "a very very long name that is over the length limit", Clock: &fakeClock{}, Delay: time.Millisecond}, + err: `Name longer than 40 characters not valid`, + }, { + spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}, Delay: time.Millisecond}, + }, { + spec: mutex.Spec{Name: "with a space", Clock: &fakeClock{}, Delay: time.Millisecond}, + err: `Name "with a space" not valid`, + }, { + spec: mutex.Spec{Name: "test-42", Delay: time.Millisecond}, + err: `missing Clock not valid`, + }, { + spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}}, + err: `non positive Delay not valid`, + }, { + spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}, Delay: -time.Second}, + err: `non positive Delay not valid`, + }, { + spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}, Delay: time.Millisecond, Timeout: -time.Second}, + err: `negative Timeout not valid`, + }} { + c.Logf("test %d", i+1) + err := test.spec.Validate() + if test.err == "" { + c.Check(err, jc.ErrorIsNil) + } else { + c.Check(err, gc.ErrorMatches, test.err) + } + } +} + +func (s *mutexSuite) spec() mutex.Spec { + // On the off chance there are multiple tests running, we shouldn't + // clash on the lock name. + return mutex.Spec{ + Name: fmt.Sprintf("testing-%d", os.Getpid()), + Clock: &fakeClock{time.Millisecond}, + Delay: 10 * time.Second, + } +} + +func (s *mutexSuite) TestLockNoContention(c *gc.C) { + r, err := mutex.Acquire(s.spec()) + c.Assert(err, jc.ErrorIsNil) + r.Release() +} + +func (s *mutexSuite) TestLockContentionWithinProcessTimeout(c *gc.C) { + spec := s.spec() + spec.Timeout = time.Millisecond + + r, err := mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + defer r.Release() + + second, err := mutex.Acquire(spec) + c.Assert(second, gc.IsNil) + c.Assert(err, gc.Equals, mutex.ErrTimeout) +} + +func (s *mutexSuite) TestLockAfterTimeout(c *gc.C) { + spec := s.spec() + spec.Timeout = time.Nanosecond + + r, err := mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + defer r.Release() + + _, err = mutex.Acquire(spec) + c.Assert(err, gc.Equals, mutex.ErrTimeout) + + r.Release() + + r, err = mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + r.Release() +} + +func (s *mutexSuite) TestLockContentionWithinProcessCancel(c *gc.C) { + cancel := make(chan struct{}) + done := make(chan struct{}) + + spec := s.spec() + spec.Cancel = cancel + + r, err := mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + defer r.Release() + + go func() { + second, err := mutex.Acquire(spec) + c.Check(second, gc.IsNil) + c.Check(err, gc.Equals, mutex.ErrCancelled) + close(done) + }() + + close(cancel) + <-done +} + +func (s *mutexSuite) TestSecondReleaseFine(c *gc.C) { + r, err := mutex.Acquire(s.spec()) + c.Assert(err, jc.ErrorIsNil) + r.Release() + r.Release() +} + +func (s *mutexSuite) TestDifferentNamesDontBlock(c *gc.C) { + spec1 := s.spec() + spec2 := spec1 + spec2.Name = fmt.Sprintf("other-%d", os.Getpid()) + + r1, err := mutex.Acquire(spec1) + c.Assert(err, jc.ErrorIsNil) + defer r1.Release() + + r2, err := mutex.Acquire(spec2) + c.Assert(err, jc.ErrorIsNil) + defer r2.Release() +} + +func (s *mutexSuite) TestLockBlocks(c *gc.C) { + kill := make(chan struct{}) + spec := s.spec() + // this will block until the other process has the lock. + remote := LockFromAnotherProc(c, spec.Name, kill, true, true) + + acquired := make(chan struct{}) + done := make(chan struct{}) + go func() { + r, err := mutex.Acquire(spec) + if c.Check(err, gc.IsNil) { + close(acquired) + r.Release() + } + close(done) + }() + + // Waiting for something not to happen is inherently hard... + select { + case <-acquired: + c.Fatalf("Unexpected lock acquisition") + case <-time.After(shortWait * 2): + // all good. + } + close(kill) + <-done + <-remote +} + +func (s *mutexSuite) TestProcessReleasesWhenDead(c *gc.C) { + spec := s.spec() + kill := make(chan struct{}) + + // this will block until the other process has the lock. + remote := LockFromAnotherProc(c, spec.Name, kill, false, false) + + acquired := make(chan struct{}) + done := make(chan struct{}) + go func() { + r, err := mutex.Acquire(spec) + if c.Check(err, gc.IsNil) { + close(acquired) + r.Release() + } + close(done) + }() + + close(kill) + + select { + case <-acquired: + // all good. + case <-time.After(appWait): + c.Fatalf("timout waiting for mutex to be acquired") + } + <-done + <-remote +} + +func (s *mutexSuite) TestStress(c *gc.C) { + const lockAttempts = 200 + const concurrentLocks = 10 + + var counter = new(int64) + // Use atomics to update lockState to make sure the lock isn't held by + // someone else. A value of 1 means locked, 0 means unlocked. + var lockState = new(int32) + + var wg sync.WaitGroup + + spec := s.spec() + var stress = func() { + defer wg.Done() + for i := 0; i < lockAttempts; i++ { + r, err := mutex.Acquire(spec) + if !c.Check(err, jc.ErrorIsNil) { + return + } + state := atomic.AddInt32(lockState, 1) + if !c.Check(state, gc.Equals, int32(1)) { + return + } + // Tell the go routine scheduler to give a slice to someone else + // while we have this locked. + runtime.Gosched() + // need to decrement prior to unlock to avoid the race of someone + // else grabbing the lock before we decrement the state. + atomic.AddInt32(lockState, -1) + r.Release() + // increment the general counter + atomic.AddInt64(counter, 1) + } + } + + for i := 0; i < concurrentLocks; i++ { + wg.Add(1) + go stress() + } + wg.Wait() + c.Assert(*counter, gc.Equals, int64(lockAttempts*concurrentLocks)) +} + +// TestMutexNotInherited tests that subprocesses do not inherit mutexes. +func (s *mutexSuite) TestMutexNotInherited(c *gc.C) { + spec := s.spec() + r, err := mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + defer r.Release() + + kill := make(chan struct{}) + SleepFromAnotherProc(c, kill) + defer close(kill) + r.Release() + + // We should be able to acquire again now. + spec.Timeout = time.Nanosecond + r, err = mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + r.Release() +} + +// TestFilePermissions tests that the file permissions are correct. +func (s *mutexSuite) TestFilePermissions(c *gc.C) { + spec := s.spec() + r, err := mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + defer r.Release() + + filePath := filepath.Join(os.TempDir(), "juju-"+spec.Name) + fileInfo, err := os.Stat(filePath) + c.Assert(err, jc.ErrorIsNil) + + stat, ok := fileInfo.Sys().(*syscall.Stat_t) + c.Assert(ok, jc.IsTrue) + + current, err := user.Current() + c.Assert(err, jc.ErrorIsNil) + + c.Assert(fmt.Sprintf("%d", stat.Uid), gc.Equals, current.Uid) + c.Assert(fmt.Sprintf("%d", stat.Gid), gc.Equals, current.Gid) +} + +// TestFilePermissionsWithSudo tests that the file permissions are correct. +func (s *mutexSuite) TestFilePermissionsWithSudoEnvars(c *gc.C) { + ctrl := gomock.NewController(c) + defer ctrl.Finish() + + envion := NewMockEnvironment(ctrl) + + restore := jt.PatchValue(mutex.Envars, envion) + defer restore() + + current, err := user.Current() + c.Assert(err, jc.ErrorIsNil) + + exp := envion.EXPECT() + exp.LookupEnv("SUDO_COMMAND").Return("test", true) + exp.Getenv("SUDO_UID").Return(current.Uid) + exp.Getenv("SUDO_GID").Return(current.Gid) + + spec := s.spec() + r, err := mutex.Acquire(spec) + c.Assert(err, jc.ErrorIsNil) + defer r.Release() + + filePath := filepath.Join(os.TempDir(), "juju-"+spec.Name) + fileInfo, err := os.Stat(filePath) + c.Assert(err, jc.ErrorIsNil) + + stat, ok := fileInfo.Sys().(*syscall.Stat_t) + c.Assert(ok, jc.IsTrue) + + c.Assert(fmt.Sprintf("%d", stat.Uid), gc.Equals, current.Uid) + c.Assert(fmt.Sprintf("%d", stat.Gid), gc.Equals, current.Gid) +} + +// LockFromAnotherProc will launch a process and block until that process has +// created the lock file. If we time out waiting for the other process to take +// the lock, this function will fail the current test. +func LockFromAnotherProc(c *gc.C, name string, kill chan struct{}, wait, unlock bool) (done chan struct{}) { + listener, err := net.Listen("tcp", "localhost:0") + c.Assert(err, jc.ErrorIsNil) + defer listener.Close() + + cmd := exec.Command(os.Args[0], "-test.run", "TestLockFromOtherProcess") + cmd.Env = append( + // We must preserve os.Environ() on Windows, + // or the subprocess will fail in weird and + // wonderful ways. + os.Environ(), + "MUTEX_TEST_HELPER_WANTED=1", + "MUTEX_TEST_HELPER_NAME="+name, + "MUTEX_TEST_HELPER_ADDR="+listener.Addr().String(), + "MUTEX_TEST_HELPER_WAIT="+fmt.Sprint(unlock), + "MUTEX_TEST_HELPER_UNLOCK="+fmt.Sprint(unlock), + ) + cmd.Stderr = os.Stderr + cmd.Stdout = os.Stdout + if err := cmd.Start(); err != nil { + c.Fatalf("error starting other proc: %v", err) + } + + done = make(chan struct{}) + + go func() { + cmd.Wait() + close(done) + }() + + go func() { + select { + case <-kill: + // this may fail, but there's not much we can do about it + _ = cmd.Process.Kill() + case <-done: + } + }() + + haveLock := make(chan struct{}) + go func() { + conn, err := listener.Accept() + if c.Check(err, jc.ErrorIsNil) { + // Just close it, the signal is enough. + conn.Close() + close(haveLock) + } + }() + select { + case <-done: + c.Fatalf("other process failed before acquiring lock") + case <-haveLock: + // all good + case <-time.After(appWait): + c.Fatalf("other process failed to acquire lock") + } + + return done +} + +// SleepFromAnotherProc will launch a process and cause it to sleep +// for a minute, to prove that subprocesses do not inherit the mutex. +func SleepFromAnotherProc(c *gc.C, kill chan struct{}) (done chan struct{}) { + listener, err := net.Listen("tcp", "localhost:0") + c.Assert(err, jc.ErrorIsNil) + defer listener.Close() + + cmd := exec.Command(os.Args[0], "-test.run", "TestSleepFromOtherProcess") + cmd.Env = append( + // We must preserve os.Environ() on Windows, + // or the subprocess will fail in weird and + // wonderful ways. + os.Environ(), + "MUTEX_TEST_HELPER_WANTED=1", + "MUTEX_TEST_HELPER_ADDR="+listener.Addr().String(), + ) + cmd.Stderr = os.Stderr + cmd.Stdout = os.Stdout + c.Assert(cmd.Start(), jc.ErrorIsNil) + + done = make(chan struct{}) + go func() { + defer close(done) + cmd.Wait() + }() + go func() { + select { + case <-kill: + cmd.Process.Kill() + case <-done: + } + }() + + started := make(chan struct{}) + go func() { + conn, err := listener.Accept() + if c.Check(err, jc.ErrorIsNil) { + // Just close it, the signal is enough. + conn.Close() + close(started) + } + }() + select { + case <-started: + case <-done: + c.Fatalf("other process exited") + case <-time.After(appWait): + c.Fatalf("timed out waiting for other process to connect") + } + + return done +} + +func TestLockFromOtherProcess(t *testing.T) { + if os.Getenv("MUTEX_TEST_HELPER_WANTED") == "" { + return + } + + name := os.Getenv("MUTEX_TEST_HELPER_NAME") + unlock := os.Getenv("MUTEX_TEST_HELPER_UNLOCK") == "true" + wait := os.Getenv("MUTEX_TEST_HELPER_WAIT") == "true" + spec := mutex.Spec{ + Name: name, + Clock: &fakeClock{shortWait}, + Delay: shortWait, + } + + r, err := mutex.Acquire(spec) + if err != nil { + fmt.Fprintf(os.Stderr, "error acquiring mutex %q: %v", name, err) + os.Exit(1) + } + // Connect to the first process to let it know we have the connection. + addr := os.Getenv("MUTEX_TEST_HELPER_ADDR") + _, err = net.Dial("tcp", addr) + // We don't care about the connection because the server will just close the + // connection anyway. + if err != nil { + fmt.Fprintf(os.Stderr, "error notifying primary process: %v", err) + os.Exit(1) + } + + if wait { + time.Sleep(longWait) + } + if unlock { + r.Release() + } + os.Exit(0) +} + +func TestSleepFromOtherProcess(t *testing.T) { + if os.Getenv("MUTEX_TEST_HELPER_WANTED") == "" { + return + } + addr := os.Getenv("MUTEX_TEST_HELPER_ADDR") + _, err := net.Dial("tcp", addr) + if err != nil { + fmt.Fprintf(os.Stderr, "error notifying primary process: %v \n", err) + os.Exit(1) + } + time.Sleep(time.Minute) + os.Exit(0) +} + +type fakeClock struct { + delay time.Duration +} + +func (f *fakeClock) After(time.Duration) <-chan time.Time { + return time.After(f.delay) +} + +func (f *fakeClock) Now() time.Time { + return time.Now() +} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_windows.go b/test/integration/licenses/github.com/juju/mutex/mutex_windows.go new file mode 100644 index 0000000000..c4bba1ca2c --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/mutex_windows.go @@ -0,0 +1,262 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package mutex + +import ( + "runtime" + "sync" + "syscall" + "time" + "unsafe" + + "github.com/juju/errors" +) + +var ( + modkernel32 = syscall.NewLazyDLL("kernel32.dll") + procCreateMutex = modkernel32.NewProc("CreateMutexW") + procReleaseMutex = modkernel32.NewProc("ReleaseMutex") + procWaitForMultipleObjects = modkernel32.NewProc("WaitForMultipleObjects") + procCreateEvent = modkernel32.NewProc("CreateEventW") + procSetEvent = modkernel32.NewProc("SetEvent") +) + +const ( + _ERROR_ALREADY_EXISTS = 183 + _WAIT_OBJECT_0 = 0x00000000 + _WAIT_ABANDONED_0 = 0x00000080 + _WAIT_TIMEOUT = 0x00000102 + _INFINITE = 0xffffffff +) + +type mutex struct { + name string + mu sync.Mutex + release chan struct{} + released chan struct{} +} + +func acquire(spec Spec, timeoutCh <-chan time.Time) (Releaser, error) { + + // Avoid further work if the acquisition + // has already been cancelled. + select { + case <-spec.Cancel: + return nil, ErrCancelled + default: + } + + m := &mutex{ + name: spec.Name, + release: make(chan struct{}), + released: make(chan struct{}), + } + + releaseCh := m.release + errCh := make(chan error, 1) + go func() { + defer close(m.released) + + // ReleaseMutex must be called + // from the same OS thread that + // owns the mutex, i.e. the one + // that acquires it. + // + // Note that this also prevents + // any other goroutines from + // running on the same OS thread + // while the mutex is held, so + // we prevent reentrant lock + // acquisitions. + runtime.LockOSThread() + + handle, err := acquireMutex( + "juju-mutex-"+spec.Name, + spec.Timeout, + spec.Cancel, + ) + errCh <- err + if err != nil { + return + } + + // Wait until the mutex is Release()d, and + // then release and close the mutex. + <-releaseCh + + // NOTE(axw) it is not enough to just close + // the handle, it must be released first. + // It will only be abandoned when the OS + // thread underlying this goroutine exits. + // See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684266(v=vs.85).aspx + if err := releaseMutex(handle); err != nil { + panic(err) + } + if err := syscall.Close(handle); err != nil { + panic(err) + } + }() + if err := <-errCh; err != nil { + // The acquireMutex call failed, which means + // the goroutine will exit. Wait for it to + // clean up before returning. + <-m.released + return nil, err + } + return m, nil +} + +// Release implements Releaser. +func (m *mutex) Release() { + m.mu.Lock() + defer m.mu.Unlock() + if m.release != nil { + close(m.release) + m.release = nil + } + <-m.released +} + +func acquireMutex( + name string, + timeout time.Duration, + cancel <-chan struct{}, +) (syscall.Handle, error) { + mutexName, err := syscall.UTF16PtrFromString(name) + if err != nil { + return syscall.InvalidHandle, errors.Trace(err) + } + + result, _, errno := syscall.Syscall( + procCreateMutex.Addr(), 3, + uintptr(0), // attributes + uintptr(0), // initial owner + uintptr(unsafe.Pointer(mutexName)), + ) + if result == 0 { + if errno != 0 { + return syscall.InvalidHandle, errno + } + return syscall.InvalidHandle, syscall.EINVAL + } + + // Mutex was successfully created, or already exists. + // In either case, we don't own the mutex, and must + // wait for it below. + handle := syscall.Handle(result) + + handles := []syscall.Handle{handle} + if cancel != nil { + eventHandle, err := createEvent() + if err != nil { + return syscall.InvalidHandle, errors.Trace(err) + } + defer syscall.Close(eventHandle) + + // Put the event handle first, so + // cancellation takes precedence. + handles = []syscall.Handle{eventHandle, handle} + done := make(chan struct{}) + defer close(done) + go func() { + select { + case <-done: + case <-cancel: + setEvent(eventHandle) + } + }() + } + + if timeout == 0 { + // -1 indicates to waitForMultipleObjects + // that it should wait indefinitely. + timeout = -1 + } + i, err := waitForMultipleObjects(handles, timeout) + if err != nil { + syscall.Close(handle) + return syscall.InvalidHandle, err + } + if i+1 == len(handles) { + return handle, nil + } + syscall.Close(handle) + return syscall.InvalidHandle, ErrCancelled +} + +func releaseMutex(handle syscall.Handle) error { + result, _, errno := syscall.Syscall(procReleaseMutex.Addr(), 3, uintptr(handle), uintptr(1), 0) + if result == 0 { + if errno != 0 { + return errno + } + return syscall.EINVAL + } + return nil +} + +// waitForMultipleObjects calls the WaitForMultipleObjects Windows API, with the +// given handles and timeout. If the timeout value is negative, there is no timeout. +// +// The return value is the index of the handle that was signalled, or an error. +// +// See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms687025(v=vs.85).aspx +func waitForMultipleObjects(handles []syscall.Handle, timeout time.Duration) (int, error) { + timeoutMillis := uintptr(_INFINITE) + if timeout >= 0 { + timeoutMillis = uintptr(timeout.Seconds() * 1000) + } + result, _, errno := syscall.Syscall6( + procWaitForMultipleObjects.Addr(), 4, + uintptr(len(handles)), + uintptr(unsafe.Pointer(&handles[0])), + uintptr(0), // FALSE (don't wait for all) + timeoutMillis, + 0, 0, + ) + if result == _WAIT_TIMEOUT { + return -1, ErrTimeout + } + if result >= _WAIT_OBJECT_0 && result < uintptr(_WAIT_OBJECT_0+len(handles)) { + return int(result - _WAIT_OBJECT_0), nil + } + if result >= _WAIT_ABANDONED_0 && result < uintptr(_WAIT_ABANDONED_0+len(handles)) { + // The thread that owned the mutex exited without releasing the + // mutex. Ownership of the mutex is still granted as above. + return int(result - _WAIT_ABANDONED_0), nil + } + if errno != 0 { + return -1, errno + } + return -1, syscall.GetLastError() +} + +func createEvent() (syscall.Handle, error) { + result, _, errno := syscall.Syscall6( + procCreateEvent.Addr(), 4, + uintptr(0), // lpEventAttributes + uintptr(1), // bManualReset + uintptr(0), // bInitialState + uintptr(0), // lpName + 0, 0, + ) + if result == 0 { + if errno != 0 { + return syscall.Handle(0), errno + } + return syscall.Handle(0), syscall.EINVAL + } + return syscall.Handle(result), nil +} + +func setEvent(handle syscall.Handle) error { + result, _, errno := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(handle), 0, 0) + if result == 0 { + if errno != 0 { + return errno + } + return syscall.EINVAL + } + return nil +} diff --git a/test/integration/licenses/github.com/juju/mutex/package_test.go b/test/integration/licenses/github.com/juju/mutex/package_test.go new file mode 100644 index 0000000000..3cd97b0ba4 --- /dev/null +++ b/test/integration/licenses/github.com/juju/mutex/package_test.go @@ -0,0 +1,14 @@ +// Copyright 2016 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package mutex_test + +import ( + "testing" + + gc "gopkg.in/check.v1" +) + +func Test(t *testing.T) { + gc.TestingT(t) +} diff --git a/test/integration/licenses/github.com/kballard/go-shellquote/LICENSE b/test/integration/licenses/github.com/kballard/go-shellquote/LICENSE new file mode 100644 index 0000000000..a6d77312e1 --- /dev/null +++ b/test/integration/licenses/github.com/kballard/go-shellquote/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2014 Kevin Ballard + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/klauspost/compress/LICENSE b/test/integration/licenses/github.com/klauspost/compress/LICENSE new file mode 100644 index 0000000000..87d5574777 --- /dev/null +++ b/test/integration/licenses/github.com/klauspost/compress/LICENSE @@ -0,0 +1,304 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2019 Klaus Post. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------ + +Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + 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. + +------------------ + +Files: s2/cmd/internal/readahead/* + +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--------------------- +Files: snappy/* +Files: internal/snapref/* + +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +----------------- + +Files: s2/cmd/internal/filepathx/* + +Copyright 2016 The filepathx Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE b/test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE new file mode 100644 index 0000000000..6050c10f4c --- /dev/null +++ b/test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt b/test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt new file mode 100644 index 0000000000..24b53065f4 --- /dev/null +++ b/test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2016 Caleb Spare + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/klauspost/cpuid/LICENSE b/test/integration/licenses/github.com/klauspost/cpuid/LICENSE new file mode 100644 index 0000000000..5cec7ee949 --- /dev/null +++ b/test/integration/licenses/github.com/klauspost/cpuid/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Klaus Post + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE b/test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/magiconair/properties/LICENSE.md b/test/integration/licenses/github.com/magiconair/properties/LICENSE.md new file mode 100644 index 0000000000..79c87e3e6f --- /dev/null +++ b/test/integration/licenses/github.com/magiconair/properties/LICENSE.md @@ -0,0 +1,24 @@ +Copyright (c) 2013-2020, Frank Schroeder + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/mailru/easyjson/LICENSE b/test/integration/licenses/github.com/mailru/easyjson/LICENSE new file mode 100644 index 0000000000..fbff658f70 --- /dev/null +++ b/test/integration/licenses/github.com/mailru/easyjson/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2016 Mail.Ru Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mattn/go-colorable/LICENSE b/test/integration/licenses/github.com/mattn/go-colorable/LICENSE new file mode 100644 index 0000000000..91b5cef30e --- /dev/null +++ b/test/integration/licenses/github.com/mattn/go-colorable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Yasuhiro Matsumoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/integration/licenses/github.com/mattn/go-isatty/LICENSE b/test/integration/licenses/github.com/mattn/go-isatty/LICENSE new file mode 100644 index 0000000000..65dc692b6b --- /dev/null +++ b/test/integration/licenses/github.com/mattn/go-isatty/LICENSE @@ -0,0 +1,9 @@ +Copyright (c) Yasuhiro MATSUMOTO + +MIT License (Expat) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mattn/go-runewidth/LICENSE b/test/integration/licenses/github.com/mattn/go-runewidth/LICENSE new file mode 100644 index 0000000000..91b5cef30e --- /dev/null +++ b/test/integration/licenses/github.com/mattn/go-runewidth/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Yasuhiro Matsumoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE b/test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE new file mode 100644 index 0000000000..f9c841a51e --- /dev/null +++ b/test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md b/test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md new file mode 100644 index 0000000000..2298515904 --- /dev/null +++ b/test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE b/test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE new file mode 100644 index 0000000000..a3866a291f --- /dev/null +++ b/test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md b/test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md new file mode 100644 index 0000000000..2298515904 --- /dev/null +++ b/test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE b/test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE new file mode 100644 index 0000000000..f9c841a51e --- /dev/null +++ b/test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Mitchell Hashimoto + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/moby/spdystream/LICENSE b/test/integration/licenses/github.com/moby/spdystream/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/moby/spdystream/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/moby/spdystream/NOTICE b/test/integration/licenses/github.com/moby/spdystream/NOTICE new file mode 100644 index 0000000000..b9b11c9ab7 --- /dev/null +++ b/test/integration/licenses/github.com/moby/spdystream/NOTICE @@ -0,0 +1,5 @@ +SpdyStream +Copyright 2014-2021 Docker Inc. + +This product includes software developed at +Docker Inc. (https://www.docker.com/). diff --git a/test/integration/licenses/github.com/moby/sys/mount/LICENSE b/test/integration/licenses/github.com/moby/sys/mount/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/moby/sys/mount/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE b/test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/moby/term/LICENSE b/test/integration/licenses/github.com/moby/term/LICENSE new file mode 100644 index 0000000000..6d8d58fb67 --- /dev/null +++ b/test/integration/licenses/github.com/moby/term/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2013-2018 Docker, Inc. + + 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 + + https://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. diff --git a/test/integration/licenses/github.com/modern-go/concurrent/LICENSE b/test/integration/licenses/github.com/modern-go/concurrent/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/modern-go/concurrent/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/modern-go/reflect2/LICENSE b/test/integration/licenses/github.com/modern-go/reflect2/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/github.com/modern-go/reflect2/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/muesli/reflow/LICENSE b/test/integration/licenses/github.com/muesli/reflow/LICENSE new file mode 100644 index 0000000000..8532c45c96 --- /dev/null +++ b/test/integration/licenses/github.com/muesli/reflow/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Christian Muehlhaeuser + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/integration/licenses/github.com/munnerz/goautoneg/LICENSE b/test/integration/licenses/github.com/munnerz/goautoneg/LICENSE new file mode 100644 index 0000000000..bbc7b897cb --- /dev/null +++ b/test/integration/licenses/github.com/munnerz/goautoneg/LICENSE @@ -0,0 +1,31 @@ +Copyright (c) 2011, Open Knowledge Foundation Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + Neither the name of the Open Knowledge Foundation Ltd. nor the + names of its contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md b/test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md new file mode 100644 index 0000000000..a0769b5c15 --- /dev/null +++ b/test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (C) 2014 by Oleku Konko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/opencontainers/go-digest/LICENSE b/test/integration/licenses/github.com/opencontainers/go-digest/LICENSE new file mode 100644 index 0000000000..3ac8ab6487 --- /dev/null +++ b/test/integration/licenses/github.com/opencontainers/go-digest/LICENSE @@ -0,0 +1,192 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2019, 2020 OCI Contributors + Copyright 2016 Docker, Inc. + + 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 + + https://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. diff --git a/test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE b/test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE new file mode 100644 index 0000000000..9fdc20fdb6 --- /dev/null +++ b/test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2016 The Linux Foundation. + + 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. diff --git a/test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE b/test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE new file mode 100644 index 0000000000..27448585ad --- /dev/null +++ b/test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2014 Docker, Inc. + + 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. diff --git a/test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE b/test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE new file mode 100644 index 0000000000..5c97abce4b --- /dev/null +++ b/test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE @@ -0,0 +1,17 @@ +runc + +Copyright 2012-2015 Docker, Inc. + +This product includes software developed at Docker, Inc. (http://www.docker.com). + +The following is courtesy of our legal counsel: + + +Use and transfer of Docker may be subject to certain restrictions by the +United States and other governments. +It is your responsibility to ensure that your use and/or transfer does not +violate applicable laws. + +For more information, please see http://www.bis.doc.gov + +See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE b/test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE new file mode 100644 index 0000000000..bdc403653e --- /dev/null +++ b/test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2015 The Linux Foundation. + + 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. diff --git a/test/integration/licenses/github.com/otiai10/copy/LICENSE b/test/integration/licenses/github.com/otiai10/copy/LICENSE new file mode 100644 index 0000000000..1f0cc5dec7 --- /dev/null +++ b/test/integration/licenses/github.com/otiai10/copy/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 otiai10 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE b/test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE new file mode 100644 index 0000000000..6839d51cd4 --- /dev/null +++ b/test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/integration/licenses/github.com/phayes/freeport/LICENSE.md b/test/integration/licenses/github.com/phayes/freeport/LICENSE.md new file mode 100644 index 0000000000..d9882e595e --- /dev/null +++ b/test/integration/licenses/github.com/phayes/freeport/LICENSE.md @@ -0,0 +1,15 @@ +Open Source License (BSD 3-Clause) +---------------------------------- + +Copyright (c) 2014, Patrick Hayes / HighWire Press +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/pkg/browser/LICENSE b/test/integration/licenses/github.com/pkg/browser/LICENSE new file mode 100644 index 0000000000..65f78fb629 --- /dev/null +++ b/test/integration/licenses/github.com/pkg/browser/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2014, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/pkg/errors/LICENSE b/test/integration/licenses/github.com/pkg/errors/LICENSE new file mode 100644 index 0000000000..835ba3e755 --- /dev/null +++ b/test/integration/licenses/github.com/pkg/errors/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2015, Dave Cheney +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/pkg/profile/LICENSE b/test/integration/licenses/github.com/pkg/profile/LICENSE new file mode 100644 index 0000000000..f747a8411e --- /dev/null +++ b/test/integration/licenses/github.com/pkg/profile/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2013 Dave Cheney. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt b/test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt new file mode 100644 index 0000000000..5040f1ef80 --- /dev/null +++ b/test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Oliver Kuederle + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt b/test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt new file mode 100644 index 0000000000..7fbb253a8e --- /dev/null +++ b/test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt @@ -0,0 +1,28 @@ +Blackfriday is distributed under the Simplified BSD License: + +Copyright © 2011 Russ Ross +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with + the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/samalba/dockerclient/LICENSE b/test/integration/licenses/github.com/samalba/dockerclient/LICENSE new file mode 100644 index 0000000000..00e1edb90f --- /dev/null +++ b/test/integration/licenses/github.com/samalba/dockerclient/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Sam Alba + + 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. + diff --git a/test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE b/test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE new file mode 100644 index 0000000000..6f06adcbff --- /dev/null +++ b/test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE @@ -0,0 +1,61 @@ +gopsutil is distributed under BSD license reproduced below. + +Copyright (c) 2014, WAKAYAMA Shirou +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the gopsutil authors nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +------- +internal/common/binary.go in the gopsutil is copied and modified from golang/encoding/binary.go. + + + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/sirupsen/logrus/LICENSE b/test/integration/licenses/github.com/sirupsen/logrus/LICENSE new file mode 100644 index 0000000000..f090cb42f3 --- /dev/null +++ b/test/integration/licenses/github.com/sirupsen/logrus/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Simon Eskildsen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/spf13/afero/LICENSE.txt b/test/integration/licenses/github.com/spf13/afero/LICENSE.txt new file mode 100644 index 0000000000..298f0e2665 --- /dev/null +++ b/test/integration/licenses/github.com/spf13/afero/LICENSE.txt @@ -0,0 +1,174 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/test/integration/licenses/github.com/spf13/cast/LICENSE b/test/integration/licenses/github.com/spf13/cast/LICENSE new file mode 100644 index 0000000000..4527efb9c0 --- /dev/null +++ b/test/integration/licenses/github.com/spf13/cast/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/spf13/cobra/LICENSE.txt b/test/integration/licenses/github.com/spf13/cobra/LICENSE.txt new file mode 100644 index 0000000000..298f0e2665 --- /dev/null +++ b/test/integration/licenses/github.com/spf13/cobra/LICENSE.txt @@ -0,0 +1,174 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE b/test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE new file mode 100644 index 0000000000..4527efb9c0 --- /dev/null +++ b/test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/spf13/pflag/LICENSE b/test/integration/licenses/github.com/spf13/pflag/LICENSE new file mode 100644 index 0000000000..63ed1cfea1 --- /dev/null +++ b/test/integration/licenses/github.com/spf13/pflag/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012 Alex Ogier. All rights reserved. +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/spf13/viper/LICENSE b/test/integration/licenses/github.com/spf13/viper/LICENSE new file mode 100644 index 0000000000..4527efb9c0 --- /dev/null +++ b/test/integration/licenses/github.com/spf13/viper/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Steve Francia + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/subosito/gotenv/LICENSE b/test/integration/licenses/github.com/subosito/gotenv/LICENSE new file mode 100644 index 0000000000..f64ccaedc3 --- /dev/null +++ b/test/integration/licenses/github.com/subosito/gotenv/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Alif Rachmawadi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE b/test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE new file mode 100644 index 0000000000..cf198debc6 --- /dev/null +++ b/test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018-2021, Tobias Klauser +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/tklauser/numcpus/LICENSE b/test/integration/licenses/github.com/tklauser/numcpus/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/github.com/tklauser/numcpus/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/github.com/ulikunitz/xz/LICENSE b/test/integration/licenses/github.com/ulikunitz/xz/LICENSE new file mode 100644 index 0000000000..d32149979d --- /dev/null +++ b/test/integration/licenses/github.com/ulikunitz/xz/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2014-2020 Ulrich Kunitz +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* My name, Ulrich Kunitz, may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE b/test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE new file mode 100644 index 0000000000..ca03685b15 --- /dev/null +++ b/test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2015 Vincent Batts, Raleigh, NC, USA + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/xo/terminfo/LICENSE b/test/integration/licenses/github.com/xo/terminfo/LICENSE new file mode 100644 index 0000000000..197dadb12c --- /dev/null +++ b/test/integration/licenses/github.com/xo/terminfo/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Anmol Sethi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/integration/licenses/go.opencensus.io/LICENSE b/test/integration/licenses/go.opencensus.io/LICENSE new file mode 100644 index 0000000000..7a4a3ea242 --- /dev/null +++ b/test/integration/licenses/go.opencensus.io/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. \ No newline at end of file diff --git a/test/integration/licenses/go.opentelemetry.io/otel/LICENSE b/test/integration/licenses/go.opentelemetry.io/otel/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/go.opentelemetry.io/otel/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE b/test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE b/test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/go.uber.org/atomic/LICENSE.txt b/test/integration/licenses/go.uber.org/atomic/LICENSE.txt new file mode 100644 index 0000000000..8765c9fbc6 --- /dev/null +++ b/test/integration/licenses/go.uber.org/atomic/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2016 Uber Technologies, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/go.uber.org/multierr/LICENSE.txt b/test/integration/licenses/go.uber.org/multierr/LICENSE.txt new file mode 100644 index 0000000000..413e30f7ce --- /dev/null +++ b/test/integration/licenses/go.uber.org/multierr/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2017-2021 Uber Technologies, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/go.uber.org/zap/LICENSE.txt b/test/integration/licenses/go.uber.org/zap/LICENSE.txt new file mode 100644 index 0000000000..6652bed45f --- /dev/null +++ b/test/integration/licenses/go.uber.org/zap/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2016-2017 Uber Technologies, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/test/integration/licenses/golang.org/x/crypto/LICENSE b/test/integration/licenses/golang.org/x/crypto/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/crypto/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/exp/ebnf/LICENSE b/test/integration/licenses/golang.org/x/exp/ebnf/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/exp/ebnf/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/mod/semver/LICENSE b/test/integration/licenses/golang.org/x/mod/semver/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/mod/semver/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/net/LICENSE b/test/integration/licenses/golang.org/x/net/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/net/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/oauth2/LICENSE b/test/integration/licenses/golang.org/x/oauth2/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/oauth2/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/sync/LICENSE b/test/integration/licenses/golang.org/x/sync/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/sync/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/sys/LICENSE b/test/integration/licenses/golang.org/x/sys/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/sys/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/term/LICENSE b/test/integration/licenses/golang.org/x/term/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/term/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/text/LICENSE b/test/integration/licenses/golang.org/x/text/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/text/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/time/rate/LICENSE b/test/integration/licenses/golang.org/x/time/rate/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/golang.org/x/time/rate/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/xerrors/LICENSE b/test/integration/licenses/golang.org/x/xerrors/LICENSE new file mode 100644 index 0000000000..e4a47e17f1 --- /dev/null +++ b/test/integration/licenses/golang.org/x/xerrors/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2019 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/google.golang.org/api/LICENSE b/test/integration/licenses/google.golang.org/api/LICENSE new file mode 100644 index 0000000000..263aa7a0c1 --- /dev/null +++ b/test/integration/licenses/google.golang.org/api/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2011 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE b/test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE new file mode 100644 index 0000000000..7109c6ef93 --- /dev/null +++ b/test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013 Joshua Tacoma. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/google.golang.org/genproto/LICENSE b/test/integration/licenses/google.golang.org/genproto/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/google.golang.org/genproto/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/google.golang.org/grpc/LICENSE b/test/integration/licenses/google.golang.org/grpc/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/google.golang.org/grpc/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/google.golang.org/grpc/NOTICE.txt b/test/integration/licenses/google.golang.org/grpc/NOTICE.txt new file mode 100644 index 0000000000..530197749e --- /dev/null +++ b/test/integration/licenses/google.golang.org/grpc/NOTICE.txt @@ -0,0 +1,13 @@ +Copyright 2014 gRPC 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. diff --git a/test/integration/licenses/google.golang.org/protobuf/LICENSE b/test/integration/licenses/google.golang.org/protobuf/LICENSE new file mode 100644 index 0000000000..49ea0f9288 --- /dev/null +++ b/test/integration/licenses/google.golang.org/protobuf/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2018 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/gopkg.in/inf.v0/LICENSE b/test/integration/licenses/gopkg.in/inf.v0/LICENSE new file mode 100644 index 0000000000..87a5cede33 --- /dev/null +++ b/test/integration/licenses/gopkg.in/inf.v0/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012 Péter Surányi. Portions Copyright (c) 2009 The Go +Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/gopkg.in/ini.v1/LICENSE b/test/integration/licenses/gopkg.in/ini.v1/LICENSE new file mode 100644 index 0000000000..d361bbcdf5 --- /dev/null +++ b/test/integration/licenses/gopkg.in/ini.v1/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright 2014 Unknwon + + 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. diff --git a/test/integration/licenses/gopkg.in/yaml.v2/LICENSE b/test/integration/licenses/gopkg.in/yaml.v2/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/test/integration/licenses/gopkg.in/yaml.v2/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff --git a/test/integration/licenses/gopkg.in/yaml.v2/NOTICE b/test/integration/licenses/gopkg.in/yaml.v2/NOTICE new file mode 100644 index 0000000000..866d74a7ad --- /dev/null +++ b/test/integration/licenses/gopkg.in/yaml.v2/NOTICE @@ -0,0 +1,13 @@ +Copyright 2011-2016 Canonical Ltd. + +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. diff --git a/test/integration/licenses/gopkg.in/yaml.v3/LICENSE b/test/integration/licenses/gopkg.in/yaml.v3/LICENSE new file mode 100644 index 0000000000..2683e4bb1f --- /dev/null +++ b/test/integration/licenses/gopkg.in/yaml.v3/LICENSE @@ -0,0 +1,50 @@ + +This project is covered by two different licenses: MIT and Apache. + +#### MIT License #### + +The following files were ported to Go from C files of libyaml, and thus +are still covered by their original MIT license, with the additional +copyright staring in 2011 when the project was ported over: + + apic.go emitterc.go parserc.go readerc.go scannerc.go + writerc.go yamlh.go yamlprivateh.go + +Copyright (c) 2006-2010 Kirill Simonov +Copyright (c) 2006-2011 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +### Apache License ### + +All the remaining project files are covered by the Apache license: + +Copyright (c) 2011-2019 Canonical Ltd + +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. diff --git a/test/integration/licenses/gopkg.in/yaml.v3/NOTICE b/test/integration/licenses/gopkg.in/yaml.v3/NOTICE new file mode 100644 index 0000000000..866d74a7ad --- /dev/null +++ b/test/integration/licenses/gopkg.in/yaml.v3/NOTICE @@ -0,0 +1,13 @@ +Copyright 2011-2016 Canonical Ltd. + +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. diff --git a/test/integration/licenses/k8s.io/api/LICENSE b/test/integration/licenses/k8s.io/api/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/api/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE b/test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE b/test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE new file mode 100644 index 0000000000..6a66aea5ea --- /dev/null +++ b/test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/k8s.io/client-go/LICENSE b/test/integration/licenses/k8s.io/client-go/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/client-go/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE b/test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/component-base/featuregate/LICENSE b/test/integration/licenses/k8s.io/component-base/featuregate/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/component-base/featuregate/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/klog/v2/LICENSE b/test/integration/licenses/k8s.io/klog/v2/LICENSE new file mode 100644 index 0000000000..37ec93a14f --- /dev/null +++ b/test/integration/licenses/k8s.io/klog/v2/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE b/test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE b/test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE b/test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff --git a/test/integration/licenses/k8s.io/minikube/LICENSE b/test/integration/licenses/k8s.io/minikube/LICENSE new file mode 100644 index 0000000000..21cb533d2d --- /dev/null +++ b/test/integration/licenses/k8s.io/minikube/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 The Kubernetes Authors All rights reserved. + + 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. diff --git a/test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go b/test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go new file mode 100644 index 0000000000..252450da2b --- /dev/null +++ b/test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go @@ -0,0 +1,42 @@ +/* +Copyright 2022 The Kubernetes Authors All rights reserved. + +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 cmd + +import ( + "github.com/spf13/cobra" + "k8s.io/minikube/pkg/minikube/download" + "k8s.io/minikube/pkg/minikube/exit" + "k8s.io/minikube/pkg/minikube/reason" +) + +var dir string + +// licenseCmd represents the credits command +var licenseCmd = &cobra.Command{ + Use: "license", + Short: "Outputs the licenses of dependencies to a directory", + Long: "Outputs the licenses of dependencies to a directory", + Run: func(cmd *cobra.Command, args []string) { + if err := download.Licenses(dir); err != nil { + exit.Error(reason.InetLicenses, "Failed to download licenses", err) + } + }, +} + +func init() { + licenseCmd.Flags().StringVarP(&dir, "dir", "d", ".", "Directory to output licenses to") +} diff --git a/test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go b/test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go new file mode 100644 index 0000000000..a5c6cb60fd --- /dev/null +++ b/test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go @@ -0,0 +1,50 @@ +/* +Copyright 2022 The Kubernetes Authors All rights reserved. + +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 download + +import ( + "fmt" + "io" + "net/http" + "os" + "os/exec" + + "k8s.io/minikube/pkg/version" +) + +func Licenses(dir string) error { + resp, err := http.Get(fmt.Sprintf("https://storage.googleapis.com/minikube/releases/%s/licenses.tar.gz", version.GetVersion())) + if err != nil { + return fmt.Errorf("failed to download licenses: %v", err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("download request did not return a 200, received: %d", resp.StatusCode) + } + f, err := os.CreateTemp("", "licenses") + if err != nil { + return fmt.Errorf("failed to create file in tmp dir: %v", err) + } + defer os.Remove(f.Name()) + if _, err := io.Copy(f, resp.Body); err != nil { + return fmt.Errorf("failed to copy: %v", err) + } + if err := exec.Command("tar", "-xvzf", f.Name(), "-C", dir).Run(); err != nil { + return fmt.Errorf("failed to untar licenses: %v", err) + } + return nil +} diff --git a/test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE b/test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE new file mode 100644 index 0000000000..707a0ed49b --- /dev/null +++ b/test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2013-2021, go-dockerclient authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE b/test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE new file mode 100644 index 0000000000..755d715d4f --- /dev/null +++ b/test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go9p Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * The names of Go9p's contributors may not be used to endorse +or promote products derived from this software without specific prior +written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/k8s.io/utils/LICENSE b/test/integration/licenses/k8s.io/utils/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/integration/licenses/k8s.io/utils/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE b/test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE new file mode 100644 index 0000000000..7448756763 --- /dev/null +++ b/test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/sigs.k8s.io/json/LICENSE b/test/integration/licenses/sigs.k8s.io/json/LICENSE new file mode 100644 index 0000000000..e5adf7f0c0 --- /dev/null +++ b/test/integration/licenses/sigs.k8s.io/json/LICENSE @@ -0,0 +1,238 @@ +Files other than internal/golang/* licensed under: + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. + + +------------------ + +internal/golang/* files licensed under: + + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE b/test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + 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. diff --git a/test/integration/licenses/sigs.k8s.io/yaml/LICENSE b/test/integration/licenses/sigs.k8s.io/yaml/LICENSE new file mode 100644 index 0000000000..7805d36de7 --- /dev/null +++ b/test/integration/licenses/sigs.k8s.io/yaml/LICENSE @@ -0,0 +1,50 @@ +The MIT License (MIT) + +Copyright (c) 2014 Sam Ghods + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 4556172302..61420db58e 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -51,19 +51,20 @@ func TestNetworkPlugins(t *testing.T) { args []string kubeletPlugin string podLabel string + namespace string hairpin bool }{ // for containerd and crio runtimes kindnet CNI is used by default and hairpin is enabled - {"auto", []string{}, "", "", ContainerRuntime() != "docker"}, - {"kubenet", []string{"--network-plugin=kubenet"}, "kubenet", "", true}, - {"bridge", []string{"--cni=bridge"}, "cni", "", true}, - {"enable-default-cni", []string{"--enable-default-cni=true"}, "cni", "", true}, - {"flannel", []string{"--cni=flannel"}, "cni", "app=flannel", true}, - {"kindnet", []string{"--cni=kindnet"}, "cni", "app=kindnet", true}, - {"false", []string{"--cni=false"}, "", "", false}, - {"custom-flannel", []string{fmt.Sprintf("--cni=%s", filepath.Join(*testdataDir, "kube-flannel.yaml"))}, "cni", "", true}, - {"calico", []string{"--cni=calico"}, "cni", "k8s-app=calico-node", true}, - {"cilium", []string{"--cni=cilium"}, "cni", "k8s-app=cilium", true}, + {"auto", []string{}, "", "", "", ContainerRuntime() != "docker"}, + {"kubenet", []string{"--network-plugin=kubenet"}, "kubenet", "", "", true}, + {"bridge", []string{"--cni=bridge"}, "cni", "", "", true}, + {"enable-default-cni", []string{"--enable-default-cni=true"}, "cni", "", "", true}, + {"flannel", []string{"--cni=flannel"}, "cni", "app=flannel", "kube-flannel", true}, + {"kindnet", []string{"--cni=kindnet"}, "cni", "app=kindnet", "kube-system", true}, + {"false", []string{"--cni=false"}, "", "", "", false}, + {"custom-flannel", []string{fmt.Sprintf("--cni=%s", filepath.Join(*testdataDir, "kube-flannel.yaml"))}, "cni", "", "kube-flannel", true}, + {"calico", []string{"--cni=calico"}, "cni", "k8s-app=calico-node", "kube-system", true}, + {"cilium", []string{"--cni=cilium"}, "cni", "k8s-app=cilium", "kube-system", true}, } for _, tc := range tests { @@ -75,10 +76,6 @@ func TestNetworkPlugins(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) defer CleanupWithLogs(t, profile, cancel) - if DockerDriver() && strings.Contains(tc.name, "flannel") { - t.Skipf("flannel is not yet compatible with Docker driver: iptables v1.8.3 (legacy): Couldn't load target `CNI-x': No such file or directory") - } - if ContainerRuntime() != "docker" && tc.name == "false" { // CNI is required for current container runtime validateFalseCNI(ctx, t, profile) @@ -94,7 +91,7 @@ func TestNetworkPlugins(t *testing.T) { start := time.Now() MaybeParallel(t) - startArgs := append([]string{"start", "-p", profile, "--memory=2048", "--alsologtostderr", "--wait=true", "--wait-timeout=5m"}, tc.args...) + startArgs := append([]string{"start", "-p", profile, "--memory=3072", "--alsologtostderr", "--wait=true", "--wait-timeout=10m"}, tc.args...) startArgs = append(startArgs, StartArgs()...) t.Run("Start", func(t *testing.T) { @@ -106,7 +103,7 @@ func TestNetworkPlugins(t *testing.T) { if !t.Failed() && tc.podLabel != "" { t.Run("ControllerPod", func(t *testing.T) { - if _, err := PodWait(ctx, t, profile, "kube-system", tc.podLabel, Minutes(10)); err != nil { + if _, err := PodWait(ctx, t, profile, tc.namespace, tc.podLabel, Minutes(10)); err != nil { t.Fatalf("failed waiting for %s labeled pod: %v", tc.podLabel, err) } }) diff --git a/test/integration/testdata/kube-flannel.yaml b/test/integration/testdata/kube-flannel.yaml index 833fd58183..0bc0d084b8 100644 --- a/test/integration/testdata/kube-flannel.yaml +++ b/test/integration/testdata/kube-flannel.yaml @@ -2,7 +2,7 @@ kind: Namespace apiVersion: v1 metadata: - name: kube-system + name: kube-flannel labels: pod-security.kubernetes.io/enforce: privileged --- @@ -22,6 +22,7 @@ rules: resources: - nodes verbs: + - get - list - watch - apiGroups: @@ -42,19 +43,19 @@ roleRef: subjects: - kind: ServiceAccount name: flannel - namespace: kube-system + namespace: kube-flannel --- apiVersion: v1 kind: ServiceAccount metadata: name: flannel - namespace: kube-system + namespace: kube-flannel --- kind: ConfigMap apiVersion: v1 metadata: name: kube-flannel-cfg - namespace: kube-system + namespace: kube-flannel labels: tier: node app: flannel @@ -91,7 +92,7 @@ apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-flannel-ds - namespace: kube-system + namespace: kube-flannel labels: tier: node app: flannel @@ -122,8 +123,8 @@ spec: serviceAccountName: flannel initContainers: - name: install-cni-plugin - #image: flannelcni/flannel-cni-plugin:v1.0.1 for ppc64le and mips64le (dockerhub limitations may apply) - image: rancher/mirrored-flannelcni-flannel-cni-plugin:v1.0.1 + #image: flannelcni/flannel-cni-plugin:v1.1.0 for ppc64le and mips64le (dockerhub limitations may apply) + image: docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0 command: - cp args: @@ -134,8 +135,8 @@ spec: - name: cni-plugin mountPath: /opt/cni/bin - name: install-cni - #image: flannelcni/flannel:v0.17.0 for ppc64le and mips64le (dockerhub limitations may apply) - image: rancher/mirrored-flannelcni-flannel:v0.17.0 + #image: flannelcni/flannel:v0.20.2 for ppc64le and mips64le (dockerhub limitations may apply) + image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2 command: - cp args: @@ -149,8 +150,8 @@ spec: mountPath: /etc/kube-flannel/ containers: - name: kube-flannel - #image: flannelcni/flannel:v0.17.0 for ppc64le and mips64le (dockerhub limitations may apply) - image: rancher/mirrored-flannelcni-flannel:v0.17.0 + #image: flannelcni/flannel:v0.20.2 for ppc64le and mips64le (dockerhub limitations may apply) + image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2 command: - /opt/bin/flanneld args: From 5d0ac9d4468f416e726b0fd8a68e3d949572f502 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 5 Dec 2022 01:46:32 +0000 Subject: [PATCH 02/44] cleanup --- go.mod | 4 - go.sum | 2 - .../go/compute/metadata/LICENSE | 202 --- .../licenses/cloud.google.com/go/iam/LICENSE | 202 --- .../cloud.google.com/go/internal/LICENSE | 202 --- .../cloud.google.com/go/storage/LICENSE | 202 --- .../cloud.google.com/go/trace/LICENSE | 202 --- .../Delta456/box-cli-maker/v2/LICENSE | 21 - .../docker-credential-gcr/LICENSE | 201 --- .../exporter/trace/LICENSE | 202 --- .../internal/resourcemapping/LICENSE | 202 --- .../github.com/MakeNowJust/heredoc/LICENSE | 21 - .../github.com/PuerkitoBio/purell/LICENSE | 12 - .../github.com/PuerkitoBio/urlesc/LICENSE | 27 - .../github.com/VividCortex/ewma/LICENSE | 21 - .../github.com/VividCortex/godaemon/LICENSE | 19 - .../github.com/Xuanwo/go-locale/LICENSE | 201 --- .../github.com/aws/aws-sdk-go/LICENSE.txt | 202 --- .../github.com/aws/aws-sdk-go/NOTICE.txt | 3 - .../internal/sync/singleflight/LICENSE | 27 - .../github.com/bgentry/go-netrc/netrc/LICENSE | 20 - .../licenses/github.com/blang/semver/LICENSE | 22 - .../github.com/blang/semver/v4/LICENSE | 22 - .../github.com/briandowns/spinner/LICENSE | 174 --- .../github.com/cenkalti/backoff/v4/LICENSE | 20 - .../github.com/cheggaaa/pb/v3/LICENSE | 12 - .../github.com/cloudevents/sdk-go/v2/LICENSE | 201 --- .../github.com/containerd/containerd/LICENSE | 191 --- .../github.com/containerd/containerd/NOTICE | 16 - .../stargz-snapshotter/estargz/LICENSE | 202 --- .../coreos/go-systemd/v22/dbus/LICENSE | 191 --- .../coreos/go-systemd/v22/dbus/NOTICE | 5 - .../cyphar/filepath-securejoin/LICENSE | 28 - .../github.com/davecgh/go-spew/spew/LICENSE | 15 - .../github.com/docker/cli/cli/config/LICENSE | 191 --- .../github.com/docker/cli/cli/config/NOTICE | 19 - .../github.com/docker/distribution/LICENSE | 202 --- .../docker/docker-credential-helpers/LICENSE | 20 - .../licenses/github.com/docker/docker/LICENSE | 191 --- .../licenses/github.com/docker/docker/NOTICE | 19 - .../github.com/docker/go-connections/LICENSE | 191 --- .../github.com/docker/go-units/LICENSE | 191 --- .../github.com/docker/machine/LICENSE | 191 --- .../github.com/emicklei/go-restful/v3/LICENSE | 22 - .../github.com/fatih/color/LICENSE.md | 20 - .../github.com/fsnotify/fsnotify/LICENSE | 28 - .../licenses/github.com/go-logr/logr/LICENSE | 201 --- .../licenses/github.com/go-logr/stdr/LICENSE | 201 --- .../github.com/go-openapi/jsonpointer/LICENSE | 202 --- .../go-openapi/jsonreference/LICENSE | 202 --- .../github.com/go-openapi/swag/LICENSE | 202 --- .../github.com/godbus/dbus/v5/LICENSE | 25 - .../licenses/github.com/gogo/protobuf/LICENSE | 35 - .../github.com/golang/groupcache/lru/LICENSE | 191 --- .../github.com/golang/protobuf/LICENSE | 28 - .../github.com/google/gnostic/LICENSE | 203 --- .../github.com/google/go-cmp/cmp/LICENSE | 27 - .../google/go-containerregistry/LICENSE | 202 --- .../google/go-github/v43/github/LICENSE | 27 - .../google/go-querystring/query/LICENSE | 27 - .../licenses/github.com/google/gofuzz/LICENSE | 202 --- .../google/slowjam/pkg/stacklog/LICENSE | 201 --- .../licenses/github.com/google/uuid/LICENSE | 27 - .../client/LICENSE | 202 --- .../github.com/googleapis/gax-go/v2/LICENSE | 27 - .../licenses/github.com/gookit/color/LICENSE | 20 - .../github.com/hashicorp/go-cleanhttp/LICENSE | 363 ----- .../hashicorp/go-cleanhttp/README.md | 30 - .../hashicorp/go-cleanhttp/cleanhttp.go | 58 - .../github.com/hashicorp/go-cleanhttp/doc.go | 20 - .../github.com/hashicorp/go-cleanhttp/go.mod | 3 - .../hashicorp/go-cleanhttp/handlers.go | 48 - .../hashicorp/go-cleanhttp/handlers_test.go | 72 - .../hashicorp/go-getter/.circleci/config.yml | 176 --- .../.github/workflows/codeql-analysis.yml | 50 - .../go-getter/.github/workflows/release.yml | 78 -- .../github.com/hashicorp/go-getter/.gitignore | 1 - .../hashicorp/go-getter/.goreleaser.yml | 58 - .../github.com/hashicorp/go-getter/LICENSE | 354 ----- .../github.com/hashicorp/go-getter/README.md | 448 ------ .../hashicorp/go-getter/checksum.go | 317 ----- .../github.com/hashicorp/go-getter/client.go | 347 ----- .../hashicorp/go-getter/client_mode.go | 24 - .../hashicorp/go-getter/client_option.go | 100 -- .../go-getter/client_option_insecure.go | 14 - .../go-getter/client_option_progress.go | 38 - .../go-getter/client_option_progress_test.go | 65 - .../hashicorp/go-getter/cmd/go-getter/main.go | 93 -- .../cmd/go-getter/progress_tracking.go | 77 -- .../github.com/hashicorp/go-getter/common.go | 14 - .../hashicorp/go-getter/copy_dir.go | 85 -- .../hashicorp/go-getter/decompress.go | 65 - .../hashicorp/go-getter/decompress_bzip2.go | 37 - .../go-getter/decompress_bzip2_test.go | 34 - .../hashicorp/go-getter/decompress_gzip.go | 41 - .../go-getter/decompress_gzip_test.go | 34 - .../hashicorp/go-getter/decompress_tar.go | 150 -- .../go-getter/decompress_tar_test.go | 107 -- .../hashicorp/go-getter/decompress_tbz2.go | 33 - .../go-getter/decompress_tbz2_test.go | 73 - .../hashicorp/go-getter/decompress_testing.go | 171 --- .../hashicorp/go-getter/decompress_tgz.go | 39 - .../go-getter/decompress_tgz_test.go | 95 -- .../hashicorp/go-getter/decompress_txz.go | 39 - .../go-getter/decompress_txz_test.go | 84 -- .../hashicorp/go-getter/decompress_tzst.go | 39 - .../go-getter/decompress_tzst_test.go | 95 -- .../hashicorp/go-getter/decompress_xz.go | 41 - .../hashicorp/go-getter/decompress_xz_test.go | 34 - .../hashicorp/go-getter/decompress_zip.go | 91 -- .../go-getter/decompress_zip_test.go | 131 -- .../hashicorp/go-getter/decompress_zstd.go | 40 - .../go-getter/decompress_zstd_test.go | 34 - .../github.com/hashicorp/go-getter/detect.go | 106 -- .../hashicorp/go-getter/detect_bitbucket.go | 66 - .../go-getter/detect_bitbucket_test.go | 63 - .../hashicorp/go-getter/detect_file.go | 67 - .../hashicorp/go-getter/detect_file_test.go | 115 -- .../go-getter/detect_file_unix_test.go | 70 - .../hashicorp/go-getter/detect_gcs.go | 43 - .../hashicorp/go-getter/detect_gcs_test.go | 41 - .../hashicorp/go-getter/detect_git.go | 26 - .../hashicorp/go-getter/detect_git_test.go | 69 - .../hashicorp/go-getter/detect_github.go | 47 - .../hashicorp/go-getter/detect_github_test.go | 44 - .../hashicorp/go-getter/detect_gitlab.go | 47 - .../hashicorp/go-getter/detect_gitlab_test.go | 44 - .../hashicorp/go-getter/detect_s3.go | 73 - .../hashicorp/go-getter/detect_s3_test.go | 89 -- .../hashicorp/go-getter/detect_ssh.go | 49 - .../hashicorp/go-getter/detect_test.go | 92 -- .../hashicorp/go-getter/folder_storage.go | 65 - .../go-getter/folder_storage_test.go | 48 - .../github.com/hashicorp/go-getter/get.go | 152 --- .../hashicorp/go-getter/get_base.go | 20 - .../hashicorp/go-getter/get_file.go | 36 - .../hashicorp/go-getter/get_file_copy.go | 86 -- .../hashicorp/go-getter/get_file_copy_test.go | 82 -- .../hashicorp/go-getter/get_file_test.go | 204 --- .../hashicorp/go-getter/get_file_unix.go | 99 -- .../hashicorp/go-getter/get_file_windows.go | 130 -- .../github.com/hashicorp/go-getter/get_gcs.go | 220 --- .../hashicorp/go-getter/get_gcs_test.go | 261 ---- .../github.com/hashicorp/go-getter/get_git.go | 376 ------ .../hashicorp/go-getter/get_git_test.go | 913 ------------- .../github.com/hashicorp/go-getter/get_hg.go | 147 -- .../hashicorp/go-getter/get_hg_test.go | 143 -- .../hashicorp/go-getter/get_http.go | 622 --------- .../hashicorp/go-getter/get_http_test.go | 1111 --------------- .../hashicorp/go-getter/get_mock.go | 54 - .../github.com/hashicorp/go-getter/get_s3.go | 344 ----- .../hashicorp/go-getter/get_s3_test.go | 269 ---- .../hashicorp/go-getter/get_test.go | 545 -------- .../github.com/hashicorp/go-getter/go.mod | 28 - .../github.com/hashicorp/go-getter/go.sum | 162 --- .../hashicorp/go-getter/helper/url/url.go | 14 - .../go-getter/helper/url/url_test.go | 88 -- .../go-getter/helper/url/url_unix.go | 11 - .../go-getter/helper/url/url_windows.go | 39 - .../hashicorp/go-getter/module_test.go | 89 -- .../github.com/hashicorp/go-getter/netrc.go | 67 - .../hashicorp/go-getter/netrc_test.go | 63 - .../github.com/hashicorp/go-getter/source.go | 77 -- .../hashicorp/go-getter/source_test.go | 106 -- .../github.com/hashicorp/go-getter/storage.go | 13 - .../decompress-tar/permissions.tar | Bin 3584 -> 0 bytes .../decompress-zip/permissions.zip | Bin 808 -> 0 bytes .../archive-rooted-multi/archive.tar.gz | Bin 210 -> 0 bytes .../testdata/archive-rooted/archive.tar.gz | Bin 173 -> 0 bytes .../go-getter/testdata/archive.tar.gz | Bin 141 -> 0 bytes .../testdata/basic%2Ftest/foo/main.tf | 1 - .../go-getter/testdata/basic%2Ftest/main.tf | 5 - .../testdata/basic%2Ftest/subdir/sub.tf | 0 .../go-getter/testdata/basic-dot/main.tf | 5 - .../basic-file-archive/archive.tar.gz | Bin 141 -> 0 bytes .../go-getter/testdata/basic-file/foo.txt | 1 - .../testdata/basic-hg/.hg/00changelog.i | Bin 57 -> 0 bytes .../go-getter/testdata/basic-hg/.hg/branch | 1 - .../basic-hg/.hg/cache/branch2-served | 3 - .../testdata/basic-hg/.hg/cache/rbc-names-v1 | 1 - .../testdata/basic-hg/.hg/cache/rbc-revs-v1 | Bin 8 -> 0 bytes .../testdata/basic-hg/.hg/cache/tags | 2 - .../go-getter/testdata/basic-hg/.hg/dirstate | Bin 88 -> 0 bytes .../testdata/basic-hg/.hg/last-message.txt | 2 - .../go-getter/testdata/basic-hg/.hg/requires | 4 - .../testdata/basic-hg/.hg/store/00changelog.i | Bin 528 -> 0 bytes .../testdata/basic-hg/.hg/store/00manifest.i | Bin 376 -> 0 bytes .../basic-hg/.hg/store/data/foo.txt.i | Bin 71 -> 0 bytes .../basic-hg/.hg/store/data/main.tf.i | Bin 112 -> 0 bytes .../basic-hg/.hg/store/data/main__branch.tf.i | Bin 64 -> 0 bytes .../testdata/basic-hg/.hg/store/fncache | 3 - .../testdata/basic-hg/.hg/store/phaseroots | 1 - .../testdata/basic-hg/.hg/store/undo | Bin 52 -> 0 bytes .../basic-hg/.hg/store/undo.backup.fncache | 2 - .../basic-hg/.hg/store/undo.backupfiles | Bin 33 -> 0 bytes .../basic-hg/.hg/store/undo.phaseroots | 1 - .../testdata/basic-hg/.hg/undo.bookmarks | 0 .../testdata/basic-hg/.hg/undo.branch | 1 - .../go-getter/testdata/basic-hg/.hg/undo.desc | 2 - .../testdata/basic-hg/.hg/undo.dirstate | Bin 88 -> 0 bytes .../go-getter/testdata/basic-hg/foo.txt | 1 - .../go-getter/testdata/basic-hg/main.tf | 5 - .../go-getter/testdata/basic-parent/a/a.tf | 3 - .../go-getter/testdata/basic-parent/c/c.tf | 1 - .../go-getter/testdata/basic-parent/main.tf | 3 - .../testdata/basic-subdir/foo/sub/baz/main.tf | 0 .../testdata/basic-subdir/foo/sub/main.tf | 3 - .../go-getter/testdata/basic-subdir/main.tf | 3 - .../go-getter/testdata/basic-tgz/main.tf | 1 - .../go-getter/testdata/basic/foo/main.tf | 1 - .../go-getter/testdata/basic/main.tf | 5 - .../go-getter/testdata/basic/subdir/sub.tf | 0 .../testdata/checksum-file/content.txt | 1 - .../testdata/checksum-file/md5-bsd-bad.sum | 1 - .../testdata/checksum-file/md5-bsd-wrong.sum | 1 - .../testdata/checksum-file/md5-bsd.sum | 1 - .../testdata/checksum-file/md5-p.sum | 1 - .../testdata/checksum-file/sha1-p.sum | 1 - .../go-getter/testdata/checksum-file/sha1.sum | 1 - .../testdata/checksum-file/sha256-p.sum | 1 - .../testdata/checksum-file/sha512-p-EOF.sum | 1 - .../testdata/checksum-file/sha512-p.sum | 1 - .../go-getter/testdata/child/foo/bar/main.tf | 2 - .../go-getter/testdata/child/foo/main.tf | 5 - .../go-getter/testdata/child/main.tf | 5 - .../testdata/decompress-bz2/single.bz2 | Bin 40 -> 0 bytes .../testdata/decompress-gz/single.gz | Bin 29 -> 0 bytes .../decompress-tar/extended_header.tar | Bin 10240 -> 0 bytes .../testdata/decompress-tar/implied_dir.tar | Bin 2048 -> 0 bytes .../testdata/decompress-tar/unix_time_0.tar | Bin 10240 -> 0 bytes .../testdata/decompress-tbz2/empty.tar.bz2 | Bin 46 -> 0 bytes .../testdata/decompress-tbz2/multiple.tar.bz2 | Bin 166 -> 0 bytes .../testdata/decompress-tbz2/ordering.tar.bz2 | Bin 248 -> 0 bytes .../testdata/decompress-tbz2/single.tar.bz2 | Bin 135 -> 0 bytes .../testdata/decompress-tgz/empty.tar.gz | Bin 45 -> 0 bytes .../testdata/decompress-tgz/multiple.tar.gz | Bin 157 -> 0 bytes .../decompress-tgz/multiple_dir.tar.gz | Bin 194 -> 0 bytes .../testdata/decompress-tgz/ordering.tar.gz | Bin 187 -> 0 bytes .../decompress-tgz/outside_parent.tar.gz | Bin 192 -> 0 bytes .../testdata/decompress-tgz/single.tar.gz | Bin 137 -> 0 bytes .../testdata/decompress-txz/empty.tar.xz | Bin 108 -> 0 bytes .../testdata/decompress-txz/multiple.tar.xz | Bin 204 -> 0 bytes .../decompress-txz/multiple_dir.tar.xz | Bin 232 -> 0 bytes .../testdata/decompress-txz/ordering.tar.xz | Bin 220 -> 0 bytes .../testdata/decompress-txz/single.tar.xz | Bin 192 -> 0 bytes .../testdata/decompress-tzst/empty.tar.zst | Bin 22 -> 0 bytes .../testdata/decompress-tzst/multiple.tar.zst | Bin 121 -> 0 bytes .../decompress-tzst/multiple_dir.tar.zst | Bin 153 -> 0 bytes .../testdata/decompress-tzst/ordering.tar.zst | Bin 164 -> 0 bytes .../decompress-tzst/outside_parent.tar.zst | Bin 151 -> 0 bytes .../testdata/decompress-tzst/single.tar.zst | Bin 104 -> 0 bytes .../testdata/decompress-xz/single.xz | Bin 60 -> 0 bytes .../testdata/decompress-zip/empty.zip | Bin 22 -> 0 bytes .../testdata/decompress-zip/multiple.zip | Bin 306 -> 0 bytes .../decompress-zip/outside_parent.zip | Bin 237 -> 0 bytes .../testdata/decompress-zip/single.zip | Bin 162 -> 0 bytes .../testdata/decompress-zip/subdir.zip | Bin 466 -> 0 bytes .../testdata/decompress-zip/subdir_empty.zip | Bin 308 -> 0 bytes .../decompress-zip/subdir_missing_dir.zip | Bin 324 -> 0 bytes .../testdata/decompress-zst/single.zst | Bin 17 -> 0 bytes .../detect-file-symlink-pwd/real/hello.txt | 0 .../go-getter/testdata/dup/foo/main.tf | 0 .../hashicorp/go-getter/testdata/dup/main.tf | 7 - .../hashicorp/go-getter/testdata/netrc/basic | 3 - .../child/main.tf | 1 - .../validate-bad-output-to-module/main.tf | 8 - .../validate-bad-output/child/main.tf | 0 .../testdata/validate-bad-output/main.tf | 7 - .../testdata/validate-bad-var/child/main.tf | 0 .../testdata/validate-bad-var/main.tf | 5 - .../testdata/validate-child-bad/child/main.tf | 3 - .../testdata/validate-child-bad/main.tf | 3 - .../validate-child-good/child/main.tf | 3 - .../testdata/validate-child-good/main.tf | 8 - .../validate-required-var/child/main.tf | 1 - .../testdata/validate-required-var/main.tf | 3 - .../testdata/validate-root-bad/main.tf | 3 - .../github.com/hashicorp/go-getter/url.go | 25 - .../hashicorp/go-getter/url_test.go | 95 -- .../hashicorp/go-getter/util_test.go | 49 - .../github.com/hashicorp/go-safetemp/LICENSE | 362 ----- .../hashicorp/go-safetemp/README.md | 10 - .../github.com/hashicorp/go-safetemp/go.mod | 1 - .../hashicorp/go-safetemp/safetemp.go | 40 - .../hashicorp/go-safetemp/safetemp_test.go | 46 - .../hashicorp/go-version/.circleci/config.yml | 60 - .../github.com/hashicorp/go-version/LICENSE | 354 ----- .../github.com/hashicorp/go-version/README.md | 66 - .../hashicorp/go-version/constraint.go | 204 --- .../hashicorp/go-version/constraint_test.go | 126 -- .../github.com/hashicorp/go-version/go.mod | 1 - .../hashicorp/go-version/version.go | 384 ------ .../go-version/version_collection.go | 17 - .../go-version/version_collection_test.go | 46 - .../hashicorp/go-version/version_test.go | 624 --------- .../hashicorp/hcl/.github/ISSUE_TEMPLATE.md | 21 - .../github.com/hashicorp/hcl/.gitignore | 9 - .../github.com/hashicorp/hcl/.travis.yml | 13 - .../licenses/github.com/hashicorp/hcl/LICENSE | 354 ----- .../github.com/hashicorp/hcl/Makefile | 18 - .../github.com/hashicorp/hcl/README.md | 125 -- .../github.com/hashicorp/hcl/appveyor.yml | 19 - .../github.com/hashicorp/hcl/decoder.go | 729 ---------- .../github.com/hashicorp/hcl/decoder_test.go | 1203 ----------------- .../licenses/github.com/hashicorp/hcl/go.mod | 3 - .../licenses/github.com/hashicorp/hcl/go.sum | 2 - .../licenses/github.com/hashicorp/hcl/hcl.go | 11 - .../github.com/hashicorp/hcl/hcl/ast/ast.go | 219 --- .../hashicorp/hcl/hcl/ast/ast_test.go | 200 --- .../github.com/hashicorp/hcl/hcl/ast/walk.go | 52 - .../hashicorp/hcl/hcl/fmtcmd/fmtcmd.go | 162 --- .../hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go | 440 ------ .../hcl/fmtcmd/test-fixtures/.hidden.ignore | 1 - .../hcl/hcl/fmtcmd/test-fixtures/dir.ignore | 0 .../hcl/hcl/fmtcmd/test-fixtures/file.ignore | 1 - .../hcl/hcl/fmtcmd/test-fixtures/good.hcl | 0 .../hashicorp/hcl/hcl/parser/error.go | 17 - .../hashicorp/hcl/hcl/parser/error_test.go | 9 - .../hashicorp/hcl/hcl/parser/parser.go | 532 -------- .../hashicorp/hcl/hcl/parser/parser_test.go | 575 -------- .../parser/test-fixtures/array_comment.hcl | 4 - .../parser/test-fixtures/array_comment_2.hcl | 6 - .../hcl/parser/test-fixtures/assign_colon.hcl | 6 - .../hcl/parser/test-fixtures/assign_deep.hcl | 5 - .../hcl/hcl/parser/test-fixtures/comment.hcl | 15 - .../hcl/parser/test-fixtures/comment_crlf.hcl | 15 - .../parser/test-fixtures/comment_lastline.hcl | 1 - .../parser/test-fixtures/comment_single.hcl | 1 - .../hcl/hcl/parser/test-fixtures/complex.hcl | 42 - .../hcl/parser/test-fixtures/complex_crlf.hcl | 42 - .../hcl/parser/test-fixtures/complex_key.hcl | 1 - .../hcl/hcl/parser/test-fixtures/empty.hcl | 0 .../hcl/parser/test-fixtures/git_crypt.hcl | Bin 10 -> 0 bytes .../test-fixtures/key_without_value.hcl | 1 - .../hcl/hcl/parser/test-fixtures/list.hcl | 1 - .../hcl/parser/test-fixtures/list_comma.hcl | 1 - .../parser/test-fixtures/missing_braces.hcl | 4 - .../hcl/hcl/parser/test-fixtures/multiple.hcl | 2 - .../object_key_assign_without_value.hcl | 3 - .../object_key_assign_without_value2.hcl | 4 - .../object_key_assign_without_value3.hcl | 4 - .../object_key_without_value.hcl | 3 - .../test-fixtures/object_list_comma.hcl | 1 - .../hcl/hcl/parser/test-fixtures/old.hcl | 3 - .../hcl/parser/test-fixtures/structure.hcl | 5 - .../parser/test-fixtures/structure_basic.hcl | 5 - .../parser/test-fixtures/structure_empty.hcl | 1 - .../hcl/hcl/parser/test-fixtures/types.hcl | 7 - .../test-fixtures/unterminated_object.hcl | 2 - .../test-fixtures/unterminated_object_2.hcl | 6 - .../hashicorp/hcl/hcl/printer/nodes.go | 789 ----------- .../hashicorp/hcl/hcl/printer/printer.go | 66 - .../hashicorp/hcl/hcl/printer/printer_test.go | 176 --- .../hcl/hcl/printer/testdata/comment.golden | 39 - .../hcl/hcl/printer/testdata/comment.input | 39 - .../printer/testdata/comment_aligned.golden | 32 - .../printer/testdata/comment_aligned.input | 28 - .../hcl/printer/testdata/comment_array.golden | 13 - .../hcl/printer/testdata/comment_array.input | 13 - .../hcl/printer/testdata/comment_crlf.input | 39 - .../printer/testdata/comment_end_file.golden | 6 - .../printer/testdata/comment_end_file.input | 5 - .../testdata/comment_multiline_indent.golden | 12 - .../testdata/comment_multiline_indent.input | 13 - .../comment_multiline_no_stanza.golden | 7 - .../comment_multiline_no_stanza.input | 6 - .../testdata/comment_multiline_stanza.golden | 10 - .../testdata/comment_multiline_stanza.input | 10 - .../printer/testdata/comment_newline.golden | 3 - .../printer/testdata/comment_newline.input | 2 - .../testdata/comment_object_multi.golden | 9 - .../testdata/comment_object_multi.input | 9 - .../testdata/comment_standalone.golden | 17 - .../printer/testdata/comment_standalone.input | 16 - .../hcl/printer/testdata/complexhcl.golden | 54 - .../hcl/hcl/printer/testdata/complexhcl.input | 53 - .../hcl/printer/testdata/empty_block.golden | 12 - .../hcl/printer/testdata/empty_block.input | 14 - .../hcl/hcl/printer/testdata/list.golden | 46 - .../hcl/hcl/printer/testdata/list.input | 37 - .../hcl/printer/testdata/list_comment.golden | 13 - .../hcl/printer/testdata/list_comment.input | 9 - .../printer/testdata/list_of_objects.golden | 10 - .../printer/testdata/list_of_objects.input | 10 - .../printer/testdata/multiline_string.golden | 7 - .../printer/testdata/multiline_string.input | 7 - .../printer/testdata/object_singleline.golden | 26 - .../printer/testdata/object_singleline.input | 19 - .../testdata/object_with_heredoc.golden | 7 - .../testdata/object_with_heredoc.input | 7 - .../hashicorp/hcl/hcl/scanner/scanner.go | 652 --------- .../hashicorp/hcl/hcl/scanner/scanner_test.go | 642 --------- .../hashicorp/hcl/hcl/strconv/quote.go | 241 ---- .../hashicorp/hcl/hcl/strconv/quote_test.go | 96 -- .../hcl/hcl/test-fixtures/array_comment.hcl | 4 - .../hcl/hcl/test-fixtures/assign_colon.hcl | 6 - .../hcl/hcl/test-fixtures/comment.hcl | 15 - .../hcl/hcl/test-fixtures/comment_single.hcl | 1 - .../hcl/hcl/test-fixtures/complex.hcl | 42 - .../hcl/hcl/test-fixtures/complex_key.hcl | 1 - .../hashicorp/hcl/hcl/test-fixtures/empty.hcl | 0 .../hashicorp/hcl/hcl/test-fixtures/list.hcl | 1 - .../hcl/hcl/test-fixtures/list_comma.hcl | 1 - .../hcl/hcl/test-fixtures/multiple.hcl | 2 - .../hashicorp/hcl/hcl/test-fixtures/old.hcl | 3 - .../hcl/hcl/test-fixtures/structure.hcl | 5 - .../hcl/hcl/test-fixtures/structure_basic.hcl | 5 - .../hcl/hcl/test-fixtures/structure_empty.hcl | 1 - .../hashicorp/hcl/hcl/test-fixtures/types.hcl | 7 - .../hashicorp/hcl/hcl/token/position.go | 46 - .../hashicorp/hcl/hcl/token/token.go | 219 --- .../hashicorp/hcl/hcl/token/token_test.go | 69 - .../github.com/hashicorp/hcl/hcl_test.go | 19 - .../hashicorp/hcl/json/parser/flatten.go | 117 -- .../hashicorp/hcl/json/parser/parser.go | 313 ----- .../hashicorp/hcl/json/parser/parser_test.go | 384 ------ .../hcl/json/parser/test-fixtures/array.json | 4 - .../parser/test-fixtures/bad_input_128.json | 1 - .../test-fixtures/bad_input_tf_8110.json | 7 - .../hcl/json/parser/test-fixtures/basic.json | 3 - .../test-fixtures/good_input_tf_8110.json | 7 - .../hcl/json/parser/test-fixtures/object.json | 5 - .../hcl/json/parser/test-fixtures/types.json | 10 - .../hashicorp/hcl/json/scanner/scanner.go | 451 ------ .../hcl/json/scanner/scanner_test.go | 362 ----- .../hcl/json/test-fixtures/array.json | 4 - .../hcl/json/test-fixtures/basic.json | 3 - .../hcl/json/test-fixtures/object.json | 5 - .../hcl/json/test-fixtures/types.json | 10 - .../hashicorp/hcl/json/token/position.go | 46 - .../hashicorp/hcl/json/token/token.go | 118 -- .../hashicorp/hcl/json/token/token_test.go | 34 - .../licenses/github.com/hashicorp/hcl/lex.go | 38 - .../github.com/hashicorp/hcl/lex_test.go | 37 - .../github.com/hashicorp/hcl/parse.go | 39 - .../hcl/test-fixtures/assign_deep.hcl | 5 - .../hashicorp/hcl/test-fixtures/basic.hcl | 2 - .../hashicorp/hcl/test-fixtures/basic.json | 4 - .../hcl/test-fixtures/basic_int_string.hcl | 1 - .../hcl/test-fixtures/basic_squish.hcl | 3 - .../hcl/test-fixtures/block_assign.hcl | 2 - .../hcl/test-fixtures/decode_policy.hcl | 15 - .../hcl/test-fixtures/decode_policy.json | 19 - .../hcl/test-fixtures/decode_tf_variable.hcl | 10 - .../hcl/test-fixtures/decode_tf_variable.json | 14 - .../hashicorp/hcl/test-fixtures/empty.hcl | 1 - .../hashicorp/hcl/test-fixtures/escape.hcl | 6 - .../hcl/test-fixtures/escape_backslash.hcl | 5 - .../hashicorp/hcl/test-fixtures/flat.hcl | 2 - .../hashicorp/hcl/test-fixtures/float.hcl | 2 - .../hashicorp/hcl/test-fixtures/float.json | 4 - .../hashicorp/hcl/test-fixtures/git_crypt.hcl | Bin 10 -> 0 bytes .../hcl/test-fixtures/interpolate.json | 3 - .../hcl/test-fixtures/list_of_lists.hcl | 2 - .../hcl/test-fixtures/list_of_maps.hcl | 4 - .../hashicorp/hcl/test-fixtures/multiline.hcl | 4 - .../hcl/test-fixtures/multiline.json | 3 - .../hcl/test-fixtures/multiline_bad.hcl | 4 - .../hcl/test-fixtures/multiline_indented.hcl | 4 - .../hcl/test-fixtures/multiline_literal.hcl | 2 - .../multiline_literal_with_hil.hcl | 2 - .../hcl/test-fixtures/multiline_no_eof.hcl | 5 - .../multiline_no_hanging_indent.hcl | 5 - .../hcl/test-fixtures/multiline_no_marker.hcl | 1 - .../test-fixtures/nested_block_comment.hcl | 5 - .../hcl/test-fixtures/nested_provider_bad.hcl | 5 - .../hcl/test-fixtures/null_strings.json | 7 - .../hcl/test-fixtures/object_list.json | 15 - .../hcl/test-fixtures/object_with_bool.hcl | 6 - .../hcl/test-fixtures/scientific.hcl | 6 - .../hcl/test-fixtures/scientific.json | 8 - .../hcl/test-fixtures/slice_expand.hcl | 7 - .../hashicorp/hcl/test-fixtures/structure.hcl | 5 - .../hcl/test-fixtures/structure.json | 8 - .../hcl/test-fixtures/structure2.hcl | 9 - .../hcl/test-fixtures/structure2.json | 10 - .../hcl/test-fixtures/structure_flat.json | 8 - .../hcl/test-fixtures/structure_flatmap.hcl | 7 - .../hcl/test-fixtures/structure_list.hcl | 6 - .../hcl/test-fixtures/structure_list.json | 7 - .../test-fixtures/structure_list_deep.json | 16 - .../test-fixtures/structure_list_empty.json | 3 - .../hcl/test-fixtures/structure_multi.hcl | 7 - .../hcl/test-fixtures/structure_multi.json | 11 - .../hcl/test-fixtures/terraform_heroku.hcl | 5 - .../hcl/test-fixtures/terraform_heroku.json | 6 - .../terraform_variable_invalid.json | 5 - .../hashicorp/hcl/test-fixtures/tfvars.hcl | 3 - .../unterminated_block_comment.hcl | 2 - .../hcl/test-fixtures/unterminated_brace.hcl | 2 - .../hashicorp/hcl/testhelper/unix2dos.go | 15 - .../github.com/hectane/go-acl/LICENSE.txt | 9 - .../github.com/huandu/xstrings/LICENSE | 22 - .../licenses/github.com/imdario/mergo/LICENSE | 28 - .../github.com/intel-go/cpuid/LICENSE | 28 - .../github.com/jmespath/go-jmespath/LICENSE | 13 - .../github.com/josharian/intern/license.md | 21 - .../github.com/json-iterator/go/LICENSE | 21 - .../licenses/github.com/juju/clock/.gitignore | 1 - .../licenses/github.com/juju/clock/LICENSE | 191 --- .../licenses/github.com/juju/clock/Makefile | 20 - .../licenses/github.com/juju/clock/README.md | 7 - .../licenses/github.com/juju/clock/clock.go | 53 - .../licenses/github.com/juju/clock/go.mod | 23 - .../licenses/github.com/juju/clock/go.sum | 87 -- .../juju/clock/monotonic/monotonic.go | 22 - .../juju/clock/monotonic/monotonic.s | 4 - .../juju/clock/monotonic/monotonic_test.go | 33 - .../github.com/juju/clock/testclock/clock.go | 274 ---- .../juju/clock/testclock/clock_test.go | 325 ----- .../juju/clock/testclock/dilated.go | 221 --- .../juju/clock/testclock/dilated_test.go | 224 --- .../juju/clock/testclock/interfaces.go | 17 - .../juju/clock/testclock/package_test.go | 20 - .../licenses/github.com/juju/clock/wall.go | 47 - .../github.com/juju/errors/.gitignore | 23 - .../licenses/github.com/juju/errors/LICENSE | 191 --- .../licenses/github.com/juju/errors/Makefile | 24 - .../licenses/github.com/juju/errors/README.md | 707 ---------- .../github.com/juju/errors/dependencies.tsv | 5 - .../licenses/github.com/juju/errors/doc.go | 79 -- .../licenses/github.com/juju/errors/error.go | 176 --- .../github.com/juju/errors/error_test.go | 178 --- .../github.com/juju/errors/errortypes.go | 382 ------ .../github.com/juju/errors/errortypes_test.go | 177 --- .../github.com/juju/errors/example_test.go | 23 - .../github.com/juju/errors/export_test.go | 12 - .../github.com/juju/errors/functions.go | 330 ----- .../github.com/juju/errors/functions_test.go | 334 ----- .../licenses/github.com/juju/errors/go.mod | 16 - .../licenses/github.com/juju/errors/go.sum | 76 -- .../github.com/juju/errors/package_test.go | 95 -- .../licenses/github.com/juju/errors/path.go | 32 - .../github.com/juju/errors/path_test.go | 38 - .../github.com/juju/fslock/.gitignore | 24 - .../licenses/github.com/juju/fslock/LICENSE | 191 --- .../licenses/github.com/juju/fslock/README.md | 74 - .../licenses/github.com/juju/fslock/fslock.go | 32 - .../github.com/juju/fslock/fslock_nix.go | 89 -- .../github.com/juju/fslock/fslock_test.go | 328 ----- .../github.com/juju/fslock/fslock_windows.go | 165 --- .../licenses/github.com/juju/mutex/LICENSE | 191 --- .../licenses/github.com/juju/mutex/Makefile | 20 - .../licenses/github.com/juju/mutex/README.md | 147 -- .../licenses/github.com/juju/mutex/doc.go | 16 - .../licenses/github.com/juju/mutex/errors.go | 13 - .../github.com/juju/mutex/export_test.go | 9 - .../licenses/github.com/juju/mutex/go.mod | 25 - .../licenses/github.com/juju/mutex/go.sum | 101 -- .../licenses/github.com/juju/mutex/mutex.go | 92 -- .../github.com/juju/mutex/mutex_flock.go | 202 --- .../github.com/juju/mutex/mutex_mock_test.go | 58 - .../github.com/juju/mutex/mutex_test.go | 526 ------- .../github.com/juju/mutex/mutex_windows.go | 262 ---- .../github.com/juju/mutex/package_test.go | 14 - .../github.com/kballard/go-shellquote/LICENSE | 19 - .../github.com/klauspost/compress/LICENSE | 304 ----- .../compress/internal/snapref/LICENSE | 27 - .../compress/zstd/internal/xxhash/LICENSE.txt | 22 - .../github.com/klauspost/cpuid/LICENSE | 22 - .../pkg/drivers/vmware/config/LICENSE | 201 --- .../magiconair/properties/LICENSE.md | 24 - .../github.com/mailru/easyjson/LICENSE | 7 - .../github.com/mattn/go-colorable/LICENSE | 21 - .../github.com/mattn/go-isatty/LICENSE | 9 - .../github.com/mattn/go-runewidth/LICENSE | 21 - .../github.com/mitchellh/go-homedir/LICENSE | 21 - .../github.com/mitchellh/go-ps/LICENSE.md | 21 - .../mitchellh/go-testing-interface/LICENSE | 21 - .../mitchellh/go-wordwrap/LICENSE.md | 21 - .../github.com/mitchellh/mapstructure/LICENSE | 21 - .../github.com/moby/spdystream/LICENSE | 202 --- .../github.com/moby/spdystream/NOTICE | 5 - .../github.com/moby/sys/mount/LICENSE | 202 --- .../github.com/moby/sys/mountinfo/LICENSE | 202 --- .../licenses/github.com/moby/term/LICENSE | 191 --- .../github.com/modern-go/concurrent/LICENSE | 201 --- .../github.com/modern-go/reflect2/LICENSE | 201 --- .../licenses/github.com/muesli/reflow/LICENSE | 21 - .../github.com/munnerz/goautoneg/LICENSE | 31 - .../olekukonko/tablewriter/LICENSE.md | 19 - .../opencontainers/go-digest/LICENSE | 192 --- .../image-spec/specs-go/LICENSE | 191 --- .../opencontainers/runc/libcontainer/LICENSE | 191 --- .../opencontainers/runc/libcontainer/NOTICE | 17 - .../runtime-spec/specs-go/LICENSE | 191 --- .../licenses/github.com/otiai10/copy/LICENSE | 21 - .../github.com/pelletier/go-toml/v2/LICENSE | 21 - .../github.com/phayes/freeport/LICENSE.md | 15 - .../licenses/github.com/pkg/browser/LICENSE | 23 - .../licenses/github.com/pkg/errors/LICENSE | 23 - .../licenses/github.com/pkg/profile/LICENSE | 24 - .../github.com/rivo/uniseg/LICENSE.txt | 21 - .../russross/blackfriday/LICENSE.txt | 28 - .../github.com/samalba/dockerclient/LICENSE | 202 --- .../github.com/shirou/gopsutil/v3/LICENSE | 61 - .../github.com/sirupsen/logrus/LICENSE | 21 - .../github.com/spf13/afero/LICENSE.txt | 174 --- .../licenses/github.com/spf13/cast/LICENSE | 21 - .../github.com/spf13/cobra/LICENSE.txt | 174 --- .../spf13/jwalterweatherman/LICENSE | 21 - .../licenses/github.com/spf13/pflag/LICENSE | 28 - .../licenses/github.com/spf13/viper/LICENSE | 21 - .../github.com/subosito/gotenv/LICENSE | 21 - .../github.com/tklauser/go-sysconf/LICENSE | 29 - .../github.com/tklauser/numcpus/LICENSE | 202 --- .../licenses/github.com/ulikunitz/xz/LICENSE | 26 - .../vbatts/tar-split/archive/tar/LICENSE | 28 - .../licenses/github.com/xo/terminfo/LICENSE | 21 - .../licenses/go.opencensus.io/LICENSE | 202 --- .../licenses/go.opentelemetry.io/otel/LICENSE | 201 --- .../go.opentelemetry.io/otel/sdk/LICENSE | 201 --- .../go.opentelemetry.io/otel/trace/LICENSE | 201 --- .../licenses/go.uber.org/atomic/LICENSE.txt | 19 - .../licenses/go.uber.org/multierr/LICENSE.txt | 19 - .../licenses/go.uber.org/zap/LICENSE.txt | 19 - .../licenses/golang.org/x/crypto/LICENSE | 27 - .../licenses/golang.org/x/exp/ebnf/LICENSE | 27 - .../licenses/golang.org/x/mod/semver/LICENSE | 27 - .../licenses/golang.org/x/net/LICENSE | 27 - .../licenses/golang.org/x/oauth2/LICENSE | 27 - .../licenses/golang.org/x/sync/LICENSE | 27 - .../licenses/golang.org/x/sys/LICENSE | 27 - .../licenses/golang.org/x/term/LICENSE | 27 - .../licenses/golang.org/x/text/LICENSE | 27 - .../licenses/golang.org/x/time/rate/LICENSE | 27 - .../licenses/golang.org/x/xerrors/LICENSE | 27 - .../licenses/google.golang.org/api/LICENSE | 27 - .../internal/third_party/uritemplates/LICENSE | 27 - .../google.golang.org/genproto/LICENSE | 202 --- .../licenses/google.golang.org/grpc/LICENSE | 202 --- .../google.golang.org/grpc/NOTICE.txt | 13 - .../google.golang.org/protobuf/LICENSE | 27 - .../licenses/gopkg.in/inf.v0/LICENSE | 28 - .../licenses/gopkg.in/ini.v1/LICENSE | 191 --- .../licenses/gopkg.in/yaml.v2/LICENSE | 201 --- .../licenses/gopkg.in/yaml.v2/NOTICE | 13 - .../licenses/gopkg.in/yaml.v3/LICENSE | 50 - .../licenses/gopkg.in/yaml.v3/NOTICE | 13 - test/integration/licenses/k8s.io/api/LICENSE | 202 --- .../licenses/k8s.io/apimachinery/pkg/LICENSE | 202 --- .../third_party/forked/golang/LICENSE | 27 - .../licenses/k8s.io/client-go/LICENSE | 202 --- .../cluster-bootstrap/token/api/LICENSE | 202 --- .../k8s.io/component-base/featuregate/LICENSE | 202 --- .../licenses/k8s.io/klog/v2/LICENSE | 191 --- .../licenses/k8s.io/kube-openapi/pkg/LICENSE | 202 --- .../kube-openapi/pkg/validation/spec/LICENSE | 202 --- .../licenses/k8s.io/kubectl/pkg/util/LICENSE | 201 --- .../licenses/k8s.io/minikube/LICENSE | 202 --- .../minikube/cmd/minikube/cmd/license.go | 42 - .../pkg/minikube/download/licenses.go | 50 - .../third_party/go-dockerclient/LICENSE | 23 - .../k8s.io/minikube/third_party/go9p/LICENSE | 27 - .../integration/licenses/k8s.io/utils/LICENSE | 202 --- .../third_party/forked/golang/net/LICENSE | 27 - .../licenses/sigs.k8s.io/json/LICENSE | 238 ---- .../structured-merge-diff/v4/LICENSE | 201 --- .../licenses/sigs.k8s.io/yaml/LICENSE | 50 - 659 files changed, 49255 deletions(-) delete mode 100644 test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE delete mode 100644 test/integration/licenses/cloud.google.com/go/iam/LICENSE delete mode 100644 test/integration/licenses/cloud.google.com/go/internal/LICENSE delete mode 100644 test/integration/licenses/cloud.google.com/go/storage/LICENSE delete mode 100644 test/integration/licenses/cloud.google.com/go/trace/LICENSE delete mode 100644 test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE delete mode 100644 test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE delete mode 100644 test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE delete mode 100644 test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE delete mode 100644 test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE delete mode 100644 test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE delete mode 100644 test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE delete mode 100644 test/integration/licenses/github.com/VividCortex/ewma/LICENSE delete mode 100644 test/integration/licenses/github.com/VividCortex/godaemon/LICENSE delete mode 100644 test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE delete mode 100644 test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt delete mode 100644 test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt delete mode 100644 test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE delete mode 100644 test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE delete mode 100644 test/integration/licenses/github.com/blang/semver/LICENSE delete mode 100644 test/integration/licenses/github.com/blang/semver/v4/LICENSE delete mode 100644 test/integration/licenses/github.com/briandowns/spinner/LICENSE delete mode 100644 test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE delete mode 100644 test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE delete mode 100644 test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE delete mode 100644 test/integration/licenses/github.com/containerd/containerd/LICENSE delete mode 100644 test/integration/licenses/github.com/containerd/containerd/NOTICE delete mode 100644 test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE delete mode 100644 test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE delete mode 100644 test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE delete mode 100644 test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE delete mode 100644 test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE delete mode 100644 test/integration/licenses/github.com/docker/cli/cli/config/LICENSE delete mode 100644 test/integration/licenses/github.com/docker/cli/cli/config/NOTICE delete mode 100644 test/integration/licenses/github.com/docker/distribution/LICENSE delete mode 100644 test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE delete mode 100644 test/integration/licenses/github.com/docker/docker/LICENSE delete mode 100644 test/integration/licenses/github.com/docker/docker/NOTICE delete mode 100644 test/integration/licenses/github.com/docker/go-connections/LICENSE delete mode 100644 test/integration/licenses/github.com/docker/go-units/LICENSE delete mode 100644 test/integration/licenses/github.com/docker/machine/LICENSE delete mode 100644 test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE delete mode 100644 test/integration/licenses/github.com/fatih/color/LICENSE.md delete mode 100644 test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE delete mode 100644 test/integration/licenses/github.com/go-logr/logr/LICENSE delete mode 100644 test/integration/licenses/github.com/go-logr/stdr/LICENSE delete mode 100644 test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE delete mode 100644 test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE delete mode 100644 test/integration/licenses/github.com/go-openapi/swag/LICENSE delete mode 100644 test/integration/licenses/github.com/godbus/dbus/v5/LICENSE delete mode 100644 test/integration/licenses/github.com/gogo/protobuf/LICENSE delete mode 100644 test/integration/licenses/github.com/golang/groupcache/lru/LICENSE delete mode 100644 test/integration/licenses/github.com/golang/protobuf/LICENSE delete mode 100644 test/integration/licenses/github.com/google/gnostic/LICENSE delete mode 100644 test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE delete mode 100644 test/integration/licenses/github.com/google/go-containerregistry/LICENSE delete mode 100644 test/integration/licenses/github.com/google/go-github/v43/github/LICENSE delete mode 100644 test/integration/licenses/github.com/google/go-querystring/query/LICENSE delete mode 100644 test/integration/licenses/github.com/google/gofuzz/LICENSE delete mode 100644 test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE delete mode 100644 test/integration/licenses/github.com/google/uuid/LICENSE delete mode 100644 test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE delete mode 100644 test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE delete mode 100644 test/integration/licenses/github.com/gookit/color/LICENSE delete mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE delete mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md delete mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod delete mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.gitignore delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/LICENSE delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/README.md delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/checksum.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/common.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_base.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_git.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_http.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/get_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/go.mod delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/go.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/module_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/netrc.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/source.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/source_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/storage.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-tar/permissions.tar delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/permissions.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted-multi/archive.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted/archive.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic%2Ftest/foo/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic%2Ftest/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic%2Ftest/subdir/sub.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-dot/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-file-archive/archive.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-file/foo.txt delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/00changelog.i delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/branch delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/branch2-served delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/rbc-names-v1 delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/rbc-revs-v1 delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/cache/tags delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/dirstate delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00changelog.i delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00manifest.i delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/foo.txt.i delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main.tf.i delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main__branch.tf.i delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo.backup.fncache delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo.backupfiles delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo.phaseroots delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.bookmarks delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.branch delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.desc delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/undo.dirstate delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/baz/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/subdir/sub.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-bz2/single.bz2 delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-gz/single.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/extended_header.tar delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/implied_dir.tar delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/unix_time_0.tar delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/empty.tar.bz2 delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/multiple.tar.bz2 delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/ordering.tar.bz2 delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/single.tar.bz2 delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/empty.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple_dir.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/ordering.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/outside_parent.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/single.tar.gz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/empty.tar.xz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple.tar.xz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple_dir.tar.xz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/ordering.tar.xz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/single.tar.xz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/empty.tar.zst delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/multiple.tar.zst delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/multiple_dir.tar.zst delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/ordering.tar.zst delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/outside_parent.tar.zst delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/single.tar.zst delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-xz/single.xz delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/empty.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/multiple.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/outside_parent.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/single.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_empty.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_missing_dir.zip delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zst/single.zst delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/detect-file-symlink-pwd/real/hello.txt delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/foo/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/child/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/child/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/url.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/url_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-getter/util_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE delete mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/README.md delete mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod delete mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/LICENSE delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/README.md delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/constraint.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/go.mod delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version_collection.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/go-version/version_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/.gitignore delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/.travis.yml delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/LICENSE delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/Makefile delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/README.md delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/appveyor.yml delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/decoder.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/go.mod delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/go.sum delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/array_comment_2.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_colon.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/assign_deep.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_crlf.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_lastline.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/comment_single.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_crlf.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/complex_key.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/empty.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/git_crypt.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/key_without_value.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/list_comma.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/missing_braces.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/multiple.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value2.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_assign_without_value3.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_key_without_value.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/object_list_comma.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/old.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_basic.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/structure_empty.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/types.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/unterminated_object.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/test-fixtures/unterminated_object_2.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/nodes.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_no_stanza.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_stanza.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_newline.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_object_multi.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_standalone.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/complexhcl.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/empty_block.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_comment.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/list_of_objects.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/multiline_string.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_singleline.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.golden delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/object_with_heredoc.input delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/hcl_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/flatten.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/lex.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/lex_test.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/parse.go delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_bad.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_indented.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_literal.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_literal_with_hil.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_no_eof.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_no_hanging_indent.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline_no_marker.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/nested_block_comment.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/nested_provider_bad.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/null_strings.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/object_list.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/object_with_bool.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/scientific.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/scientific.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/slice_expand.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure2.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure2.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_flat.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_flatmap.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list_deep.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_list_empty.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_multi.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/structure_multi.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/terraform_heroku.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/terraform_variable_invalid.json delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/tfvars.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/unterminated_block_comment.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/unterminated_brace.hcl delete mode 100644 test/integration/licenses/github.com/hashicorp/hcl/testhelper/unix2dos.go delete mode 100644 test/integration/licenses/github.com/hectane/go-acl/LICENSE.txt delete mode 100644 test/integration/licenses/github.com/huandu/xstrings/LICENSE delete mode 100644 test/integration/licenses/github.com/imdario/mergo/LICENSE delete mode 100644 test/integration/licenses/github.com/intel-go/cpuid/LICENSE delete mode 100644 test/integration/licenses/github.com/jmespath/go-jmespath/LICENSE delete mode 100644 test/integration/licenses/github.com/josharian/intern/license.md delete mode 100644 test/integration/licenses/github.com/json-iterator/go/LICENSE delete mode 100644 test/integration/licenses/github.com/juju/clock/.gitignore delete mode 100644 test/integration/licenses/github.com/juju/clock/LICENSE delete mode 100644 test/integration/licenses/github.com/juju/clock/Makefile delete mode 100644 test/integration/licenses/github.com/juju/clock/README.md delete mode 100644 test/integration/licenses/github.com/juju/clock/clock.go delete mode 100644 test/integration/licenses/github.com/juju/clock/go.mod delete mode 100644 test/integration/licenses/github.com/juju/clock/go.sum delete mode 100644 test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go delete mode 100644 test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s delete mode 100644 test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go delete mode 100644 test/integration/licenses/github.com/juju/clock/testclock/clock.go delete mode 100644 test/integration/licenses/github.com/juju/clock/testclock/clock_test.go delete mode 100644 test/integration/licenses/github.com/juju/clock/testclock/dilated.go delete mode 100644 test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go delete mode 100644 test/integration/licenses/github.com/juju/clock/testclock/interfaces.go delete mode 100644 test/integration/licenses/github.com/juju/clock/testclock/package_test.go delete mode 100644 test/integration/licenses/github.com/juju/clock/wall.go delete mode 100644 test/integration/licenses/github.com/juju/errors/.gitignore delete mode 100644 test/integration/licenses/github.com/juju/errors/LICENSE delete mode 100644 test/integration/licenses/github.com/juju/errors/Makefile delete mode 100644 test/integration/licenses/github.com/juju/errors/README.md delete mode 100644 test/integration/licenses/github.com/juju/errors/dependencies.tsv delete mode 100644 test/integration/licenses/github.com/juju/errors/doc.go delete mode 100644 test/integration/licenses/github.com/juju/errors/error.go delete mode 100644 test/integration/licenses/github.com/juju/errors/error_test.go delete mode 100644 test/integration/licenses/github.com/juju/errors/errortypes.go delete mode 100644 test/integration/licenses/github.com/juju/errors/errortypes_test.go delete mode 100644 test/integration/licenses/github.com/juju/errors/example_test.go delete mode 100644 test/integration/licenses/github.com/juju/errors/export_test.go delete mode 100644 test/integration/licenses/github.com/juju/errors/functions.go delete mode 100644 test/integration/licenses/github.com/juju/errors/functions_test.go delete mode 100644 test/integration/licenses/github.com/juju/errors/go.mod delete mode 100644 test/integration/licenses/github.com/juju/errors/go.sum delete mode 100644 test/integration/licenses/github.com/juju/errors/package_test.go delete mode 100644 test/integration/licenses/github.com/juju/errors/path.go delete mode 100644 test/integration/licenses/github.com/juju/errors/path_test.go delete mode 100644 test/integration/licenses/github.com/juju/fslock/.gitignore delete mode 100644 test/integration/licenses/github.com/juju/fslock/LICENSE delete mode 100644 test/integration/licenses/github.com/juju/fslock/README.md delete mode 100644 test/integration/licenses/github.com/juju/fslock/fslock.go delete mode 100644 test/integration/licenses/github.com/juju/fslock/fslock_nix.go delete mode 100644 test/integration/licenses/github.com/juju/fslock/fslock_test.go delete mode 100644 test/integration/licenses/github.com/juju/fslock/fslock_windows.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/LICENSE delete mode 100644 test/integration/licenses/github.com/juju/mutex/Makefile delete mode 100644 test/integration/licenses/github.com/juju/mutex/README.md delete mode 100644 test/integration/licenses/github.com/juju/mutex/doc.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/errors.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/export_test.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/go.mod delete mode 100644 test/integration/licenses/github.com/juju/mutex/go.sum delete mode 100644 test/integration/licenses/github.com/juju/mutex/mutex.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_flock.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_test.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/mutex_windows.go delete mode 100644 test/integration/licenses/github.com/juju/mutex/package_test.go delete mode 100644 test/integration/licenses/github.com/kballard/go-shellquote/LICENSE delete mode 100644 test/integration/licenses/github.com/klauspost/compress/LICENSE delete mode 100644 test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE delete mode 100644 test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt delete mode 100644 test/integration/licenses/github.com/klauspost/cpuid/LICENSE delete mode 100644 test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE delete mode 100644 test/integration/licenses/github.com/magiconair/properties/LICENSE.md delete mode 100644 test/integration/licenses/github.com/mailru/easyjson/LICENSE delete mode 100644 test/integration/licenses/github.com/mattn/go-colorable/LICENSE delete mode 100644 test/integration/licenses/github.com/mattn/go-isatty/LICENSE delete mode 100644 test/integration/licenses/github.com/mattn/go-runewidth/LICENSE delete mode 100644 test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE delete mode 100644 test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md delete mode 100644 test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE delete mode 100644 test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md delete mode 100644 test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE delete mode 100644 test/integration/licenses/github.com/moby/spdystream/LICENSE delete mode 100644 test/integration/licenses/github.com/moby/spdystream/NOTICE delete mode 100644 test/integration/licenses/github.com/moby/sys/mount/LICENSE delete mode 100644 test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE delete mode 100644 test/integration/licenses/github.com/moby/term/LICENSE delete mode 100644 test/integration/licenses/github.com/modern-go/concurrent/LICENSE delete mode 100644 test/integration/licenses/github.com/modern-go/reflect2/LICENSE delete mode 100644 test/integration/licenses/github.com/muesli/reflow/LICENSE delete mode 100644 test/integration/licenses/github.com/munnerz/goautoneg/LICENSE delete mode 100644 test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md delete mode 100644 test/integration/licenses/github.com/opencontainers/go-digest/LICENSE delete mode 100644 test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE delete mode 100644 test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE delete mode 100644 test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE delete mode 100644 test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE delete mode 100644 test/integration/licenses/github.com/otiai10/copy/LICENSE delete mode 100644 test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE delete mode 100644 test/integration/licenses/github.com/phayes/freeport/LICENSE.md delete mode 100644 test/integration/licenses/github.com/pkg/browser/LICENSE delete mode 100644 test/integration/licenses/github.com/pkg/errors/LICENSE delete mode 100644 test/integration/licenses/github.com/pkg/profile/LICENSE delete mode 100644 test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt delete mode 100644 test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt delete mode 100644 test/integration/licenses/github.com/samalba/dockerclient/LICENSE delete mode 100644 test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE delete mode 100644 test/integration/licenses/github.com/sirupsen/logrus/LICENSE delete mode 100644 test/integration/licenses/github.com/spf13/afero/LICENSE.txt delete mode 100644 test/integration/licenses/github.com/spf13/cast/LICENSE delete mode 100644 test/integration/licenses/github.com/spf13/cobra/LICENSE.txt delete mode 100644 test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE delete mode 100644 test/integration/licenses/github.com/spf13/pflag/LICENSE delete mode 100644 test/integration/licenses/github.com/spf13/viper/LICENSE delete mode 100644 test/integration/licenses/github.com/subosito/gotenv/LICENSE delete mode 100644 test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE delete mode 100644 test/integration/licenses/github.com/tklauser/numcpus/LICENSE delete mode 100644 test/integration/licenses/github.com/ulikunitz/xz/LICENSE delete mode 100644 test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE delete mode 100644 test/integration/licenses/github.com/xo/terminfo/LICENSE delete mode 100644 test/integration/licenses/go.opencensus.io/LICENSE delete mode 100644 test/integration/licenses/go.opentelemetry.io/otel/LICENSE delete mode 100644 test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE delete mode 100644 test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE delete mode 100644 test/integration/licenses/go.uber.org/atomic/LICENSE.txt delete mode 100644 test/integration/licenses/go.uber.org/multierr/LICENSE.txt delete mode 100644 test/integration/licenses/go.uber.org/zap/LICENSE.txt delete mode 100644 test/integration/licenses/golang.org/x/crypto/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/exp/ebnf/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/mod/semver/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/net/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/oauth2/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/sync/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/sys/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/term/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/text/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/time/rate/LICENSE delete mode 100644 test/integration/licenses/golang.org/x/xerrors/LICENSE delete mode 100644 test/integration/licenses/google.golang.org/api/LICENSE delete mode 100644 test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE delete mode 100644 test/integration/licenses/google.golang.org/genproto/LICENSE delete mode 100644 test/integration/licenses/google.golang.org/grpc/LICENSE delete mode 100644 test/integration/licenses/google.golang.org/grpc/NOTICE.txt delete mode 100644 test/integration/licenses/google.golang.org/protobuf/LICENSE delete mode 100644 test/integration/licenses/gopkg.in/inf.v0/LICENSE delete mode 100644 test/integration/licenses/gopkg.in/ini.v1/LICENSE delete mode 100644 test/integration/licenses/gopkg.in/yaml.v2/LICENSE delete mode 100644 test/integration/licenses/gopkg.in/yaml.v2/NOTICE delete mode 100644 test/integration/licenses/gopkg.in/yaml.v3/LICENSE delete mode 100644 test/integration/licenses/gopkg.in/yaml.v3/NOTICE delete mode 100644 test/integration/licenses/k8s.io/api/LICENSE delete mode 100644 test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE delete mode 100644 test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE delete mode 100644 test/integration/licenses/k8s.io/client-go/LICENSE delete mode 100644 test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE delete mode 100644 test/integration/licenses/k8s.io/component-base/featuregate/LICENSE delete mode 100644 test/integration/licenses/k8s.io/klog/v2/LICENSE delete mode 100644 test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE delete mode 100644 test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE delete mode 100644 test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE delete mode 100644 test/integration/licenses/k8s.io/minikube/LICENSE delete mode 100644 test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go delete mode 100644 test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go delete mode 100644 test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE delete mode 100644 test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE delete mode 100644 test/integration/licenses/k8s.io/utils/LICENSE delete mode 100644 test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE delete mode 100644 test/integration/licenses/sigs.k8s.io/json/LICENSE delete mode 100644 test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE delete mode 100644 test/integration/licenses/sigs.k8s.io/yaml/LICENSE diff --git a/go.mod b/go.mod index bd9168af8b..25fa05be48 100644 --- a/go.mod +++ b/go.mod @@ -95,7 +95,6 @@ require ( github.com/juju/mutex/v2 v2.0.0 github.com/opencontainers/runc v1.1.4 github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c ) require ( @@ -165,8 +164,6 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 // indirect github.com/klauspost/compress v1.15.11 // indirect - github.com/kr/pretty v0.3.0 // indirect - github.com/kr/text v0.2.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mailru/easyjson v0.7.6 // indirect @@ -196,7 +193,6 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/prometheus v2.5.0+incompatible // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.6.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.2 // indirect diff --git a/go.sum b/go.sum index 8f2451ea74..7fc6221516 100644 --- a/go.sum +++ b/go.sum @@ -723,7 +723,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= @@ -960,7 +959,6 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= 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= diff --git a/test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE b/test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/cloud.google.com/go/compute/metadata/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/cloud.google.com/go/iam/LICENSE b/test/integration/licenses/cloud.google.com/go/iam/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/cloud.google.com/go/iam/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/cloud.google.com/go/internal/LICENSE b/test/integration/licenses/cloud.google.com/go/internal/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/cloud.google.com/go/internal/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/cloud.google.com/go/storage/LICENSE b/test/integration/licenses/cloud.google.com/go/storage/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/cloud.google.com/go/storage/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/cloud.google.com/go/trace/LICENSE b/test/integration/licenses/cloud.google.com/go/trace/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/cloud.google.com/go/trace/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE b/test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE deleted file mode 100644 index b0c9bf2b25..0000000000 --- a/test/integration/licenses/github.com/Delta456/box-cli-maker/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Swastik Baranwal - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE b/test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/GoogleCloudPlatform/docker-credential-gcr/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE b/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE b/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE b/test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE deleted file mode 100644 index 6d0eb9d5d6..0000000000 --- a/test/integration/licenses/github.com/MakeNowJust/heredoc/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 TSUYUSATO Kitsune - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE b/test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE deleted file mode 100644 index 4b9986dea7..0000000000 --- a/test/integration/licenses/github.com/PuerkitoBio/purell/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012, Martin Angers -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE b/test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE deleted file mode 100644 index 7448756763..0000000000 --- a/test/integration/licenses/github.com/PuerkitoBio/urlesc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/VividCortex/ewma/LICENSE b/test/integration/licenses/github.com/VividCortex/ewma/LICENSE deleted file mode 100644 index a78d643ed8..0000000000 --- a/test/integration/licenses/github.com/VividCortex/ewma/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2013 VividCortex - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/VividCortex/godaemon/LICENSE b/test/integration/licenses/github.com/VividCortex/godaemon/LICENSE deleted file mode 100644 index 63d89b52d8..0000000000 --- a/test/integration/licenses/github.com/VividCortex/godaemon/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ - Copyright (c) 2013 VividCortex - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE b/test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/Xuanwo/go-locale/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt b/test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/aws/aws-sdk-go/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt b/test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt deleted file mode 100644 index 899129ecc4..0000000000 --- a/test/integration/licenses/github.com/aws/aws-sdk-go/NOTICE.txt +++ /dev/null @@ -1,3 +0,0 @@ -AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. -Copyright 2014-2015 Stripe, Inc. diff --git a/test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE b/test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE b/test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE deleted file mode 100644 index aade9a58b1..0000000000 --- a/test/integration/licenses/github.com/bgentry/go-netrc/netrc/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Original version Copyright © 2010 Fazlul Shahriar . Newer -portions Copyright © 2014 Blake Gentry . - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/blang/semver/LICENSE b/test/integration/licenses/github.com/blang/semver/LICENSE deleted file mode 100644 index 5ba5c86fcb..0000000000 --- a/test/integration/licenses/github.com/blang/semver/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2014 Benedikt Lang - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/test/integration/licenses/github.com/blang/semver/v4/LICENSE b/test/integration/licenses/github.com/blang/semver/v4/LICENSE deleted file mode 100644 index 5ba5c86fcb..0000000000 --- a/test/integration/licenses/github.com/blang/semver/v4/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2014 Benedikt Lang - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/test/integration/licenses/github.com/briandowns/spinner/LICENSE b/test/integration/licenses/github.com/briandowns/spinner/LICENSE deleted file mode 100644 index dd5b3a58aa..0000000000 --- a/test/integration/licenses/github.com/briandowns/spinner/LICENSE +++ /dev/null @@ -1,174 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE b/test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE deleted file mode 100644 index 89b8179965..0000000000 --- a/test/integration/licenses/github.com/cenkalti/backoff/v4/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Cenk Altı - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE b/test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE deleted file mode 100644 index 5119703339..0000000000 --- a/test/integration/licenses/github.com/cheggaaa/pb/v3/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2012-2015, Sergey Cherepanov -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE b/test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/cloudevents/sdk-go/v2/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/containerd/containerd/LICENSE b/test/integration/licenses/github.com/containerd/containerd/LICENSE deleted file mode 100644 index 584149b6ee..0000000000 --- a/test/integration/licenses/github.com/containerd/containerd/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright The containerd 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 - - https://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. diff --git a/test/integration/licenses/github.com/containerd/containerd/NOTICE b/test/integration/licenses/github.com/containerd/containerd/NOTICE deleted file mode 100644 index 8915f02773..0000000000 --- a/test/integration/licenses/github.com/containerd/containerd/NOTICE +++ /dev/null @@ -1,16 +0,0 @@ -Docker -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE b/test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/containerd/stargz-snapshotter/estargz/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE b/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE deleted file mode 100644 index 37ec93a14f..0000000000 --- a/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE b/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE deleted file mode 100644 index 23a0ada2fb..0000000000 --- a/test/integration/licenses/github.com/coreos/go-systemd/v22/dbus/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -CoreOS Project -Copyright 2018 CoreOS, Inc - -This product includes software developed at CoreOS, Inc. -(http://www.coreos.com/). diff --git a/test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE b/test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE deleted file mode 100644 index bec842f294..0000000000 --- a/test/integration/licenses/github.com/cyphar/filepath-securejoin/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved. -Copyright (C) 2017 SUSE LLC. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE b/test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE deleted file mode 100644 index bc52e96f2b..0000000000 --- a/test/integration/licenses/github.com/davecgh/go-spew/spew/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2012-2016 Dave Collins - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/test/integration/licenses/github.com/docker/cli/cli/config/LICENSE b/test/integration/licenses/github.com/docker/cli/cli/config/LICENSE deleted file mode 100644 index 9c8e20ab85..0000000000 --- a/test/integration/licenses/github.com/docker/cli/cli/config/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2013-2017 Docker, Inc. - - 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 - - https://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. diff --git a/test/integration/licenses/github.com/docker/cli/cli/config/NOTICE b/test/integration/licenses/github.com/docker/cli/cli/config/NOTICE deleted file mode 100644 index 58b19b6d15..0000000000 --- a/test/integration/licenses/github.com/docker/cli/cli/config/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2017 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/creack/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/docker/distribution/LICENSE b/test/integration/licenses/github.com/docker/distribution/LICENSE deleted file mode 100644 index e06d208186..0000000000 --- a/test/integration/licenses/github.com/docker/distribution/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. - diff --git a/test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE b/test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE deleted file mode 100644 index 1ea555e2af..0000000000 --- a/test/integration/licenses/github.com/docker/docker-credential-helpers/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2016 David Calavera - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/docker/docker/LICENSE b/test/integration/licenses/github.com/docker/docker/LICENSE deleted file mode 100644 index 6d8d58fb67..0000000000 --- a/test/integration/licenses/github.com/docker/docker/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2013-2018 Docker, Inc. - - 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 - - https://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. diff --git a/test/integration/licenses/github.com/docker/docker/NOTICE b/test/integration/licenses/github.com/docker/docker/NOTICE deleted file mode 100644 index 58b19b6d15..0000000000 --- a/test/integration/licenses/github.com/docker/docker/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2017 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/creack/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/docker/go-connections/LICENSE b/test/integration/licenses/github.com/docker/go-connections/LICENSE deleted file mode 100644 index b55b37bc31..0000000000 --- a/test/integration/licenses/github.com/docker/go-connections/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Docker, Inc. - - 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 - - https://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. diff --git a/test/integration/licenses/github.com/docker/go-units/LICENSE b/test/integration/licenses/github.com/docker/go-units/LICENSE deleted file mode 100644 index b55b37bc31..0000000000 --- a/test/integration/licenses/github.com/docker/go-units/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Docker, Inc. - - 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 - - https://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. diff --git a/test/integration/licenses/github.com/docker/machine/LICENSE b/test/integration/licenses/github.com/docker/machine/LICENSE deleted file mode 100644 index 27448585ad..0000000000 --- a/test/integration/licenses/github.com/docker/machine/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2014 Docker, Inc. - - 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. diff --git a/test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE b/test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE deleted file mode 100644 index ece7ec61ef..0000000000 --- a/test/integration/licenses/github.com/emicklei/go-restful/v3/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012,2013 Ernest Micklei - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/fatih/color/LICENSE.md b/test/integration/licenses/github.com/fatih/color/LICENSE.md deleted file mode 100644 index 25fdaf639d..0000000000 --- a/test/integration/licenses/github.com/fatih/color/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Fatih Arslan - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE b/test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE deleted file mode 100644 index e180c8fb05..0000000000 --- a/test/integration/licenses/github.com/fsnotify/fsnotify/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. -Copyright (c) 2012-2019 fsnotify Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/go-logr/logr/LICENSE b/test/integration/licenses/github.com/go-logr/logr/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/test/integration/licenses/github.com/go-logr/logr/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/test/integration/licenses/github.com/go-logr/stdr/LICENSE b/test/integration/licenses/github.com/go-logr/stdr/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/go-logr/stdr/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE b/test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/go-openapi/jsonpointer/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE b/test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/go-openapi/jsonreference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/go-openapi/swag/LICENSE b/test/integration/licenses/github.com/go-openapi/swag/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/go-openapi/swag/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/godbus/dbus/v5/LICENSE b/test/integration/licenses/github.com/godbus/dbus/v5/LICENSE deleted file mode 100644 index 670d88fcaa..0000000000 --- a/test/integration/licenses/github.com/godbus/dbus/v5/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2013, Georg Reinke (), Google -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/gogo/protobuf/LICENSE b/test/integration/licenses/github.com/gogo/protobuf/LICENSE deleted file mode 100644 index f57de90da8..0000000000 --- a/test/integration/licenses/github.com/gogo/protobuf/LICENSE +++ /dev/null @@ -1,35 +0,0 @@ -Copyright (c) 2013, The GoGo Authors. All rights reserved. - -Protocol Buffers for Go with Gadgets - -Go support for Protocol Buffers - Google's data interchange format - -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/test/integration/licenses/github.com/golang/groupcache/lru/LICENSE b/test/integration/licenses/github.com/golang/groupcache/lru/LICENSE deleted file mode 100644 index 37ec93a14f..0000000000 --- a/test/integration/licenses/github.com/golang/groupcache/lru/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/golang/protobuf/LICENSE b/test/integration/licenses/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 0f646931a4..0000000000 --- a/test/integration/licenses/github.com/golang/protobuf/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright 2010 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/test/integration/licenses/github.com/google/gnostic/LICENSE b/test/integration/licenses/github.com/google/gnostic/LICENSE deleted file mode 100644 index 6b0b1270ff..0000000000 --- a/test/integration/licenses/github.com/google/gnostic/LICENSE +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - diff --git a/test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE b/test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE deleted file mode 100644 index 32017f8fa1..0000000000 --- a/test/integration/licenses/github.com/google/go-cmp/cmp/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2017 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/google/go-containerregistry/LICENSE b/test/integration/licenses/github.com/google/go-containerregistry/LICENSE deleted file mode 100644 index 7a4a3ea242..0000000000 --- a/test/integration/licenses/github.com/google/go-containerregistry/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. \ No newline at end of file diff --git a/test/integration/licenses/github.com/google/go-github/v43/github/LICENSE b/test/integration/licenses/github.com/google/go-github/v43/github/LICENSE deleted file mode 100644 index 28b6486f0b..0000000000 --- a/test/integration/licenses/github.com/google/go-github/v43/github/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 The go-github AUTHORS. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/google/go-querystring/query/LICENSE b/test/integration/licenses/github.com/google/go-querystring/query/LICENSE deleted file mode 100644 index ae121a1e46..0000000000 --- a/test/integration/licenses/github.com/google/go-querystring/query/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 Google. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/google/gofuzz/LICENSE b/test/integration/licenses/github.com/google/gofuzz/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/google/gofuzz/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE b/test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/google/slowjam/pkg/stacklog/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/google/uuid/LICENSE b/test/integration/licenses/github.com/google/uuid/LICENSE deleted file mode 100644 index 5dc68268d9..0000000000 --- a/test/integration/licenses/github.com/google/uuid/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009,2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE b/test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/googleapis/enterprise-certificate-proxy/client/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE b/test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE deleted file mode 100644 index 6d16b6578a..0000000000 --- a/test/integration/licenses/github.com/googleapis/gax-go/v2/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2016, Google Inc. -All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/gookit/color/LICENSE b/test/integration/licenses/github.com/gookit/color/LICENSE deleted file mode 100644 index d839cdc1ad..0000000000 --- a/test/integration/licenses/github.com/gookit/color/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 inhere - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE deleted file mode 100644 index e87a115e46..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/LICENSE +++ /dev/null @@ -1,363 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md deleted file mode 100644 index 036e5313fc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# cleanhttp - -Functions for accessing "clean" Go http.Client values - -------------- - -The Go standard library contains a default `http.Client` called -`http.DefaultClient`. It is a common idiom in Go code to start with -`http.DefaultClient` and tweak it as necessary, and in fact, this is -encouraged; from the `http` package documentation: - -> The Client's Transport typically has internal state (cached TCP connections), -so Clients should be reused instead of created as needed. Clients are safe for -concurrent use by multiple goroutines. - -Unfortunately, this is a shared value, and it is not uncommon for libraries to -assume that they are free to modify it at will. With enough dependencies, it -can be very easy to encounter strange problems and race conditions due to -manipulation of this shared value across libraries and goroutines (clients are -safe for concurrent use, but writing values to the client struct itself is not -protected). - -Making things worse is the fact that a bare `http.Client` will use a default -`http.Transport` called `http.DefaultTransport`, which is another global value -that behaves the same way. So it is not simply enough to replace -`http.DefaultClient` with `&http.Client{}`. - -This repository provides some simple functions to get a "clean" `http.Client` --- one that uses the same default values as the Go standard library, but -returns a client that does not share any state with other clients. diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go deleted file mode 100644 index fe28d15b6f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/cleanhttp.go +++ /dev/null @@ -1,58 +0,0 @@ -package cleanhttp - -import ( - "net" - "net/http" - "runtime" - "time" -) - -// DefaultTransport returns a new http.Transport with similar default values to -// http.DefaultTransport, but with idle connections and keepalives disabled. -func DefaultTransport() *http.Transport { - transport := DefaultPooledTransport() - transport.DisableKeepAlives = true - transport.MaxIdleConnsPerHost = -1 - return transport -} - -// DefaultPooledTransport returns a new http.Transport with similar default -// values to http.DefaultTransport. Do not use this for transient transports as -// it can leak file descriptors over time. Only use this for transports that -// will be re-used for the same host(s). -func DefaultPooledTransport() *http.Transport { - transport := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - ForceAttemptHTTP2: true, - MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1, - } - return transport -} - -// DefaultClient returns a new http.Client with similar default values to -// http.Client, but with a non-shared Transport, idle connections disabled, and -// keepalives disabled. -func DefaultClient() *http.Client { - return &http.Client{ - Transport: DefaultTransport(), - } -} - -// DefaultPooledClient returns a new http.Client with similar default values to -// http.Client, but with a shared Transport. Do not use this function for -// transient clients as it can leak file descriptors over time. Only use this -// for clients that will be re-used for the same host(s). -func DefaultPooledClient() *http.Client { - return &http.Client{ - Transport: DefaultPooledTransport(), - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go deleted file mode 100644 index 05841092a7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Package cleanhttp offers convenience utilities for acquiring "clean" -// http.Transport and http.Client structs. -// -// Values set on http.DefaultClient and http.DefaultTransport affect all -// callers. This can have detrimental effects, esepcially in TLS contexts, -// where client or root certificates set to talk to multiple endpoints can end -// up displacing each other, leading to hard-to-debug issues. This package -// provides non-shared http.Client and http.Transport structs to ensure that -// the configuration will not be overwritten by other parts of the application -// or dependencies. -// -// The DefaultClient and DefaultTransport functions disable idle connections -// and keepalives. Without ensuring that idle connections are closed before -// garbage collection, short-term clients/transports can leak file descriptors, -// eventually leading to "too many open files" errors. If you will be -// connecting to the same hosts repeatedly from the same client, you can use -// DefaultPooledClient to receive a client that has connection pooling -// semantics similar to http.DefaultClient. -// -package cleanhttp diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod deleted file mode 100644 index 005ccdef9c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/hashicorp/go-cleanhttp - -go 1.13 diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go deleted file mode 100644 index 3c845dc0dc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers.go +++ /dev/null @@ -1,48 +0,0 @@ -package cleanhttp - -import ( - "net/http" - "strings" - "unicode" -) - -// HandlerInput provides input options to cleanhttp's handlers -type HandlerInput struct { - ErrStatus int -} - -// PrintablePathCheckHandler is a middleware that ensures the request path -// contains only printable runes. -func PrintablePathCheckHandler(next http.Handler, input *HandlerInput) http.Handler { - // Nil-check on input to make it optional - if input == nil { - input = &HandlerInput{ - ErrStatus: http.StatusBadRequest, - } - } - - // Default to http.StatusBadRequest on error - if input.ErrStatus == 0 { - input.ErrStatus = http.StatusBadRequest - } - - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r != nil { - // Check URL path for non-printable characters - idx := strings.IndexFunc(r.URL.Path, func(c rune) bool { - return !unicode.IsPrint(c) - }) - - if idx != -1 { - w.WriteHeader(input.ErrStatus) - return - } - - if next != nil { - next.ServeHTTP(w, r) - } - } - - return - }) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go b/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go deleted file mode 100644 index a22e84a4a7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-cleanhttp/handlers_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package cleanhttp - -import ( - "fmt" - "net/http" - "net/http/httptest" - "testing" -) - -func TestPrintablePathCheckHandler(t *testing.T) { - getTestHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "Hello, client") - }) - - cases := map[string]struct { - path string - expectCode int - input *HandlerInput - }{ - "valid nil input": { - path: "/valid", - expectCode: http.StatusOK, - input: nil, - }, - - "valid empty error status": { - path: "/valid", - expectCode: http.StatusOK, - input: &HandlerInput{}, - }, - - "invalid newline": { - path: "/invalid%0A", - expectCode: http.StatusBadRequest, - }, - - "invalid carriage return": { - path: "/invalid%0D", - expectCode: http.StatusBadRequest, - }, - - "invalid null": { - path: "/invalid%00", - expectCode: http.StatusBadRequest, - }, - - "invalid alternate status": { - path: "/invalid%0A", - expectCode: http.StatusInternalServerError, - input: &HandlerInput{ - ErrStatus: http.StatusInternalServerError, - }, - }, - } - - for name, tc := range cases { - t.Run(name, func(t *testing.T) { - // Create test HTTP server - ts := httptest.NewServer(PrintablePathCheckHandler(getTestHandler, tc.input)) - defer ts.Close() - - res, err := http.Get(ts.URL + tc.path) - if err != nil { - t.Fatal(err) - } - - if tc.expectCode != res.StatusCode { - t.Fatalf("expected %d, got :%d", tc.expectCode, res.StatusCode) - } - }) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml deleted file mode 100644 index fa84635452..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/.circleci/config.yml +++ /dev/null @@ -1,176 +0,0 @@ -version: 2.1 - -orbs: - win: circleci/windows@2.2.0 - -references: - environment: &ENVIRONMENT - TEST_RESULTS_PATH: &TEST_RESULTS_PATH /tmp/test-results - WIN_TEST_RESULTS: &WIN_TEST_RESULTS c:\Users\circleci\AppData\Local\Temp\test-results - -commands: - run-gotests: - parameters: - cmd: - type: string - platform: - type: string - govet: - type: string - default: "" - steps: - - run: - name: "Run go tests" - command: | - PACKAGE_NAMES=$(go list ./... | circleci tests split --split-by=timings --timings-type=classname) - echo "Running $(echo $PACKAGE_NAMES | wc -w) packages" - echo $PACKAGE_NAMES - << parameters.cmd >> --format=short-verbose --junitfile $TEST_RESULTS_PATH/go-getter/gotestsum-report.xml -- -p 2 -cover -race -vet=<< parameters.govet >> -coverprofile=<< parameters.platform >>_cov_$CIRCLE_NODE_INDEX.part $PACKAGE_NAMES - -jobs: - linux-tests: - docker: - - image: docker.mirror.hashicorp.services/circleci/golang:<< parameters.go-version >> - parameters: - go-version: - type: string - environment: - <<: *ENVIRONMENT - parallelism: 4 - steps: - - run: go version - - checkout - - attach_workspace: - at: . - - run: mkdir -p $TEST_RESULTS_PATH/go-getter - - # Restore go module cache if there is one - - restore_cache: - keys: - - linux-gomod-cache-v1-{{ checksum "go.mod" }} - - - run: go mod download - - # Save go module cache if the go.mod file has changed - - save_cache: - key: linux-gomod-cache-v1-{{ checksum "go.mod" }} - paths: - - "/go/pkg/mod" - - # Check go fmt output because it does not report non-zero when there are fmt changes - - run: - name: check go fmt - command: | - files=$(go fmt ./...) - if [ -n "$files" ]; then - echo "The following file(s) do not conform to go fmt:" - echo "$files" - exit 1 - fi - - # Run go tests with gotestsum - - run-gotests: - cmd: "gotestsum" - platform: "linux" - - # Save coverage report parts - - persist_to_workspace: - root: . - paths: - - linux_cov_*.part - - - store_test_results: - path: *TEST_RESULTS_PATH - - store_artifacts: - path: *TEST_RESULTS_PATH - - windows-tests: - executor: - name: win/default - shell: bash --login -eo pipefail - environment: - <<: *ENVIRONMENT - working_directory: c:\gopath\src\github.com\hashicorp\go-getter - parameters: - go-version: - type: string - gotestsum-version: - type: string - steps: - - run: git config --global core.autocrlf false - - checkout - - attach_workspace: - at: . - - run: - name: Setup (remove pre-installed go) - command: | - rm -rf "c:\Go" - mkdir -p $TEST_RESULTS_PATH/go-getter - - - restore_cache: - keys: - - win-golang-<< parameters.go-version >>-cache-v1 - - win-gomod-cache-{{ checksum "go.mod" }}-v1 - - - run: - name: Install go version << parameters.go-version >> - command: | - if [ ! -d "c:\go" ]; then - echo "Cache not found, installing new version of go" - curl --fail --location https://dl.google.com/go/go<< parameters.go-version >>.windows-amd64.zip --output go.zip - unzip go.zip -d "/c" - fi - - - run: - command: go mod download - - - save_cache: - key: win-golang-<< parameters.go-version >>-cache-v1 - paths: - - /go - - - save_cache: - key: win-gomod-cache-{{ checksum "go.mod" }}-v1 - paths: - - c:\Windows\system32\config\systemprofile\go\pkg\mod - - - run: - name: Install gotestsum - command: | - curl --fail --location https://github.com/gotestyourself/gotestsum/releases/download/v<< parameters.gotestsum-version >>/gotestsum_<< parameters.gotestsum-version >>_windows_amd64.tar.gz --output gotestsum.tar.gz - tar -xvzf gotestsum.tar.gz - - - run-gotests: - cmd: "./gotestsum.exe" - platform: "win" - # Otherwise gcc is required for race detector - # See https://github.com/golang/go/issues/27089 - govet: "off" - - # Save coverage report parts - - persist_to_workspace: - root: . - paths: - - win_cov_*.part - - - store_test_results: - path: *WIN_TEST_RESULTS - - store_artifacts: - path: *WIN_TEST_RESULTS - -workflows: - go-getter: - jobs: - - linux-tests: - context: go-getter - matrix: - parameters: - go-version: ["1.15.13", "1.14.15"] - name: linux-test-go-<< matrix.go-version >> - - windows-tests: - context: go-getter - matrix: - parameters: - go-version: ["1.15.13", "1.14.15"] - gotestsum-version: ["0.4.1"] - name: win-test-go-<< matrix.go-version >> diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml deleted file mode 100644 index dfe6e4fd91..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: "Code scanning - scheduled (weekly) or on-demand" - -on: - schedule: - - cron: '0 15 * * 0' - workflow_dispatch: - -jobs: - CodeQL-Build: - - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - # Override language selection by uncommenting this and choosing your languages - with: - languages: go - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - # - name: Autobuild - # uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml deleted file mode 100644 index 295c9196de..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/.github/workflows/release.yml +++ /dev/null @@ -1,78 +0,0 @@ -### This builds, packages, signs, performs AV and malware scanning, and -### creates a new GitHub release for the newest version of go-getter. -### The GitHub release step performs the actions outlined in -### release.goreleaser.yml. A release is triggered when a new tag -### is pushed in the format vX.X.X - -name: Release - -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+*' - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Setup go - uses: actions/setup-go@v2 - with: - go-version: '^1.15' - - name: Setup signore - uses: hashicorp/setup-signore@v1 - with: - github-token: ${{secrets.SIGNORE_TOKEN}} - - name: Install hc-codesign - id: codesign - run: | - docker login docker.pkg.github.com -u docker -p $GITHUB_TOKEN && \ - docker pull docker.pkg.github.com/hashicorp/hc-codesign/hc-codesign:$VERSION && \ - echo "::set-output name=image::docker.pkg.github.com/hashicorp/hc-codesign/hc-codesign:$VERSION" - env: - VERSION: v0 - GITHUB_TOKEN: ${{ secrets.CODESIGN_GITHUB_TOKEN }} - - name: Install wget & clamAV antivirus scanner - run : | - sudo apt-get update - sudo apt-get -qq install -y ca-certificates wget clamav - wget --version - - name: Install maldet malware scanner - run: | - wget --no-verbose -O maldet-$VERSION.tar.gz https://github.com/rfxn/linux-malware-detect/archive/$VERSION.tar.gz - sha256sum -c - <<< "$SHA256SUM maldet-$VERSION.tar.gz" - sudo mkdir -p maldet-$VERSION - sudo tar -xzf maldet-$VERSION.tar.gz --strip-components=1 -C maldet-$VERSION - cd maldet-$VERSION - sudo ./install.sh - sudo maldet -u - env: - VERSION: 1.6.4 - SHA256SUM: 3ad66eebd443d32dd6c811dcf2d264b78678c75ed1d40c15434180d4453e60d2 - - name: GitHub Release - uses: goreleaser/goreleaser-action@v1 - with: - version: latest - args: release --skip-validate --timeout "60m" - env: - PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }} - CODESIGN_IMAGE: ${{ steps.codesign.outputs.image }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} - ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} - CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} - SIGNORE_SIGNER: ${{secrets.SIGNORE_SIGNER}} - SIGNORE_CLIENT_ID: ${{secrets.SIGNORE_CLIENT_ID}} - SIGNORE_CLIENT_SECRET: ${{secrets.SIGNORE_CLIENT_SECRET}} - - name: Run clamAV antivirus scanner - run: sudo clamscan /home/runner/work/$REPO/$REPO/dist/ - env: - REPO: ${{ github.event.repository.name }} - - name: Run maldet malware scanner - run: sudo maldet -a /home/runner/work/$REPO/$REPO/dist/ - env: - REPO: ${{ github.event.repository.name }} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.gitignore b/test/integration/licenses/github.com/hashicorp/go-getter/.gitignore deleted file mode 100644 index 511ca2675b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cmd/go-getter/go-getter diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml b/test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml deleted file mode 100644 index 975b5f697c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/.goreleaser.yml +++ /dev/null @@ -1,58 +0,0 @@ -env: - - GOPRIVATE=github.com/hashicorp - -builds: - - id: signable - mod_timestamp: '{{ .CommitTimestamp }}' - targets: - - darwin_amd64 - - windows_386 - - windows_amd64 - hooks: - post: | - docker run - -e ARTIFACTORY_TOKEN={{ .Env.ARTIFACTORY_TOKEN }} - -e ARTIFACTORY_USER={{ .Env.ARTIFACTORY_USER }} - -e CIRCLE_TOKEN={{ .Env.CIRCLE_TOKEN }} - -v {{ dir .Path }}:/workdir - {{ .Env.CODESIGN_IMAGE }} - sign -product-name={{ .ProjectName }} {{ .Name }} - dir: ./cmd/go-getter/ - flags: - - -trimpath - ldflags: - - -X main.GitCommit={{ .Commit }} - - mod_timestamp: '{{ .CommitTimestamp }}' - targets: - - linux_386 - - linux_amd64 - dir: ./cmd/go-getter/ - flags: - - -trimpath - ldflags: - - -X main.GitCommit={{ .Commit }} - -archives: - - format: zip - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - files: - - none* - -checksum: - name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' - algorithm: sha256 - -signs: - - signature: ${artifact}.sig - cmd: sh - args: - - -c - - >- - signore - sign - --file ${artifact} - --out ${signature} - artifacts: checksum - -changelog: - skip: true diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/LICENSE b/test/integration/licenses/github.com/hashicorp/go-getter/LICENSE deleted file mode 100644 index c33dcc7c92..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/README.md b/test/integration/licenses/github.com/hashicorp/go-getter/README.md deleted file mode 100644 index dc9ac260e7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/README.md +++ /dev/null @@ -1,448 +0,0 @@ -# go-getter - -[![CircleCI](https://circleci.com/gh/hashicorp/go-getter/tree/main.svg?style=svg)][circleci] -[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] - -[circleci]: https://circleci.com/gh/hashicorp/go-getter/tree/main -[godocs]: http://godoc.org/github.com/hashicorp/go-getter - -go-getter is a library for Go (golang) for downloading files or directories -from various sources using a URL as the primary form of input. - -The power of this library is being flexible in being able to download -from a number of different sources (file paths, Git, HTTP, Mercurial, etc.) -using a single string as input. This removes the burden of knowing how to -download from a variety of sources from the implementer. - -The concept of a _detector_ automatically turns invalid URLs into proper -URLs. For example: "github.com/hashicorp/go-getter" would turn into a -Git URL. Or "./foo" would turn into a file URL. These are extensible. - -This library is used by [Terraform](https://terraform.io) for -downloading modules and [Nomad](https://nomadproject.io) for downloading -binaries. - -## Installation and Usage - -Package documentation can be found on -[GoDoc](http://godoc.org/github.com/hashicorp/go-getter). - -Installation can be done with a normal `go get`: - -``` -$ go get github.com/hashicorp/go-getter -``` - -go-getter also has a command you can use to test URL strings: - -``` -$ go install github.com/hashicorp/go-getter/cmd/go-getter -... - -$ go-getter github.com/foo/bar ./foo -... -``` - -The command is useful for verifying URL structures. - -## Security -Fetching resources from user-supplied URLs is an inherently dangerous operation and may -leave your application vulnerable to [server side request forgery](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery), -[path traversal](https://owasp.org/www-community/attacks/Path_Traversal), [denial of service](https://owasp.org/www-community/attacks/Denial_of_Service) -or other security flaws. - -go-getter contains mitigations for some of these security issues, but should still be used with -caution in security-critical contexts. See the available [security options](#Security-Options) that -can be configured to mitigate some of these risks. -## URL Format - -go-getter uses a single string URL as input to download from a variety of -protocols. go-getter has various "tricks" with this URL to do certain things. -This section documents the URL format. - -### Supported Protocols and Detectors - -**Protocols** are used to download files/directories using a specific -mechanism. Example protocols are Git and HTTP. - -**Detectors** are used to transform a valid or invalid URL into another -URL if it matches a certain pattern. Example: "github.com/user/repo" is -automatically transformed into a fully valid Git URL. This allows go-getter -to be very user friendly. - -go-getter out of the box supports the following protocols. Additional protocols -can be augmented at runtime by implementing the `Getter` interface. - - * Local files - * Git - * Mercurial - * HTTP - * Amazon S3 - * Google GCP - -In addition to the above protocols, go-getter has what are called "detectors." -These take a URL and attempt to automatically choose the best protocol for -it, which might involve even changing the protocol. The following detection -is built-in by default: - - * File paths such as "./foo" are automatically changed to absolute - file URLs. - * GitHub URLs, such as "github.com/mitchellh/vagrant" are automatically - changed to Git protocol over HTTP. - * GitLab URLs, such as "gitlab.com/inkscape/inkscape" are automatically - changed to Git protocol over HTTP. - * BitBucket URLs, such as "bitbucket.org/mitchellh/vagrant" are automatically - changed to a Git or mercurial protocol using the BitBucket API. - -### Forced Protocol - -In some cases, the protocol to use is ambiguous depending on the source -URL. For example, "http://github.com/mitchellh/vagrant.git" could reference -an HTTP URL or a Git URL. Forced protocol syntax is used to disambiguate this -URL. - -Forced protocol can be done by prefixing the URL with the protocol followed -by double colons. For example: `git::http://github.com/mitchellh/vagrant.git` -would download the given HTTP URL using the Git protocol. - -Forced protocols will also override any detectors. - -In the absence of a forced protocol, detectors may be run on the URL, transforming -the protocol anyways. The above example would've used the Git protocol either -way since the Git detector would've detected it was a GitHub URL. - -### Protocol-Specific Options - -Each protocol can support protocol-specific options to configure that -protocol. For example, the `git` protocol supports specifying a `ref` -query parameter that tells it what ref to checkout for that Git -repository. - -The options are specified as query parameters on the URL (or URL-like string) -given to go-getter. Using the Git example above, the URL below is a valid -input to go-getter: - - github.com/hashicorp/go-getter?ref=abcd1234 - -The protocol-specific options are documented below the URL format -section. But because they are part of the URL, we point it out here so -you know they exist. - -### Subdirectories - -If you want to download only a specific subdirectory from a downloaded -directory, you can specify a subdirectory after a double-slash `//`. -go-getter will first download the URL specified _before_ the double-slash -(as if you didn't specify a double-slash), but will then copy the -path after the double slash into the target directory. - -For example, if you're downloading this GitHub repository, but you only -want to download the `testdata` directory, you can do the following: - -``` -https://github.com/hashicorp/go-getter.git//testdata -``` - -If you downloaded this to the `/tmp` directory, then the file -`/tmp/archive.gz` would exist. Notice that this file is in the `testdata` -directory in this repository, but because we specified a subdirectory, -go-getter automatically copied only that directory contents. - -Subdirectory paths may also use filesystem glob patterns. The path must -match _exactly one_ entry or go-getter will return an error. -This is useful if you're not sure the exact directory name but it follows -a predictable naming structure. - -For example, the following URL would also work: - -``` -https://github.com/hashicorp/go-getter.git//test-* -``` - -### Checksumming - -For file downloads of any protocol, go-getter can automatically verify -a checksum for you. Note that checksumming only works for downloading files, -not directories, but checksumming will work for any protocol. - -To checksum a file, append a `checksum` query parameter to the URL. go-getter -will parse out this query parameter automatically and use it to verify the -checksum. The parameter value can be in the format of `type:value` or just -`value`, where type is "md5", "sha1", "sha256", "sha512" or "file" . The -"value" should be the actual checksum value or download URL for "file". When -`type` part is omitted, type will be guessed based on the length of the -checksum string. Examples: - -``` -./foo.txt?checksum=md5:b7d96c89d09d9e204f5fedc4d5d55b21 -``` - -``` -./foo.txt?checksum=b7d96c89d09d9e204f5fedc4d5d55b21 -``` - -``` -./foo.txt?checksum=file:./foo.txt.sha256sum -``` - -When checksumming from a file - ex: with `checksum=file:url` - go-getter will -get the file linked in the URL after `file:` using the same configuration. For -example, in `file:http://releases.ubuntu.com/cosmic/MD5SUMS` go-getter will -download a checksum file under the aforementioned url using the http protocol. -All protocols supported by go-getter can be used. The checksum file will be -downloaded in a temporary file then parsed. The destination of the temporary -file can be changed by setting system specific environment variables: `TMPDIR` -for unix; `TMP`, `TEMP` or `USERPROFILE` on windows. Read godoc of -[os.TempDir](https://golang.org/pkg/os/#TempDir) for more information on the -temporary directory selection. Content of files are expected to be BSD or GNU -style. Once go-getter is done with the checksum file; it is deleted. - -The checksum query parameter is never sent to the backend protocol -implementation. It is used at a higher level by go-getter itself. - -If the destination file exists and the checksums match: download -will be skipped. - -### Unarchiving - -go-getter will automatically unarchive files into a file or directory -based on the extension of the file being requested (over any protocol). -This works for both file and directory downloads. - -go-getter looks for an `archive` query parameter to specify the format of -the archive. If this isn't specified, go-getter will use the extension of -the path to see if it appears archived. Unarchiving can be explicitly -disabled by setting the `archive` query parameter to `false`. - -The following archive formats are supported: - - * `tar.gz` and `tgz` - * `tar.bz2` and `tbz2` - * `tar.xz` and `txz` - * `zip` - * `gz` - * `bz2` - * `xz` - -For example, an example URL is shown below: - -``` -./foo.zip -``` - -This will automatically be inferred to be a ZIP file and will be extracted. -You can also be explicit about the archive type: - -``` -./some/other/path?archive=zip -``` - -And finally, you can disable archiving completely: - -``` -./some/path?archive=false -``` - -You can combine unarchiving with the other features of go-getter such -as checksumming. The special `archive` query parameter will be removed -from the URL before going to the final protocol downloader. - -## Protocol-Specific Options - -This section documents the protocol-specific options that can be specified for -go-getter. These options should be appended to the input as normal query -parameters ([HTTP headers](#headers) are an exception to this, however). -Depending on the usage of go-getter, applications may provide alternate ways of -inputting options. For example, [Nomad](https://www.nomadproject.io) provides a -nice options block for specifying options rather than in the URL. - -## General (All Protocols) - -The options below are available to all protocols: - - * `archive` - The archive format to use to unarchive this file, or "" (empty - string) to disable unarchiving. For more details, see the complete section - on archive support above. - - * `checksum` - Checksum to verify the downloaded file or archive. See - the entire section on checksumming above for format and more details. - - * `filename` - When in file download mode, allows specifying the name of the - downloaded file on disk. Has no effect in directory mode. - -### Local Files (`file`) - -None - -### Git (`git`) - - * `ref` - The Git ref to checkout. This is a ref, so it can point to - a commit SHA, a branch name, etc. If it is a named ref such as a branch - name, go-getter will update it to the latest on each get. - - * `sshkey` - An SSH private key to use during clones. The provided key must - be a base64-encoded string. For example, to generate a suitable `sshkey` - from a private key file on disk, you would run `base64 -w0 `. - - **Note**: Git 2.3+ is required to use this feature. - - * `depth` - The Git clone depth. The provided number specifies the last `n` - revisions to clone from the repository. - - -The `git` getter accepts both URL-style SSH addresses like -`git::ssh://git@example.com/foo/bar`, and "scp-style" addresses like -`git::git@example.com/foo/bar`. In the latter case, omitting the `git::` -force prefix is allowed if the username prefix is exactly `git@`. - -The "scp-style" addresses _cannot_ be used in conjunction with the `ssh://` -scheme prefix, because in that case the colon is used to mark an optional -port number to connect on, rather than to delimit the path from the host. - -### Mercurial (`hg`) - - * `rev` - The Mercurial revision to checkout. - -### HTTP (`http`) - -#### Basic Authentication - -To use HTTP basic authentication with go-getter, simply prepend `username:password@` to the -hostname in the URL such as `https://Aladdin:OpenSesame@www.example.com/index.html`. All special -characters, including the username and password, must be URL encoded. - -#### Headers - -Optional request headers can be added by supplying them in a custom -[`HttpGetter`](https://godoc.org/github.com/hashicorp/go-getter#HttpGetter) -(_not_ as query parameters like most other options). These headers will be sent -out on every request the getter in question makes. - -### S3 (`s3`) - -S3 takes various access configurations in the URL. Note that it will also -read these from standard AWS environment variables if they're set. S3 compliant servers like Minio -are also supported. If the query parameters are present, these take priority. - - * `aws_access_key_id` - AWS access key. - * `aws_access_key_secret` - AWS access key secret. - * `aws_access_token` - AWS access token if this is being used. - * `aws_profile` - Use this profile from local ~/.aws/ config. Takes priority over the other three. - -#### Using IAM Instance Profiles with S3 - -If you use go-getter and want to use an EC2 IAM Instance Profile to avoid -using credentials, then just omit these and the profile, if available will -be used automatically. - -### Using S3 with Minio - If you use go-gitter for Minio support, you must consider the following: - - * `aws_access_key_id` (required) - Minio access key. - * `aws_access_key_secret` (required) - Minio access key secret. - * `region` (optional - defaults to us-east-1) - Region identifier to use. - * `version` (optional - defaults to Minio default) - Configuration file format. - -#### S3 Bucket Examples - -S3 has several addressing schemes used to reference your bucket. These are -listed here: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro - -Some examples for these addressing schemes: -- s3::https://s3.amazonaws.com/bucket/foo -- s3::https://s3-eu-west-1.amazonaws.com/bucket/foo -- bucket.s3.amazonaws.com/foo -- bucket.s3-eu-west-1.amazonaws.com/foo/bar -- "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=KEYID&aws_access_key_secret=SECRETKEY®ion=us-east-2" - -### GCS (`gcs`) - -#### GCS Authentication - -In order to access to GCS, authentication credentials should be provided. More information can be found [here](https://cloud.google.com/docs/authentication/getting-started) - -#### GCS Bucket Examples - -- gcs::https://www.googleapis.com/storage/v1/bucket -- gcs::https://www.googleapis.com/storage/v1/bucket/foo.zip -- www.googleapis.com/storage/v1/bucket/foo - -#### GCS Testing - -The tests for `get_gcs.go` require you to have GCP credentials set in your environment. These credentials can have any level of permissions to any project, they just need to exist. This means setting `GOOGLE_APPLICATION_CREDENTIALS="~/path/to/credentials.json"` or `GOOGLE_CREDENTIALS="{stringified-credentials-json}"`. Due to this configuration, `get_gcs_test.go` will fail for external contributors in CircleCI. - - -### Security Options - -**Disable Symlinks** - -In your getter client config, we recommend using the `DisableSymlinks` option, -which prevents writing through or copying from symlinks (which may point outside the directory). - -```go -client := getter.Client{ - // This will prevent copying or writing files through symlinks - DisableSymlinks: true, -} -``` - -**Disable or Limit `X-Terraform-Get`** - -Go-Getter supports arbitrary redirects via the `X-Terraform-Get` header. This functionality -exists to support [Terraform use cases](https://www.terraform.io/language/modules/sources#http-urls), -but is likely not needed in most applications. - -For code that uses the `HttpGetter`, add the following configuration options: - -```go -var httpGetter = &getter.HttpGetter{ - // Most clients should disable X-Terraform-Get - // See the note below - XTerraformGetDisabled: true, - // Your software probably doesn’t rely on X-Terraform-Get, but - // if it does, you should set the above field to false, plus - // set XTerraformGet Limit to prevent endless redirects - // XTerraformGetLimit: 10, -} -``` - -**Enforce Timeouts** - -The `HttpGetter` supports timeouts and other resource-constraining configuration options. The `GitGetter` and `HgGetter` -only support timeouts. - -Configuration for the `HttpGetter`: - -```go -var httpGetter = &getter.HttpGetter{ - // Disable pre-fetch HEAD requests - DoNotCheckHeadFirst: true, - - // As an alternative to the above setting, you can - // set a reasonable timeout for HEAD requests - // HeadFirstTimeout: 10 * time.Second, - - // Read timeout for HTTP operations - ReadTimeout: 30 * time.Second, - - // Set the maximum number of bytes - // that can be read by the getter - MaxBytes: 500000000, // 500 MB -} -``` - -For code that uses the `GitGetter` or `HgGetter`, set the `Timeout` option: -```go -var gitGetter = &getter.GitGetter{ - // Set a reasonable timeout for git operations - Timeout: 5 * time.Minute, -} -``` - -```go -var hgGetter = &getter.HgGetter{ - // Set a reasonable timeout for hg operations - Timeout: 5 * time.Minute, -} -``` - diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/checksum.go b/test/integration/licenses/github.com/hashicorp/go-getter/checksum.go deleted file mode 100644 index f1090839fb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/checksum.go +++ /dev/null @@ -1,317 +0,0 @@ -package getter - -import ( - "bufio" - "bytes" - "crypto/md5" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" - "encoding/hex" - "fmt" - "hash" - "io" - "net/url" - "os" - "path/filepath" - "strings" - - urlhelper "github.com/hashicorp/go-getter/helper/url" -) - -// FileChecksum helps verifying the checksum for a file. -type FileChecksum struct { - Type string - Hash hash.Hash - Value []byte - Filename string -} - -// A ChecksumError is returned when a checksum differs -type ChecksumError struct { - Hash hash.Hash - Actual []byte - Expected []byte - File string -} - -func (cerr *ChecksumError) Error() string { - if cerr == nil { - return "" - } - return fmt.Sprintf( - "Checksums did not match for %s.\nExpected: %s\nGot: %s\n%T", - cerr.File, - hex.EncodeToString(cerr.Expected), - hex.EncodeToString(cerr.Actual), - cerr.Hash, // ex: *sha256.digest - ) -} - -// checksum is a simple method to compute the checksum of a source file -// and compare it to the given expected value. -func (c *FileChecksum) checksum(source string) error { - f, err := os.Open(source) - if err != nil { - return fmt.Errorf("Failed to open file for checksum: %s", err) - } - defer f.Close() - - c.Hash.Reset() - if _, err := io.Copy(c.Hash, f); err != nil { - return fmt.Errorf("Failed to hash: %s", err) - } - - if actual := c.Hash.Sum(nil); !bytes.Equal(actual, c.Value) { - return &ChecksumError{ - Hash: c.Hash, - Actual: actual, - Expected: c.Value, - File: source, - } - } - - return nil -} - -// extractChecksum will return a FileChecksum based on the 'checksum' -// parameter of u. -// ex: -// http://hashicorp.com/terraform?checksum= -// http://hashicorp.com/terraform?checksum=: -// http://hashicorp.com/terraform?checksum=file: -// when checksumming from a file, extractChecksum will go get checksum_url -// in a temporary directory, parse the content of the file then delete it. -// Content of files are expected to be BSD style or GNU style. -// -// BSD-style checksum: -// MD5 (file1) = -// MD5 (file2) = -// -// GNU-style: -// file1 -// *file2 -// -// see parseChecksumLine for more detail on checksum file parsing -func (c *Client) extractChecksum(u *url.URL) (*FileChecksum, error) { - q := u.Query() - v := q.Get("checksum") - - if v == "" { - return nil, nil - } - - vs := strings.SplitN(v, ":", 2) - switch len(vs) { - case 2: - break // good - default: - // here, we try to guess the checksum from it's length - // if the type was not passed - return newChecksumFromValue(v, filepath.Base(u.EscapedPath())) - } - - checksumType, checksumValue := vs[0], vs[1] - - switch checksumType { - case "file": - return c.ChecksumFromFile(checksumValue, u) - default: - return newChecksumFromType(checksumType, checksumValue, filepath.Base(u.EscapedPath())) - } -} - -func newChecksum(checksumValue, filename string) (*FileChecksum, error) { - c := &FileChecksum{ - Filename: filename, - } - var err error - c.Value, err = hex.DecodeString(checksumValue) - if err != nil { - return nil, fmt.Errorf("invalid checksum: %s", err) - } - return c, nil -} - -func newChecksumFromType(checksumType, checksumValue, filename string) (*FileChecksum, error) { - c, err := newChecksum(checksumValue, filename) - if err != nil { - return nil, err - } - - c.Type = strings.ToLower(checksumType) - switch c.Type { - case "md5": - c.Hash = md5.New() - case "sha1": - c.Hash = sha1.New() - case "sha256": - c.Hash = sha256.New() - case "sha512": - c.Hash = sha512.New() - default: - return nil, fmt.Errorf( - "unsupported checksum type: %s", checksumType) - } - - return c, nil -} - -func newChecksumFromValue(checksumValue, filename string) (*FileChecksum, error) { - c, err := newChecksum(checksumValue, filename) - if err != nil { - return nil, err - } - - switch len(c.Value) { - case md5.Size: - c.Hash = md5.New() - c.Type = "md5" - case sha1.Size: - c.Hash = sha1.New() - c.Type = "sha1" - case sha256.Size: - c.Hash = sha256.New() - c.Type = "sha256" - case sha512.Size: - c.Hash = sha512.New() - c.Type = "sha512" - default: - return nil, fmt.Errorf("Unknown type for checksum %s", checksumValue) - } - - return c, nil -} - -// ChecksumFromFile will return all the FileChecksums found in file -// -// ChecksumFromFile will try to guess the hashing algorithm based on content -// of checksum file -// -// ChecksumFromFile will only return checksums for files that match file -// behind src -func (c *Client) ChecksumFromFile(checksumFile string, src *url.URL) (*FileChecksum, error) { - checksumFileURL, err := urlhelper.Parse(checksumFile) - if err != nil { - return nil, err - } - - tempfile, err := tmpFile("", filepath.Base(checksumFileURL.Path)) - if err != nil { - return nil, err - } - defer os.Remove(tempfile) - - c2 := &Client{ - Ctx: c.Ctx, - Getters: c.Getters, - Decompressors: c.Decompressors, - Detectors: c.Detectors, - Pwd: c.Pwd, - Dir: false, - Src: checksumFile, - Dst: tempfile, - ProgressListener: c.ProgressListener, - } - if err = c2.Get(); err != nil { - return nil, fmt.Errorf( - "Error downloading checksum file: %s", err) - } - - filename := filepath.Base(src.Path) - absPath, err := filepath.Abs(src.Path) - if err != nil { - return nil, err - } - checksumFileDir := filepath.Dir(checksumFileURL.Path) - relpath, err := filepath.Rel(checksumFileDir, absPath) - switch { - case err == nil || - err.Error() == "Rel: can't make "+absPath+" relative to "+checksumFileDir: - // ex: on windows C:\gopath\...\content.txt cannot be relative to \ - // which is okay, may be another expected path will work. - break - default: - return nil, err - } - - // possible file identifiers: - options := []string{ - filename, // ubuntu-14.04.1-server-amd64.iso - "*" + filename, // *ubuntu-14.04.1-server-amd64.iso Standard checksum - "?" + filename, // ?ubuntu-14.04.1-server-amd64.iso shasum -p - relpath, // dir/ubuntu-14.04.1-server-amd64.iso - "./" + relpath, // ./dir/ubuntu-14.04.1-server-amd64.iso - absPath, // fullpath; set if local - } - - f, err := os.Open(tempfile) - if err != nil { - return nil, fmt.Errorf( - "Error opening downloaded file: %s", err) - } - defer f.Close() - rd := bufio.NewReader(f) - for { - line, err := rd.ReadString('\n') - if err != nil { - if err != io.EOF { - return nil, fmt.Errorf( - "Error reading checksum file: %s", err) - } - if line == "" { - break - } - // parse the line, if we hit EOF, but the line is not empty - } - checksum, err := parseChecksumLine(line) - if err != nil || checksum == nil { - continue - } - if checksum.Filename == "" { - // filename not sure, let's try - return checksum, nil - } - // make sure the checksum is for the right file - for _, option := range options { - if option != "" && checksum.Filename == option { - // any checksum will work so we return the first one - return checksum, nil - } - } - } - return nil, fmt.Errorf("no checksum found in: %s", checksumFile) -} - -// parseChecksumLine takes a line from a checksum file and returns -// checksumType, checksumValue and filename parseChecksumLine guesses the style -// of the checksum BSD vs GNU by splitting the line and by counting the parts. -// of a line. -// for BSD type sums parseChecksumLine guesses the hashing algorithm -// by checking the length of the checksum. -func parseChecksumLine(line string) (*FileChecksum, error) { - parts := strings.Fields(line) - - switch len(parts) { - case 4: - // BSD-style checksum: - // MD5 (file1) = - // MD5 (file2) = - if len(parts[1]) <= 2 || - parts[1][0] != '(' || parts[1][len(parts[1])-1] != ')' { - return nil, fmt.Errorf( - "Unexpected BSD-style-checksum filename format: %s", line) - } - filename := parts[1][1 : len(parts[1])-1] - return newChecksumFromType(parts[0], parts[3], filename) - case 2: - // GNU-style: - // file1 - // *file2 - return newChecksumFromValue(parts[0], parts[1]) - case 0: - return nil, nil // empty line - default: - return newChecksumFromValue(parts[0], "") - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client.go b/test/integration/licenses/github.com/hashicorp/go-getter/client.go deleted file mode 100644 index 05f2f5f651..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/client.go +++ /dev/null @@ -1,347 +0,0 @@ -package getter - -import ( - "context" - "errors" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "strings" - - urlhelper "github.com/hashicorp/go-getter/helper/url" - safetemp "github.com/hashicorp/go-safetemp" -) - -// ErrSymlinkCopy means that a copy of a symlink was encountered on a request with DisableSymlinks enabled. -var ErrSymlinkCopy = errors.New("copying of symlinks has been disabled") - -// Client is a client for downloading things. -// -// Top-level functions such as Get are shortcuts for interacting with a client. -// Using a client directly allows more fine-grained control over how downloading -// is done, as well as customizing the protocols supported. -type Client struct { - // Ctx for cancellation - Ctx context.Context - - // Src is the source URL to get. - // - // Dst is the path to save the downloaded thing as. If Dir is set to - // true, then this should be a directory. If the directory doesn't exist, - // it will be created for you. - // - // Pwd is the working directory for detection. If this isn't set, some - // detection may fail. Client will not default pwd to the current - // working directory for security reasons. - Src string - Dst string - Pwd string - - // Mode is the method of download the client will use. See ClientMode - // for documentation. - Mode ClientMode - - // Umask is used to mask file permissions when storing local files or decompressing - // an archive - Umask os.FileMode - - // Detectors is the list of detectors that are tried on the source. - // If this is nil, then the default Detectors will be used. - Detectors []Detector - - // Decompressors is the map of decompressors supported by this client. - // If this is nil, then the default value is the Decompressors global. - Decompressors map[string]Decompressor - - // Getters is the map of protocols supported by this client. If this - // is nil, then the default Getters variable will be used. - Getters map[string]Getter - - // Dir, if true, tells the Client it is downloading a directory (versus - // a single file). This distinction is necessary since filenames and - // directory names follow the same format so disambiguating is impossible - // without knowing ahead of time. - // - // WARNING: deprecated. If Mode is set, that will take precedence. - Dir bool - - // ProgressListener allows to track file downloads. - // By default a no op progress listener is used. - ProgressListener ProgressTracker - - // Insecure controls whether a client verifies the server's - // certificate chain and host name. If Insecure is true, crypto/tls - // accepts any certificate presented by the server and any host name in that - // certificate. In this mode, TLS is susceptible to machine-in-the-middle - // attacks unless custom verification is used. This should be used only for - // testing or in combination with VerifyConnection or VerifyPeerCertificate. - // This is identical to tls.Config.InsecureSkipVerify. - Insecure bool - - // Disable symlinks - DisableSymlinks bool - - Options []ClientOption -} - -// umask returns the effective umask for the Client, defaulting to the process umask -func (c *Client) umask() os.FileMode { - if c == nil { - return 0 - } - return c.Umask -} - -// mode returns file mode umasked by the Client umask -func (c *Client) mode(mode os.FileMode) os.FileMode { - m := mode & ^c.umask() - return m -} - -// Get downloads the configured source to the destination. -func (c *Client) Get() error { - if err := c.Configure(c.Options...); err != nil { - return err - } - - // Store this locally since there are cases we swap this - mode := c.Mode - if mode == ClientModeInvalid { - if c.Dir { - mode = ClientModeDir - } else { - mode = ClientModeFile - } - } - - src, err := Detect(c.Src, c.Pwd, c.Detectors) - if err != nil { - return err - } - - // Determine if we have a forced protocol, i.e. "git::http://..." - force, src := getForcedGetter(src) - - // If there is a subdir component, then we download the root separately - // and then copy over the proper subdir. - var realDst string - dst := c.Dst - src, subDir := SourceDirSubdir(src) - if subDir != "" { - // Check if the subdirectory is attempting to traverse updwards, outside of - // the cloned repository path. - subDir := filepath.Clean(subDir) - if containsDotDot(subDir) { - return fmt.Errorf("subdirectory component contain path traversal out of the repository") - } - // Prevent absolute paths, remove a leading path separator from the subdirectory - if subDir[0] == os.PathSeparator { - subDir = subDir[1:] - } - - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - realDst = dst - dst = td - } - - u, err := urlhelper.Parse(src) - if err != nil { - return err - } - if force == "" { - force = u.Scheme - } - - g, ok := c.Getters[force] - if !ok { - return fmt.Errorf( - "download not supported for scheme '%s'", force) - } - - // We have magic query parameters that we use to signal different features - q := u.Query() - - // Determine if we have an archive type - archiveV := q.Get("archive") - if archiveV != "" { - // Delete the paramter since it is a magic parameter we don't - // want to pass on to the Getter - q.Del("archive") - u.RawQuery = q.Encode() - - // If we can parse the value as a bool and it is false, then - // set the archive to "-" which should never map to a decompressor - if b, err := strconv.ParseBool(archiveV); err == nil && !b { - archiveV = "-" - } - } - if archiveV == "" { - // We don't appear to... but is it part of the filename? - matchingLen := 0 - for k := range c.Decompressors { - if strings.HasSuffix(u.Path, "."+k) && len(k) > matchingLen { - archiveV = k - matchingLen = len(k) - } - } - } - - // If we have a decompressor, then we need to change the destination - // to download to a temporary path. We unarchive this into the final, - // real path. - var decompressDst string - var decompressDir bool - decompressor := c.Decompressors[archiveV] - if decompressor != nil { - // Create a temporary directory to store our archive. We delete - // this at the end of everything. - td, err := ioutil.TempDir("", "getter") - if err != nil { - return fmt.Errorf( - "Error creating temporary directory for archive: %s", err) - } - defer os.RemoveAll(td) - - // Swap the download directory to be our temporary path and - // store the old values. - decompressDst = dst - decompressDir = mode != ClientModeFile - dst = filepath.Join(td, "archive") - mode = ClientModeFile - } - - // Determine checksum if we have one - checksum, err := c.extractChecksum(u) - if err != nil { - return fmt.Errorf("invalid checksum: %s", err) - } - - // Delete the query parameter if we have it. - q.Del("checksum") - u.RawQuery = q.Encode() - - if mode == ClientModeAny { - // Ask the getter which client mode to use - mode, err = g.ClientMode(u) - if err != nil { - return err - } - - // Destination is the base name of the URL path in "any" mode when - // a file source is detected. - if mode == ClientModeFile { - filename := filepath.Base(u.Path) - - // Determine if we have a custom file name - if v := q.Get("filename"); v != "" { - // Delete the query parameter if we have it. - q.Del("filename") - u.RawQuery = q.Encode() - - filename = v - } - - if containsDotDot(filename) { - return fmt.Errorf("filename query parameter contain path traversal") - } - - dst = filepath.Join(dst, filename) - } - } - - // If we're not downloading a directory, then just download the file - // and return. - if mode == ClientModeFile { - getFile := true - if checksum != nil { - if err := checksum.checksum(dst); err == nil { - // don't get the file if the checksum of dst is correct - getFile = false - } - } - if getFile { - err := g.GetFile(dst, u) - if err != nil { - return err - } - - if checksum != nil { - if err := checksum.checksum(dst); err != nil { - return err - } - } - } - - if decompressor != nil { - // We have a decompressor, so decompress the current destination - // into the final destination with the proper mode. - err := decompressor.Decompress(decompressDst, dst, decompressDir, c.umask()) - if err != nil { - return err - } - - // Swap the information back - dst = decompressDst - if decompressDir { - mode = ClientModeAny - } else { - mode = ClientModeFile - } - } - - // We check the dir value again because it can be switched back - // if we were unarchiving. If we're still only Get-ing a file, then - // we're done. - if mode == ClientModeFile { - return nil - } - } - - // If we're at this point we're either downloading a directory or we've - // downloaded and unarchived a directory and we're just checking subdir. - // In the case we have a decompressor we don't Get because it was Get - // above. - if decompressor == nil { - // If we're getting a directory, then this is an error. You cannot - // checksum a directory. TODO: test - if checksum != nil { - return fmt.Errorf( - "checksum cannot be specified for directory download") - } - - // We're downloading a directory, which might require a bit more work - // if we're specifying a subdir. - err := g.Get(dst, u) - if err != nil { - err = fmt.Errorf("error downloading '%s': %s", RedactURL(u), err) - return err - } - } - - // If we have a subdir, copy that over - if subDir != "" { - if err := os.RemoveAll(realDst); err != nil { - return err - } - if err := os.MkdirAll(realDst, c.mode(0755)); err != nil { - return err - } - - // Process any globs - subDir, err := SubdirGlob(dst, subDir) - if err != nil { - return err - } - - return copyDir(c.Ctx, realDst, subDir, false, c.DisableSymlinks, c.umask()) - } - - return nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go deleted file mode 100644 index 7f02509a78..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/client_mode.go +++ /dev/null @@ -1,24 +0,0 @@ -package getter - -// ClientMode is the mode that the client operates in. -type ClientMode uint - -const ( - ClientModeInvalid ClientMode = iota - - // ClientModeAny downloads anything it can. In this mode, dst must - // be a directory. If src is a file, it is saved into the directory - // with the basename of the URL. If src is a directory or archive, - // it is unpacked directly into dst. - ClientModeAny - - // ClientModeFile downloads a single file. In this mode, dst must - // be a file path (doesn't have to exist). src must point to a single - // file. It is saved as dst. - ClientModeFile - - // ClientModeDir downloads a directory. In this mode, dst must be - // a directory path (doesn't have to exist). src must point to an - // archive or directory (such as in s3). - ClientModeDir -) diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option.go deleted file mode 100644 index b164137533..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/client_option.go +++ /dev/null @@ -1,100 +0,0 @@ -package getter - -import ( - "context" - "os" -) - -// ClientOption is used to configure a client. -type ClientOption func(*Client) error - -// Configure applies all of the given client options, along with any default -// behavior including context, decompressors, detectors, and getters used by -// the client. -func (c *Client) Configure(opts ...ClientOption) error { - // If the context has not been configured use the background context. - if c.Ctx == nil { - c.Ctx = context.Background() - } - - // Store the options used to configure this client. - c.Options = opts - - // Apply all of the client options. - for _, opt := range opts { - err := opt(c) - if err != nil { - return err - } - } - - // If the client was not configured with any Decompressors, Detectors, - // or Getters, use the default values for each. - if c.Decompressors == nil { - c.Decompressors = Decompressors - } - if c.Detectors == nil { - c.Detectors = Detectors - } - if c.Getters == nil { - c.Getters = Getters - } - - // Set the client for each getter, so the top-level client can know - // the getter-specific client functions or progress tracking. - for _, getter := range c.Getters { - getter.SetClient(c) - } - - return nil -} - -// WithContext allows to pass a context to operation -// in order to be able to cancel a download in progress. -func WithContext(ctx context.Context) ClientOption { - return func(c *Client) error { - c.Ctx = ctx - return nil - } -} - -// WithDecompressors specifies which Decompressor are available. -func WithDecompressors(decompressors map[string]Decompressor) ClientOption { - return func(c *Client) error { - c.Decompressors = decompressors - return nil - } -} - -// WithDecompressors specifies which compressors are available. -func WithDetectors(detectors []Detector) ClientOption { - return func(c *Client) error { - c.Detectors = detectors - return nil - } -} - -// WithGetters specifies which getters are available. -func WithGetters(getters map[string]Getter) ClientOption { - return func(c *Client) error { - c.Getters = getters - return nil - } -} - -// WithMode specifies which client mode the getters should operate in. -func WithMode(mode ClientMode) ClientOption { - return func(c *Client) error { - c.Mode = mode - return nil - } -} - -// WithUmask specifies how to mask file permissions when storing local -// files or decompressing an archive. -func WithUmask(mode os.FileMode) ClientOption { - return func(c *Client) error { - c.Umask = mode - return nil - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go deleted file mode 100644 index 75da58cdda..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_insecure.go +++ /dev/null @@ -1,14 +0,0 @@ -package getter - -// WithInsecure allows for a user to avoid -// checking certificates (not recommended). -// For example, when connecting on HTTPS where an -// invalid certificate is presented. -// User assumes all risk. -// Not all getters have support for insecure mode yet. -func WithInsecure() func(*Client) error { - return func(c *Client) error { - c.Insecure = true - return nil - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go deleted file mode 100644 index 9b185f71de..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress.go +++ /dev/null @@ -1,38 +0,0 @@ -package getter - -import ( - "io" -) - -// WithProgress allows for a user to track -// the progress of a download. -// For example by displaying a progress bar with -// current download. -// Not all getters have progress support yet. -func WithProgress(pl ProgressTracker) func(*Client) error { - return func(c *Client) error { - c.ProgressListener = pl - return nil - } -} - -// ProgressTracker allows to track the progress of downloads. -type ProgressTracker interface { - // TrackProgress should be called when - // a new object is being downloaded. - // src is the location the file is - // downloaded from. - // currentSize is the current size of - // the file in case it is a partial - // download. - // totalSize is the total size in bytes, - // size can be zero if the file size - // is not known. - // stream is the file being downloaded, every - // written byte will add up to processed size. - // - // TrackProgress returns a ReadCloser that wraps the - // download in progress ( stream ). - // When the download is finished, body shall be closed. - TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go deleted file mode 100644 index a578fed674..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/client_option_progress_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package getter - -import ( - "io" - "net/http" - "net/http/httptest" - "os" - "path/filepath" - "sync" - "testing" -) - -type MockProgressTracking struct { - sync.Mutex - downloaded map[string]int -} - -func (p *MockProgressTracking) TrackProgress(src string, - currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) { - p.Lock() - defer p.Unlock() - - if p.downloaded == nil { - p.downloaded = map[string]int{} - } - - v, _ := p.downloaded[src] - p.downloaded[src] = v + 1 - return stream -} - -func TestGet_progress(t *testing.T) { - s := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { - // all good - rw.Header().Add("X-Terraform-Get", "something") - })) - defer s.Close() - - { // dl without tracking - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - if err := GetFile(dst, s.URL+"/file?thig=this&that"); err != nil { - t.Fatalf("download failed: %v", err) - } - } - - { // tracking - p := &MockProgressTracking{} - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - if err := GetFile(dst, s.URL+"/file?thig=this&that", WithProgress(p)); err != nil { - t.Fatalf("download failed: %v", err) - } - if err := GetFile(dst, s.URL+"/otherfile?thig=this&that", WithProgress(p)); err != nil { - t.Fatalf("download failed: %v", err) - } - - if p.downloaded["file"] != 1 { - t.Error("Expected a file download") - } - if p.downloaded["otherfile"] != 1 { - t.Error("Expected a otherfile download") - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go b/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go deleted file mode 100644 index 317874d85d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/main.go +++ /dev/null @@ -1,93 +0,0 @@ -package main - -import ( - "context" - "flag" - "log" - "os" - "os/signal" - "sync" - - getter "github.com/hashicorp/go-getter" -) - -func main() { - modeRaw := flag.String("mode", "any", "get mode (any, file, dir)") - progress := flag.Bool("progress", false, "display terminal progress") - insecure := flag.Bool("insecure", false, "do not verify server's certificate chain (not recommended)") - flag.Parse() - args := flag.Args() - if len(args) < 2 { - log.Fatalf("Expected two args: URL and dst") - os.Exit(1) - } - - // Get the mode - var mode getter.ClientMode - switch *modeRaw { - case "any": - mode = getter.ClientModeAny - case "file": - mode = getter.ClientModeFile - case "dir": - mode = getter.ClientModeDir - default: - log.Fatalf("Invalid client mode, must be 'any', 'file', or 'dir': %s", *modeRaw) - os.Exit(1) - } - - // Get the pwd - pwd, err := os.Getwd() - if err != nil { - log.Fatalf("Error getting wd: %s", err) - } - - opts := []getter.ClientOption{} - if *progress { - opts = append(opts, getter.WithProgress(defaultProgressBar)) - } - - if *insecure { - log.Println("WARNING: Using Insecure TLS transport!") - opts = append(opts, getter.WithInsecure()) - } - - ctx, cancel := context.WithCancel(context.Background()) - // Build the client - client := &getter.Client{ - Ctx: ctx, - Src: args[0], - Dst: args[1], - Pwd: pwd, - Mode: mode, - Options: opts, - } - - wg := sync.WaitGroup{} - wg.Add(1) - errChan := make(chan error, 2) - go func() { - defer wg.Done() - defer cancel() - if err := client.Get(); err != nil { - errChan <- err - } - }() - - c := make(chan os.Signal) - signal.Notify(c, os.Interrupt) - - select { - case sig := <-c: - signal.Reset(os.Interrupt) - cancel() - wg.Wait() - log.Printf("signal %v", sig) - case <-ctx.Done(): - wg.Wait() - log.Printf("success!") - case err := <-errChan: - wg.Wait() - log.Fatalf("Error downloading: %s", err) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go b/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go deleted file mode 100644 index c0db65c67a..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/cmd/go-getter/progress_tracking.go +++ /dev/null @@ -1,77 +0,0 @@ -package main - -import ( - "io" - "path/filepath" - "sync" - - "github.com/cheggaaa/pb" - getter "github.com/hashicorp/go-getter" -) - -// defaultProgressBar is the default instance of a cheggaaa -// progress bar. -var defaultProgressBar getter.ProgressTracker = &ProgressBar{} - -// ProgressBar wraps a github.com/cheggaaa/pb.Pool -// in order to display download progress for one or multiple -// downloads. -// -// If two different instance of ProgressBar try to -// display a progress only one will be displayed. -// It is therefore recommended to use DefaultProgressBar -type ProgressBar struct { - // lock everything below - lock sync.Mutex - - pool *pb.Pool - - pbs int -} - -func ProgressBarConfig(bar *pb.ProgressBar, prefix string) { - bar.SetUnits(pb.U_BYTES) - bar.Prefix(prefix) -} - -// TrackProgress instantiates a new progress bar that will -// display the progress of stream until closed. -// total can be 0. -func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser { - cpb.lock.Lock() - defer cpb.lock.Unlock() - - newPb := pb.New64(totalSize) - newPb.Set64(currentSize) - ProgressBarConfig(newPb, filepath.Base(src)) - if cpb.pool == nil { - cpb.pool = pb.NewPool() - cpb.pool.Start() - } - cpb.pool.Add(newPb) - reader := newPb.NewProxyReader(stream) - - cpb.pbs++ - return &readCloser{ - Reader: reader, - close: func() error { - cpb.lock.Lock() - defer cpb.lock.Unlock() - - newPb.Finish() - cpb.pbs-- - if cpb.pbs <= 0 { - cpb.pool.Stop() - cpb.pool = nil - } - return nil - }, - } -} - -type readCloser struct { - io.Reader - close func() error -} - -func (c *readCloser) Close() error { return c.close() } diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/common.go b/test/integration/licenses/github.com/hashicorp/go-getter/common.go deleted file mode 100644 index d2afd8ad88..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/common.go +++ /dev/null @@ -1,14 +0,0 @@ -package getter - -import ( - "io/ioutil" -) - -func tmpFile(dir, pattern string) (string, error) { - f, err := ioutil.TempFile(dir, pattern) - if err != nil { - return "", err - } - f.Close() - return f.Name(), nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go b/test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go deleted file mode 100644 index 646c283db3..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/copy_dir.go +++ /dev/null @@ -1,85 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "os" - "path/filepath" - "strings" -) - -// mode returns the file mode masked by the umask -func mode(mode, umask os.FileMode) os.FileMode { - return mode & ^umask -} - -// copyDir copies the src directory contents into dst. Both directories -// should already exist. -// -// If ignoreDot is set to true, then dot-prefixed files/folders are ignored. -func copyDir(ctx context.Context, dst string, src string, ignoreDot bool, disableSymlinks bool, umask os.FileMode) error { - // We can safely evaluate the symlinks here, even if disabled, because they - // will be checked before actual use in walkFn and copyFile - var err error - src, err = filepath.EvalSymlinks(src) - if err != nil { - return err - } - - walkFn := func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - if disableSymlinks { - fileInfo, err := os.Lstat(path) - if err != nil { - return fmt.Errorf("failed to check copy file source for symlinks: %w", err) - } - if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { - return ErrSymlinkCopy - } - // if info.Mode()&os.ModeSymlink == os.ModeSymlink { - // return ErrSymlinkCopy - // } - } - - if path == src { - return nil - } - - if ignoreDot && strings.HasPrefix(filepath.Base(path), ".") { - // Skip any dot files - if info.IsDir() { - return filepath.SkipDir - } else { - return nil - } - } - - // The "path" has the src prefixed to it. We need to join our - // destination with the path without the src on it. - dstPath := filepath.Join(dst, path[len(src):]) - - // If we have a directory, make that subdirectory, then continue - // the walk. - if info.IsDir() { - if path == filepath.Join(src, dst) { - // dst is in src; don't walk it. - return nil - } - - if err := os.MkdirAll(dstPath, mode(0755, umask)); err != nil { - return err - } - - return nil - } - - // If we have a file, copy the contents. - _, err = copyFile(ctx, dstPath, path, disableSymlinks, info.Mode(), umask) - return err - } - - return filepath.Walk(src, walkFn) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress.go deleted file mode 100644 index 9db9e15c08..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress.go +++ /dev/null @@ -1,65 +0,0 @@ -package getter - -import ( - "os" - "strings" -) - -// Decompressor defines the interface that must be implemented to add -// support for decompressing a type. -// -// Important: if you're implementing a decompressor, please use the -// containsDotDot helper in this file to ensure that files can't be -// decompressed outside of the specified directory. -type Decompressor interface { - // Decompress should decompress src to dst. dir specifies whether dst - // is a directory or single file. src is guaranteed to be a single file - // that exists. dst is not guaranteed to exist already. - Decompress(dst, src string, dir bool, umask os.FileMode) error -} - -// Decompressors is the mapping of extension to the Decompressor implementation -// that will decompress that extension/type. -var Decompressors map[string]Decompressor - -func init() { - tarDecompressor := new(TarDecompressor) - tbzDecompressor := new(TarBzip2Decompressor) - tgzDecompressor := new(TarGzipDecompressor) - txzDecompressor := new(TarXzDecompressor) - tzstDecompressor := new(TarZstdDecompressor) - - Decompressors = map[string]Decompressor{ - "bz2": new(Bzip2Decompressor), - "gz": new(GzipDecompressor), - "xz": new(XzDecompressor), - "tar": tarDecompressor, - "tar.bz2": tbzDecompressor, - "tar.gz": tgzDecompressor, - "tar.xz": txzDecompressor, - "tar.zst": tzstDecompressor, - "tbz2": tbzDecompressor, - "tgz": tgzDecompressor, - "txz": txzDecompressor, - "tzst": tzstDecompressor, - "zip": new(ZipDecompressor), - "zst": new(ZstdDecompressor), - } -} - -// containsDotDot checks if the filepath value v contains a ".." entry. -// This will check filepath components by splitting along / or \. This -// function is copied directly from the Go net/http implementation. -func containsDotDot(v string) bool { - if !strings.Contains(v, "..") { - return false - } - for _, ent := range strings.FieldsFunc(v, isSlashRune) { - if ent == ".." { - return true - } - } - return false -} - -func isSlashRune(r rune) bool { return r == '/' || r == '\\' } diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go deleted file mode 100644 index a5373e4e1d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2.go +++ /dev/null @@ -1,37 +0,0 @@ -package getter - -import ( - "compress/bzip2" - "fmt" - "os" - "path/filepath" -) - -// Bzip2Decompressor is an implementation of Decompressor that can -// decompress bz2 files. -type Bzip2Decompressor struct{} - -func (d *Bzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // Directory isn't supported at all - if dir { - return fmt.Errorf("bzip2-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Bzip2 compression is second - bzipR := bzip2.NewReader(f) - - // Copy it out - return copyReader(dst, bzipR, 0622, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go deleted file mode 100644 index 0315c59c87..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_bzip2_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestBzip2Decompressor(t *testing.T) { - cases := []TestDecompressCase{ - { - "single.bz2", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.bz2", - true, - true, - nil, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-bz2", tc.Input) - } - - TestDecompressor(t, new(Bzip2Decompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go deleted file mode 100644 index 669e5eafdf..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip.go +++ /dev/null @@ -1,41 +0,0 @@ -package getter - -import ( - "compress/gzip" - "fmt" - "os" - "path/filepath" -) - -// GzipDecompressor is an implementation of Decompressor that can -// decompress gzip files. -type GzipDecompressor struct{} - -func (d *GzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // Directory isn't supported at all - if dir { - return fmt.Errorf("gzip-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // gzip compression is second - gzipR, err := gzip.NewReader(f) - if err != nil { - return err - } - defer gzipR.Close() - - // Copy it out - return copyReader(dst, gzipR, 0622, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go deleted file mode 100644 index b805678a42..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_gzip_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestGzipDecompressor(t *testing.T) { - cases := []TestDecompressCase{ - { - "single.gz", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.gz", - true, - true, - nil, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-gz", tc.Input) - } - - TestDecompressor(t, new(GzipDecompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go deleted file mode 100644 index ee1d29ca96..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar.go +++ /dev/null @@ -1,150 +0,0 @@ -package getter - -import ( - "archive/tar" - "fmt" - "io" - "os" - "path/filepath" - "time" -) - -// untar is a shared helper for untarring an archive. The reader should provide -// an uncompressed view of the tar archive. -func untar(input io.Reader, dst, src string, dir bool, umask os.FileMode) error { - tarR := tar.NewReader(input) - done := false - dirHdrs := []*tar.Header{} - now := time.Now() - for { - hdr, err := tarR.Next() - if err == io.EOF { - if !done { - // Empty archive - return fmt.Errorf("empty archive: %s", src) - } - - break - } - if err != nil { - return err - } - - if hdr.Typeflag == tar.TypeXGlobalHeader || hdr.Typeflag == tar.TypeXHeader { - // don't unpack extended headers as files - continue - } - - path := dst - if dir { - // Disallow parent traversal - if containsDotDot(hdr.Name) { - return fmt.Errorf("entry contains '..': %s", hdr.Name) - } - - path = filepath.Join(path, hdr.Name) - } - - if hdr.FileInfo().IsDir() { - if !dir { - return fmt.Errorf("expected a single file: %s", src) - } - - // A directory, just make the directory and continue unarchiving... - if err := os.MkdirAll(path, mode(0755, umask)); err != nil { - return err - } - - // Record the directory information so that we may set its attributes - // after all files have been extracted - dirHdrs = append(dirHdrs, hdr) - - continue - } else { - // There is no ordering guarantee that a file in a directory is - // listed before the directory - dstPath := filepath.Dir(path) - - // Check that the directory exists, otherwise create it - if _, err := os.Stat(dstPath); os.IsNotExist(err) { - if err := os.MkdirAll(dstPath, mode(0755, umask)); err != nil { - return err - } - } - } - - // We have a file. If we already decoded, then it is an error - if !dir && done { - return fmt.Errorf("expected a single file, got multiple: %s", src) - } - - // Mark that we're done so future in single file mode errors - done = true - - // Open the file for writing - err = copyReader(path, tarR, hdr.FileInfo().Mode(), umask) - if err != nil { - return err - } - - // Set the access and modification time if valid, otherwise default to current time - aTime := now - mTime := now - if hdr.AccessTime.Unix() > 0 { - aTime = hdr.AccessTime - } - if hdr.ModTime.Unix() > 0 { - mTime = hdr.ModTime - } - if err := os.Chtimes(path, aTime, mTime); err != nil { - return err - } - } - - // Perform a final pass over extracted directories to update metadata - for _, dirHdr := range dirHdrs { - path := filepath.Join(dst, dirHdr.Name) - // Chmod the directory since they might be created before we know the mode flags - if err := os.Chmod(path, mode(dirHdr.FileInfo().Mode(), umask)); err != nil { - return err - } - // Set the mtime/atime attributes since they would have been changed during extraction - aTime := now - mTime := now - if dirHdr.AccessTime.Unix() > 0 { - aTime = dirHdr.AccessTime - } - if dirHdr.ModTime.Unix() > 0 { - mTime = dirHdr.ModTime - } - if err := os.Chtimes(path, aTime, mTime); err != nil { - return err - } - } - - return nil -} - -// TarDecompressor is an implementation of Decompressor that can -// unpack tar files. -type TarDecompressor struct{} - -func (d *TarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - return untar(f, dst, src, dir, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go deleted file mode 100644 index cfc8420191..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tar_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package getter - -import ( - "io/ioutil" - "os" - "path/filepath" - "runtime" - "testing" - "time" -) - -func TestTar(t *testing.T) { - mtime := time.Unix(0, 0) - cases := []TestDecompressCase{ - { - "extended_header.tar", - true, - false, - []string{"directory/", "directory/a", "directory/b"}, - "", - nil, - }, - { - "implied_dir.tar", - true, - false, - []string{"directory/", "directory/sub/", "directory/sub/a", "directory/sub/b"}, - "", - nil, - }, - { - "unix_time_0.tar", - true, - false, - []string{"directory/", "directory/sub/", "directory/sub/a", "directory/sub/b"}, - "", - &mtime, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-tar", tc.Input) - } - - TestDecompressor(t, new(TarDecompressor), cases) -} - -// testDecompressPermissions decompresses a directory and checks the permissions of the expanded files -func testDecompressorPermissions(t *testing.T, d Decompressor, input string, expected map[string]int, umask os.FileMode) { - td, err := ioutil.TempDir("", "getter") - if err != nil { - t.Fatalf("err: %s", err) - } - - // Destination is always joining result so that we have a new path - dst := filepath.Join(td, "subdir", "result") - - err = d.Decompress(dst, input, true, umask) - if err != nil { - t.Fatalf("err: %s", err) - } - - defer os.RemoveAll(dst) - - for name, mode := range expected { - fi, err := os.Stat(filepath.Join(dst, name)) - if err != nil { - t.Fatalf("err: %s", err) - } - - real := fi.Mode() - if real != os.FileMode(mode) { - t.Fatalf("err: %s expected mode %o got %o", name, mode, real) - } - } -} - -func TestDecompressTarPermissions(t *testing.T) { - d := new(TarDecompressor) - input := "./test-fixtures/decompress-tar/permissions.tar" - - var expected map[string]int - var masked int - - if runtime.GOOS == "windows" { - expected = map[string]int{ - "directory/public": 0666, - "directory/private": 0666, - "directory/exec": 0666, - "directory/setuid": 0666, - } - masked = 0666 - } else { - expected = map[string]int{ - "directory/public": 0666, - "directory/private": 0600, - "directory/exec": 0755, - "directory/setuid": 040000755, - } - masked = 0755 - } - - testDecompressorPermissions(t, d, input, expected, os.FileMode(0)) - - expected["directory/setuid"] = masked - testDecompressorPermissions(t, d, input, expected, os.FileMode(060000000)) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go deleted file mode 100644 index e2e5458c9d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2.go +++ /dev/null @@ -1,33 +0,0 @@ -package getter - -import ( - "compress/bzip2" - "os" - "path/filepath" -) - -// TarBzip2Decompressor is an implementation of Decompressor that can -// decompress tar.bz2 files. -type TarBzip2Decompressor struct{} - -func (d *TarBzip2Decompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Bzip2 compression is second - bzipR := bzip2.NewReader(f) - return untar(bzipR, dst, src, dir, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go deleted file mode 100644 index 14a16c21b5..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tbz2_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestTarBzip2Decompressor(t *testing.T) { - orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} - - cases := []TestDecompressCase{ - { - "empty.tar.bz2", - false, - true, - nil, - "", - nil, - }, - - { - "single.tar.bz2", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.tar.bz2", - true, - false, - []string{"file"}, - "", - nil, - }, - - { - "multiple.tar.bz2", - true, - false, - []string{"file1", "file2"}, - "", - nil, - }, - - { - "multiple.tar.bz2", - false, - true, - nil, - "", - nil, - }, - - // Tests when the file is listed before the parent folder - { - "ordering.tar.bz2", - true, - false, - orderingPaths, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-tbz2", tc.Input) - } - - TestDecompressor(t, new(TarBzip2Decompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go deleted file mode 100644 index b18bd6cb6d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_testing.go +++ /dev/null @@ -1,171 +0,0 @@ -package getter - -import ( - "crypto/md5" - "encoding/hex" - "io" - "io/ioutil" - "os" - "path/filepath" - "reflect" - "runtime" - "sort" - "strings" - "time" - - "github.com/mitchellh/go-testing-interface" -) - -// TestDecompressCase is a single test case for testing decompressors -type TestDecompressCase struct { - Input string // Input is the complete path to the input file - Dir bool // Dir is whether or not we're testing directory mode - Err bool // Err is whether we expect an error or not - DirList []string // DirList is the list of files for Dir mode - FileMD5 string // FileMD5 is the expected MD5 for a single file - Mtime *time.Time // Mtime is the optionally expected mtime for a single file (or all files if in Dir mode) -} - -// TestDecompressor is a helper function for testing generic decompressors. -func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) { - t.Helper() - - for _, tc := range cases { - t.Logf("Testing: %s", tc.Input) - - // Temporary dir to store stuff - td, err := ioutil.TempDir("", "getter") - if err != nil { - t.Fatalf("err: %s", err) - } - - // Destination is always joining result so that we have a new path - dst := filepath.Join(td, "subdir", "result") - - // We use a function so defers work - func() { - defer os.RemoveAll(td) - - // Decompress - err := d.Decompress(dst, tc.Input, tc.Dir, 0022) - if (err != nil) != tc.Err { - t.Fatalf("err %s: %s", tc.Input, err) - } - if tc.Err { - return - } - - // If it isn't a directory, then check for a single file - if !tc.Dir { - fi, err := os.Stat(dst) - if err != nil { - t.Fatalf("err %s: %s", tc.Input, err) - } - if fi.IsDir() { - t.Fatalf("err %s: expected file, got directory", tc.Input) - } - if tc.FileMD5 != "" { - actual := testMD5(t, dst) - expected := tc.FileMD5 - if actual != expected { - t.Fatalf("err %s: expected MD5 %s, got %s", tc.Input, expected, actual) - } - } - - if tc.Mtime != nil { - actual := fi.ModTime() - if tc.Mtime.Unix() > 0 { - expected := *tc.Mtime - if actual != expected { - t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), dst, actual.String()) - } - } else if actual.Unix() <= 0 { - t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) - } - } - - return - } - - // Convert expected for windows - expected := tc.DirList - if runtime.GOOS == "windows" { - for i, v := range expected { - expected[i] = strings.Replace(v, "/", "\\", -1) - } - } - - // Directory, check for the correct contents - actual := testListDir(t, dst) - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("bad %s\n\n%#v\n\n%#v", tc.Input, actual, expected) - } - // Check for correct atime/mtime - for _, dir := range actual { - path := filepath.Join(dst, dir) - if tc.Mtime != nil { - fi, err := os.Stat(path) - if err != nil { - t.Fatalf("err: %s", err) - } - actual := fi.ModTime() - if tc.Mtime.Unix() > 0 { - expected := *tc.Mtime - if actual != expected { - t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), path, actual.String()) - } - } else if actual.Unix() < 0 { - t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) - } - - } - } - }() - } -} - -func testListDir(t testing.T, path string) []string { - var result []string - err := filepath.Walk(path, func(sub string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - sub = strings.TrimPrefix(sub, path) - if sub == "" { - return nil - } - sub = sub[1:] // Trim the leading path sep. - - // If it is a dir, add trailing sep - if info.IsDir() { - sub += string(os.PathSeparator) - } - - result = append(result, sub) - return nil - }) - if err != nil { - t.Fatalf("err: %s", err) - } - - sort.Strings(result) - return result -} - -func testMD5(t testing.T, path string) string { - f, err := os.Open(path) - if err != nil { - t.Fatalf("err: %s", err) - } - defer f.Close() - - h := md5.New() - _, err = io.Copy(h, f) - if err != nil { - t.Fatalf("err: %s", err) - } - - result := h.Sum(nil) - return hex.EncodeToString(result) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go deleted file mode 100644 index 84c4aa33d7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz.go +++ /dev/null @@ -1,39 +0,0 @@ -package getter - -import ( - "compress/gzip" - "fmt" - "os" - "path/filepath" -) - -// TarGzipDecompressor is an implementation of Decompressor that can -// decompress tar.gzip files. -type TarGzipDecompressor struct{} - -func (d *TarGzipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Gzip compression is second - gzipR, err := gzip.NewReader(f) - if err != nil { - return fmt.Errorf("Error opening a gzip reader for %s: %s", src, err) - } - defer gzipR.Close() - - return untar(gzipR, dst, src, dir, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go deleted file mode 100644 index e0e4d2380c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tgz_test.go +++ /dev/null @@ -1,95 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestTarGzipDecompressor(t *testing.T) { - - multiplePaths := []string{"dir/", "dir/test2", "test1"} - orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} - - cases := []TestDecompressCase{ - { - "empty.tar.gz", - false, - true, - nil, - "", - nil, - }, - - { - "single.tar.gz", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.tar.gz", - true, - false, - []string{"file"}, - "", - nil, - }, - - { - "multiple.tar.gz", - true, - false, - []string{"file1", "file2"}, - "", - nil, - }, - - { - "multiple.tar.gz", - false, - true, - nil, - "", - nil, - }, - - { - "multiple_dir.tar.gz", - true, - false, - multiplePaths, - "", - nil, - }, - - // Tests when the file is listed before the parent folder - { - "ordering.tar.gz", - true, - false, - orderingPaths, - "", - nil, - }, - - // Tests that a tar.gz can't contain references with "..". - // GNU `tar` also disallows this. - { - "outside_parent.tar.gz", - true, - true, - nil, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-tgz", tc.Input) - } - - TestDecompressor(t, new(TarGzipDecompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go deleted file mode 100644 index 24686f4546..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz.go +++ /dev/null @@ -1,39 +0,0 @@ -package getter - -import ( - "fmt" - "os" - "path/filepath" - - "github.com/ulikunitz/xz" -) - -// TarXzDecompressor is an implementation of Decompressor that can -// decompress tar.xz files. -type TarXzDecompressor struct{} - -func (d *TarXzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // xz compression is second - txzR, err := xz.NewReader(f) - if err != nil { - return fmt.Errorf("Error opening an xz reader for %s: %s", src, err) - } - - return untar(txzR, dst, src, dir, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go deleted file mode 100644 index cb71c42505..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_txz_test.go +++ /dev/null @@ -1,84 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestTarXzDecompressor(t *testing.T) { - - multiplePaths := []string{"dir/", "dir/test2", "test1"} - orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} - - cases := []TestDecompressCase{ - { - "empty.tar.xz", - false, - true, - nil, - "", - nil, - }, - - { - "single.tar.xz", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.tar.xz", - true, - false, - []string{"file"}, - "", - nil, - }, - - { - "multiple.tar.xz", - true, - false, - []string{"file1", "file2"}, - "", - nil, - }, - - { - "multiple.tar.xz", - false, - true, - nil, - "", - nil, - }, - - { - "multiple_dir.tar.xz", - true, - false, - multiplePaths, - "", - nil, - }, - - // Tests when the file is listed before the parent folder - { - "ordering.tar.xz", - true, - false, - orderingPaths, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-txz", tc.Input) - } - - TestDecompressor(t, new(TarXzDecompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go deleted file mode 100644 index a9f3da51e4..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst.go +++ /dev/null @@ -1,39 +0,0 @@ -package getter - -import ( - "fmt" - "github.com/klauspost/compress/zstd" - "os" - "path/filepath" -) - -// TarZstdDecompressor is an implementation of Decompressor that can -// decompress tar.zstd files. -type TarZstdDecompressor struct{} - -func (d *TarZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // Zstd compression is second - zstdR, err := zstd.NewReader(f) - if err != nil { - return fmt.Errorf("Error opening a zstd reader for %s: %s", src, err) - } - defer zstdR.Close() - - return untar(zstdR, dst, src, dir, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go deleted file mode 100644 index 9787c72674..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_tzst_test.go +++ /dev/null @@ -1,95 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestTarZstdDecompressor(t *testing.T) { - - multiplePaths := []string{"dir/", "dir/test2", "test1"} - orderingPaths := []string{"workers/", "workers/mq/", "workers/mq/__init__.py"} - - cases := []TestDecompressCase{ - { - "empty.tar.zst", - false, - true, - nil, - "", - nil, - }, - - { - "single.tar.zst", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.tar.zst", - true, - false, - []string{"file"}, - "", - nil, - }, - - { - "multiple.tar.zst", - true, - false, - []string{"file1", "file2"}, - "", - nil, - }, - - { - "multiple.tar.zst", - false, - true, - nil, - "", - nil, - }, - - { - "multiple_dir.tar.zst", - true, - false, - multiplePaths, - "", - nil, - }, - - // Tests when the file is listed before the parent folder - { - "ordering.tar.zst", - true, - false, - orderingPaths, - "", - nil, - }, - - // Tests that a tar.zst can't contain references with "..". - // GNU `tar` also disallows this. - { - "outside_parent.tar.zst", - true, - true, - nil, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-tzst", tc.Input) - } - - TestDecompressor(t, new(TarZstdDecompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go deleted file mode 100644 index de5d6ce2b2..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz.go +++ /dev/null @@ -1,41 +0,0 @@ -package getter - -import ( - "fmt" - "os" - "path/filepath" - - "github.com/ulikunitz/xz" -) - -// XzDecompressor is an implementation of Decompressor that can -// decompress xz files. -type XzDecompressor struct{} - -func (d *XzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // Directory isn't supported at all - if dir { - return fmt.Errorf("xz-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // xz compression is second - xzR, err := xz.NewReader(f) - if err != nil { - return err - } - - // Copy it out - return copyReader(dst, xzR, 0622, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go deleted file mode 100644 index 9aa55b1f86..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_xz_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestXzDecompressor(t *testing.T) { - cases := []TestDecompressCase{ - { - "single.xz", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.xz", - true, - true, - nil, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-xz", tc.Input) - } - - TestDecompressor(t, new(XzDecompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go deleted file mode 100644 index 943610aee0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip.go +++ /dev/null @@ -1,91 +0,0 @@ -package getter - -import ( - "archive/zip" - "fmt" - "os" - "path/filepath" -) - -// ZipDecompressor is an implementation of Decompressor that can -// decompress zip files. -type ZipDecompressor struct{} - -func (d *ZipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - // If we're going into a directory we should make that first - mkdir := dst - if !dir { - mkdir = filepath.Dir(dst) - } - if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { - return err - } - - // Open the zip - zipR, err := zip.OpenReader(src) - if err != nil { - return err - } - defer zipR.Close() - - // Check the zip integrity - if len(zipR.File) == 0 { - // Empty archive - return fmt.Errorf("empty archive: %s", src) - } - if !dir && len(zipR.File) > 1 { - return fmt.Errorf("expected a single file: %s", src) - } - - // Go through and unarchive - for _, f := range zipR.File { - path := dst - if dir { - // Disallow parent traversal - if containsDotDot(f.Name) { - return fmt.Errorf("entry contains '..': %s", f.Name) - } - - path = filepath.Join(path, f.Name) - } - - if f.FileInfo().IsDir() { - if !dir { - return fmt.Errorf("expected a single file: %s", src) - } - - // A directory, just make the directory and continue unarchiving... - if err := os.MkdirAll(path, mode(0755, umask)); err != nil { - return err - } - - continue - } - - // Create the enclosing directories if we must. ZIP files aren't - // required to contain entries for just the directories so this - // can happen. - if dir { - if err := os.MkdirAll(filepath.Dir(path), mode(0755, umask)); err != nil { - return err - } - } - - // Open the file for reading - srcF, err := f.Open() - if err != nil { - if srcF != nil { - srcF.Close() - } - return err - } - - err = copyReader(path, srcF, f.Mode(), umask) - srcF.Close() - if err != nil { - return err - } - } - - return nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go deleted file mode 100644 index d898da158a..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zip_test.go +++ /dev/null @@ -1,131 +0,0 @@ -package getter - -import ( - "os" - "path/filepath" - "runtime" - "testing" -) - -func TestZipDecompressor(t *testing.T) { - cases := []TestDecompressCase{ - { - "empty.zip", - false, - true, - nil, - "", - nil, - }, - - { - "single.zip", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.zip", - true, - false, - []string{"file"}, - "", - nil, - }, - - { - "multiple.zip", - true, - false, - []string{"file1", "file2"}, - "", - nil, - }, - - { - "multiple.zip", - false, - true, - nil, - "", - nil, - }, - - { - "subdir.zip", - true, - false, - []string{"file1", "subdir/", "subdir/child"}, - "", - nil, - }, - - { - "subdir_empty.zip", - true, - false, - []string{"file1", "subdir/"}, - "", - nil, - }, - - { - "subdir_missing_dir.zip", - true, - false, - []string{"file1", "subdir/", "subdir/child"}, - "", - nil, - }, - - // Tests that a zip can't contain references with "..". - { - "outside_parent.zip", - true, - true, - nil, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-zip", tc.Input) - } - - TestDecompressor(t, new(ZipDecompressor), cases) -} - -func TestDecompressZipPermissions(t *testing.T) { - d := new(ZipDecompressor) - input := "./test-fixtures/decompress-zip/permissions.zip" - - var expected map[string]int - var masked int - - if runtime.GOOS == "windows" { - expected = map[string]int{ - "directory/public": 0666, - "directory/private": 0666, - "directory/exec": 0666, - "directory/setuid": 0666, - } - masked = 0666 - } else { - expected = map[string]int{ - "directory/public": 0666, - "directory/private": 0600, - "directory/exec": 0755, - "directory/setuid": 040000755, - } - masked = 0755 - } - - testDecompressorPermissions(t, d, input, expected, os.FileMode(0)) - - expected["directory/setuid"] = masked - testDecompressorPermissions(t, d, input, expected, os.FileMode(060000000)) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go deleted file mode 100644 index 6ff6c86a94..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd.go +++ /dev/null @@ -1,40 +0,0 @@ -package getter - -import ( - "fmt" - "github.com/klauspost/compress/zstd" - "os" - "path/filepath" -) - -// ZstdDecompressor is an implementation of Decompressor that -// can decompress .zst files. -type ZstdDecompressor struct{} - -func (d *ZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { - if dir { - return fmt.Errorf("zstd-compressed files can only unarchive to a single file") - } - - // If we're going into a directory we should make that first - if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { - return err - } - - // File first - f, err := os.Open(src) - if err != nil { - return err - } - defer f.Close() - - // zstd compression is second - zstdR, err := zstd.NewReader(f) - if err != nil { - return err - } - defer zstdR.Close() - - // Copy it out - return copyReader(dst, zstdR, 0622, umask) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go deleted file mode 100644 index 6a0683589f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/decompress_zstd_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package getter - -import ( - "path/filepath" - "testing" -) - -func TestZstdDecompressor(t *testing.T) { - cases := []TestDecompressCase{ - { - "single.zst", - false, - false, - nil, - "d3b07384d113edec49eaa6238ad5ff00", - nil, - }, - - { - "single.zst", - true, - true, - nil, - "", - nil, - }, - } - - for i, tc := range cases { - cases[i].Input = filepath.Join("./testdata", "decompress-zst", tc.Input) - } - - TestDecompressor(t, new(ZstdDecompressor), cases) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect.go deleted file mode 100644 index f134f77051..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect.go +++ /dev/null @@ -1,106 +0,0 @@ -package getter - -import ( - "fmt" - "path/filepath" - - "github.com/hashicorp/go-getter/helper/url" -) - -// Detector defines the interface that an invalid URL or a URL with a blank -// scheme is passed through in order to determine if its shorthand for -// something else well-known. -type Detector interface { - // Detect will detect whether the string matches a known pattern to - // turn it into a proper URL. - Detect(string, string) (string, bool, error) -} - -// Detectors is the list of detectors that are tried on an invalid URL. -// This is also the order they're tried (index 0 is first). -var Detectors []Detector - -func init() { - Detectors = []Detector{ - new(GitHubDetector), - new(GitLabDetector), - new(GitDetector), - new(BitBucketDetector), - new(S3Detector), - new(GCSDetector), - new(FileDetector), - } -} - -// Detect turns a source string into another source string if it is -// detected to be of a known pattern. -// -// The third parameter should be the list of detectors to use in the -// order to try them. If you don't want to configure this, just use -// the global Detectors variable. -// -// This is safe to be called with an already valid source string: Detect -// will just return it. -func Detect(src string, pwd string, ds []Detector) (string, error) { - getForce, getSrc := getForcedGetter(src) - - // Separate out the subdir if there is one, we don't pass that to detect - getSrc, subDir := SourceDirSubdir(getSrc) - - u, err := url.Parse(getSrc) - if err == nil && u.Scheme != "" { - // Valid URL - return src, nil - } - - for _, d := range ds { - result, ok, err := d.Detect(getSrc, pwd) - if err != nil { - return "", err - } - if !ok { - continue - } - - var detectForce string - detectForce, result = getForcedGetter(result) - result, detectSubdir := SourceDirSubdir(result) - - // If we have a subdir from the detection, then prepend it to our - // requested subdir. - if detectSubdir != "" { - if subDir != "" { - subDir = filepath.Join(detectSubdir, subDir) - } else { - subDir = detectSubdir - } - } - - if subDir != "" { - u, err := url.Parse(result) - if err != nil { - return "", fmt.Errorf("Error parsing URL: %s", err) - } - u.Path += "//" + subDir - - // a subdir may contain wildcards, but in order to support them we - // have to ensure the path isn't escaped. - u.RawPath = u.Path - - result = u.String() - } - - // Preserve the forced getter if it exists. We try to use the - // original set force first, followed by any force set by the - // detector. - if getForce != "" { - result = fmt.Sprintf("%s::%s", getForce, result) - } else if detectForce != "" { - result = fmt.Sprintf("%s::%s", detectForce, result) - } - - return result, nil - } - - return "", fmt.Errorf("invalid source string: %s", src) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go deleted file mode 100644 index 19047eb197..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket.go +++ /dev/null @@ -1,66 +0,0 @@ -package getter - -import ( - "encoding/json" - "fmt" - "net/http" - "net/url" - "strings" -) - -// BitBucketDetector implements Detector to detect BitBucket URLs and turn -// them into URLs that the Git or Hg Getter can understand. -type BitBucketDetector struct{} - -func (d *BitBucketDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.HasPrefix(src, "bitbucket.org/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *BitBucketDetector) detectHTTP(src string) (string, bool, error) { - u, err := url.Parse("https://" + src) - if err != nil { - return "", true, fmt.Errorf("error parsing BitBucket URL: %s", err) - } - - // We need to get info on this BitBucket repository to determine whether - // it is Git or Hg. - var info struct { - SCM string `json:"scm"` - } - infoUrl := "https://api.bitbucket.org/2.0/repositories" + u.Path - resp, err := http.Get(infoUrl) - if err != nil { - return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) - } - if resp.StatusCode == 403 { - // A private repo - return "", true, fmt.Errorf( - "shorthand BitBucket URL can't be used for private repos, " + - "please use a full URL") - } - dec := json.NewDecoder(resp.Body) - if err := dec.Decode(&info); err != nil { - return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) - } - - switch info.SCM { - case "git": - if !strings.HasSuffix(u.Path, ".git") { - u.Path += ".git" - } - - return "git::" + u.String(), true, nil - case "hg": - return "hg::" + u.String(), true, nil - default: - return "", true, fmt.Errorf("unknown BitBucket SCM type: %s", info.SCM) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go deleted file mode 100644 index 2b5948cebf..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_bitbucket_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package getter - -import ( - "net/http" - "strings" - "testing" -) - -const testBBUrl = "https://bitbucket.org/hashicorp/tf-test-git" - -func TestBitBucketDetector(t *testing.T) { - t.Parallel() - - if _, err := http.Get(testBBUrl); err != nil { - t.Log("internet may not be working, skipping BB tests") - t.Skip() - } - - cases := []struct { - Input string - Output string - }{ - // HTTP - { - "bitbucket.org/hashicorp/tf-test-git", - "git::https://bitbucket.org/hashicorp/tf-test-git.git", - }, - { - "bitbucket.org/hashicorp/tf-test-git.git", - "git::https://bitbucket.org/hashicorp/tf-test-git.git", - }, - } - - pwd := "/pwd" - f := new(BitBucketDetector) - for i, tc := range cases { - var err error - for i := 0; i < 3; i++ { - var output string - var ok bool - output, ok, err = f.Detect(tc.Input, pwd) - if err != nil { - if strings.Contains(err.Error(), "invalid character") { - continue - } - - t.Fatalf("err: %s", err) - } - if !ok { - t.Fatal("not ok") - } - - if output != tc.Output { - t.Fatalf("%d: bad: %#v", i, output) - } - - break - } - if i >= 3 { - t.Fatalf("failure from bitbucket: %s", err) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go deleted file mode 100644 index 4ef41ea73f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file.go +++ /dev/null @@ -1,67 +0,0 @@ -package getter - -import ( - "fmt" - "os" - "path/filepath" - "runtime" -) - -// FileDetector implements Detector to detect file paths. -type FileDetector struct{} - -func (d *FileDetector) Detect(src, pwd string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if !filepath.IsAbs(src) { - if pwd == "" { - return "", true, fmt.Errorf( - "relative paths require a module with a pwd") - } - - // Stat the pwd to determine if its a symbolic link. If it is, - // then the pwd becomes the original directory. Otherwise, - // `filepath.Join` below does some weird stuff. - // - // We just ignore if the pwd doesn't exist. That error will be - // caught later when we try to use the URL. - if fi, err := os.Lstat(pwd); !os.IsNotExist(err) { - if err != nil { - return "", true, err - } - if fi.Mode()&os.ModeSymlink != 0 { - pwd, err = filepath.EvalSymlinks(pwd) - if err != nil { - return "", true, err - } - - // The symlink itself might be a relative path, so we have to - // resolve this to have a correctly rooted URL. - pwd, err = filepath.Abs(pwd) - if err != nil { - return "", true, err - } - } - } - - src = filepath.Join(pwd, src) - } - - return fmtFileURL(src), true, nil -} - -func fmtFileURL(path string) string { - if runtime.GOOS == "windows" { - // Make sure we're using "/" on Windows. URLs are "/"-based. - path = filepath.ToSlash(path) - return fmt.Sprintf("file://%s", path) - } - - // Make sure that we don't start with "/" since we add that below. - if path[0] == '/' { - path = path[1:] - } - return fmt.Sprintf("file:///%s", path) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go deleted file mode 100644 index 0f7a055c93..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_test.go +++ /dev/null @@ -1,115 +0,0 @@ -package getter - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - "strings" - "testing" -) - -type fileTest struct { - in, pwd, out string - err bool -} - -var fileTests = []fileTest{ - {"./foo", "/pwd", "file:///pwd/foo", false}, - {"./foo?foo=bar", "/pwd", "file:///pwd/foo?foo=bar", false}, - {"foo", "/pwd", "file:///pwd/foo", false}, -} - -var unixFileTests = []fileTest{ - {"./foo", "testdata/detect-file-symlink-pwd/syml/pwd", - "testdata/detect-file-symlink-pwd/real/foo", false}, - - {"/foo", "/pwd", "file:///foo", false}, - {"/foo?bar=baz", "/pwd", "file:///foo?bar=baz", false}, -} - -var winFileTests = []fileTest{ - {"/foo", "/pwd", "file:///pwd/foo", false}, - {`C:\`, `/pwd`, `file://C:/`, false}, - {`C:\?bar=baz`, `/pwd`, `file://C:/?bar=baz`, false}, -} - -func TestFileDetector(t *testing.T) { - if runtime.GOOS == "windows" { - fileTests = append(fileTests, winFileTests...) - } else { - fileTests = append(fileTests, unixFileTests...) - } - - // Get the pwd - pwdRoot, err := os.Getwd() - if err != nil { - t.Fatalf("err: %s", err) - } - pwdRoot, err = filepath.Abs(pwdRoot) - if err != nil { - t.Fatalf("err: %s", err) - } - - f := new(FileDetector) - for i, tc := range fileTests { - t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { - pwd := tc.pwd - - out, ok, err := f.Detect(tc.in, pwd) - if err != nil { - t.Fatalf("err: %s", err) - } - if !ok { - t.Fatal("not ok") - } - - expected := tc.out - if !strings.HasPrefix(expected, "file://") { - expected = "file://" + filepath.Join(pwdRoot, expected) - } - - if out != expected { - t.Fatalf("input: %q\npwd: %q\nexpected: %q\nbad output: %#v", - tc.in, pwd, expected, out) - } - }) - } -} - -var noPwdFileTests = []fileTest{ - {in: "./foo", pwd: "", out: "", err: true}, - {in: "foo", pwd: "", out: "", err: true}, -} - -var noPwdUnixFileTests = []fileTest{ - {in: "/foo", pwd: "", out: "file:///foo", err: false}, -} - -var noPwdWinFileTests = []fileTest{ - {in: "/foo", pwd: "", out: "", err: true}, - {in: `C:\`, pwd: ``, out: `file://C:/`, err: false}, -} - -func TestFileDetector_noPwd(t *testing.T) { - if runtime.GOOS == "windows" { - noPwdFileTests = append(noPwdFileTests, noPwdWinFileTests...) - } else { - noPwdFileTests = append(noPwdFileTests, noPwdUnixFileTests...) - } - - f := new(FileDetector) - for i, tc := range noPwdFileTests { - out, ok, err := f.Detect(tc.in, tc.pwd) - if err != nil != tc.err { - t.Fatalf("%d: err: %s", i, err) - } - if !ok { - t.Fatal("not ok") - } - - if out != tc.out { - t.Fatalf("%d: bad: %#v", i, out) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go deleted file mode 100644 index 657f1a41c9..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_file_unix_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// +build test unix - -package getter - -import ( - "io/ioutil" - "os" - "path/filepath" - "testing" -) - -// If a relative symlink is passed in as the pwd to Detect, the resulting URL -// can have an invalid path. -func TestFileDetector_relativeSymlink(t *testing.T) { - tmpDir, err := ioutil.TempDir("", "go-getter") - if err != nil { - t.Fatal(err) - } - - defer os.RemoveAll(tmpDir) - - // We may have a symlinked tmp dir, - // e.g. OSX uses /var -> /private/var - tmpDir, err = filepath.EvalSymlinks(tmpDir) - if err != nil { - t.Fatal(err) - } - - err = os.Mkdir(filepath.Join(tmpDir, "realPWD"), 0755) - if err != nil { - t.Fatal(err) - } - - subdir := filepath.Join(tmpDir, "subdir") - err = os.Mkdir(subdir, 0755) - if err != nil { - t.Fatal(err) - } - - prevDir, err := os.Getwd() - if err != nil { - t.Fatal(err) - } - defer os.Chdir(prevDir) - - err = os.Chdir(subdir) - if err != nil { - t.Fatal(err) - } - - err = os.Symlink("../realPWD", "linkedPWD") - if err != nil { - t.Fatal(err) - } - - // if detech doesn't fully resolve the pwd symlink, the output will be the - // invalid path: "file:///../modules/foo" - f := new(FileDetector) - out, ok, err := f.Detect("../modules/foo", "./linkedPWD") - if err != nil { - t.Fatalf("err: %v", err) - } - if !ok { - t.Fatal("not ok") - } - if out != "file://"+filepath.Join(tmpDir, "modules/foo") { - t.Logf("expected: %v", "file://"+filepath.Join(tmpDir, "modules/foo")) - t.Fatalf("bad: %v", out) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go deleted file mode 100644 index 11363737c7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs.go +++ /dev/null @@ -1,43 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// GCSDetector implements Detector to detect GCS URLs and turn -// them into URLs that the GCSGetter can understand. -type GCSDetector struct{} - -func (d *GCSDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.Contains(src, "googleapis.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *GCSDetector) detectHTTP(src string) (string, bool, error) { - - parts := strings.Split(src, "/") - if len(parts) < 5 { - return "", false, fmt.Errorf( - "URL is not a valid GCS URL") - } - version := parts[2] - bucket := parts[3] - object := strings.Join(parts[4:], "/") - - url, err := url.Parse(fmt.Sprintf("https://www.googleapis.com/storage/%s/%s/%s", - version, bucket, object)) - if err != nil { - return "", false, fmt.Errorf("error parsing GCS URL: %s", err) - } - - return "gcs::" + url.String(), true, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go deleted file mode 100644 index 94e1ec42b2..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gcs_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package getter - -import ( - "testing" -) - -func TestGCSDetector(t *testing.T) { - cases := []struct { - Input string - Output string - }{ - { - "www.googleapis.com/storage/v1/bucket/foo", - "gcs::https://www.googleapis.com/storage/v1/bucket/foo", - }, - { - "www.googleapis.com/storage/v1/bucket/foo/bar", - "gcs::https://www.googleapis.com/storage/v1/bucket/foo/bar", - }, - { - "www.googleapis.com/storage/v1/foo/bar.baz", - "gcs::https://www.googleapis.com/storage/v1/foo/bar.baz", - }, - } - - pwd := "/pwd" - f := new(GCSDetector) - for i, tc := range cases { - output, ok, err := f.Detect(tc.Input, pwd) - if err != nil { - t.Fatalf("err: %s", err) - } - if !ok { - t.Fatal("not ok") - } - - if output != tc.Output { - t.Fatalf("%d: bad: %#v", i, output) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go deleted file mode 100644 index eeb8a04c5e..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_git.go +++ /dev/null @@ -1,26 +0,0 @@ -package getter - -// GitDetector implements Detector to detect Git SSH URLs such as -// git@host.com:dir1/dir2 and converts them to proper URLs. -type GitDetector struct{} - -func (d *GitDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - u, err := detectSSH(src) - if err != nil { - return "", true, err - } - if u == nil { - return "", false, nil - } - - // We require the username to be "git" to assume that this is a Git URL - if u.User.Username() != "git" { - return "", false, nil - } - - return "git::" + u.String(), true, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go deleted file mode 100644 index a71dde2c31..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_git_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package getter - -import ( - "testing" -) - -func TestGitDetector(t *testing.T) { - cases := []struct { - Input string - Output string - }{ - { - "git@github.com:hashicorp/foo.git", - "git::ssh://git@github.com/hashicorp/foo.git", - }, - { - "git@github.com:org/project.git?ref=test-branch", - "git::ssh://git@github.com/org/project.git?ref=test-branch", - }, - { - "git@github.com:hashicorp/foo.git//bar", - "git::ssh://git@github.com/hashicorp/foo.git//bar", - }, - { - "git@github.com:hashicorp/foo.git?foo=bar", - "git::ssh://git@github.com/hashicorp/foo.git?foo=bar", - }, - { - "git@github.xyz.com:org/project.git", - "git::ssh://git@github.xyz.com/org/project.git", - }, - { - "git@github.xyz.com:org/project.git?ref=test-branch", - "git::ssh://git@github.xyz.com/org/project.git?ref=test-branch", - }, - { - "git@github.xyz.com:org/project.git//module/a", - "git::ssh://git@github.xyz.com/org/project.git//module/a", - }, - { - "git@github.xyz.com:org/project.git//module/a?ref=test-branch", - "git::ssh://git@github.xyz.com/org/project.git//module/a?ref=test-branch", - }, - { - // Already in the canonical form, so no rewriting required - // When the ssh: protocol is used explicitly, we recognize it as - // URL form rather than SCP-like form, so the part after the colon - // is a port number, not part of the path. - "git::ssh://git@git.example.com:2222/hashicorp/foo.git", - "git::ssh://git@git.example.com:2222/hashicorp/foo.git", - }, - } - - pwd := "/pwd" - f := new(GitDetector) - ds := []Detector{f} - for _, tc := range cases { - t.Run(tc.Input, func(t *testing.T) { - output, err := Detect(tc.Input, pwd, ds) - if err != nil { - t.Fatalf("unexpected error: %s", err) - } - - if output != tc.Output { - t.Errorf("wrong result\ninput: %s\ngot: %s\nwant: %s", tc.Input, output, tc.Output) - } - }) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go deleted file mode 100644 index 4bf4daf238..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_github.go +++ /dev/null @@ -1,47 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// GitHubDetector implements Detector to detect GitHub URLs and turn -// them into URLs that the Git Getter can understand. -type GitHubDetector struct{} - -func (d *GitHubDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.HasPrefix(src, "github.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *GitHubDetector) detectHTTP(src string) (string, bool, error) { - parts := strings.Split(src, "/") - if len(parts) < 3 { - return "", false, fmt.Errorf( - "GitHub URLs should be github.com/username/repo") - } - - urlStr := fmt.Sprintf("https://%s", strings.Join(parts[:3], "/")) - url, err := url.Parse(urlStr) - if err != nil { - return "", true, fmt.Errorf("error parsing GitHub URL: %s", err) - } - - if !strings.HasSuffix(url.Path, ".git") { - url.Path += ".git" - } - - if len(parts) > 3 { - url.Path += "//" + strings.Join(parts[3:], "/") - } - - return "git::" + url.String(), true, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go deleted file mode 100644 index 70f1c83291..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_github_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package getter - -import ( - "testing" -) - -func TestGitHubDetector(t *testing.T) { - cases := []struct { - Input string - Output string - }{ - // HTTP - {"github.com/hashicorp/foo", "git::https://github.com/hashicorp/foo.git"}, - {"github.com/hashicorp/foo.git", "git::https://github.com/hashicorp/foo.git"}, - { - "github.com/hashicorp/foo/bar", - "git::https://github.com/hashicorp/foo.git//bar", - }, - { - "github.com/hashicorp/foo?foo=bar", - "git::https://github.com/hashicorp/foo.git?foo=bar", - }, - { - "github.com/hashicorp/foo.git?foo=bar", - "git::https://github.com/hashicorp/foo.git?foo=bar", - }, - } - - pwd := "/pwd" - f := new(GitHubDetector) - for i, tc := range cases { - output, ok, err := f.Detect(tc.Input, pwd) - if err != nil { - t.Fatalf("err: %s", err) - } - if !ok { - t.Fatal("not ok") - } - - if output != tc.Output { - t.Fatalf("%d: bad: %#v", i, output) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go deleted file mode 100644 index 9d1e8d83cd..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab.go +++ /dev/null @@ -1,47 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// GitLabDetector implements Detector to detect GitLab URLs and turn -// them into URLs that the Git Getter can understand. -type GitLabDetector struct{} - -func (d *GitLabDetector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.HasPrefix(src, "gitlab.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *GitLabDetector) detectHTTP(src string) (string, bool, error) { - parts := strings.Split(src, "/") - if len(parts) < 3 { - return "", false, fmt.Errorf( - "GitLab URLs should be gitlab.com/username/repo") - } - - urlStr := fmt.Sprintf("https://%s", strings.Join(parts[:3], "/")) - repoUrl, err := url.Parse(urlStr) - if err != nil { - return "", true, fmt.Errorf("error parsing GitLab URL: %s", err) - } - - if !strings.HasSuffix(repoUrl.Path, ".git") { - repoUrl.Path += ".git" - } - - if len(parts) > 3 { - repoUrl.Path += "//" + strings.Join(parts[3:], "/") - } - - return "git::" + repoUrl.String(), true, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go deleted file mode 100644 index f1f85af3c0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_gitlab_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package getter - -import ( - "testing" -) - -func TestGitLabDetector(t *testing.T) { - cases := []struct { - Input string - Output string - }{ - // HTTP - {"gitlab.com/hashicorp/foo", "git::https://gitlab.com/hashicorp/foo.git"}, - {"gitlab.com/hashicorp/foo.git", "git::https://gitlab.com/hashicorp/foo.git"}, - { - "gitlab.com/hashicorp/foo/bar", - "git::https://gitlab.com/hashicorp/foo.git//bar", - }, - { - "gitlab.com/hashicorp/foo?foo=bar", - "git::https://gitlab.com/hashicorp/foo.git?foo=bar", - }, - { - "gitlab.com/hashicorp/foo.git?foo=bar", - "git::https://gitlab.com/hashicorp/foo.git?foo=bar", - }, - } - - pwd := "/pwd" - f := new(GitLabDetector) - for i, tc := range cases { - output, ok, err := f.Detect(tc.Input, pwd) - if err != nil { - t.Fatalf("err: %s", err) - } - if !ok { - t.Fatal("not ok") - } - - if output != tc.Output { - t.Fatalf("%d: bad: %#v", i, output) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go deleted file mode 100644 index 89f3c35dcf..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3.go +++ /dev/null @@ -1,73 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "strings" -) - -// S3Detector implements Detector to detect S3 URLs and turn -// them into URLs that the S3 getter can understand. -type S3Detector struct{} - -func (d *S3Detector) Detect(src, _ string) (string, bool, error) { - if len(src) == 0 { - return "", false, nil - } - - if strings.Contains(src, ".amazonaws.com/") { - return d.detectHTTP(src) - } - - return "", false, nil -} - -func (d *S3Detector) detectHTTP(src string) (string, bool, error) { - parts := strings.Split(src, "/") - if len(parts) < 2 { - return "", false, fmt.Errorf( - "URL is not a valid S3 URL") - } - - hostParts := strings.Split(parts[0], ".") - if len(hostParts) == 3 { - return d.detectPathStyle(hostParts[0], parts[1:]) - } else if len(hostParts) == 4 { - return d.detectVhostStyle(hostParts[1], hostParts[0], parts[1:]) - } else if len(hostParts) == 5 && hostParts[1] == "s3" { - return d.detectNewVhostStyle(hostParts[2], hostParts[0], parts[1:]) - } else { - return "", false, fmt.Errorf( - "URL is not a valid S3 URL") - } -} - -func (d *S3Detector) detectPathStyle(region string, parts []string) (string, bool, error) { - urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s", region, strings.Join(parts, "/")) - url, err := url.Parse(urlStr) - if err != nil { - return "", false, fmt.Errorf("error parsing S3 URL: %s", err) - } - - return "s3::" + url.String(), true, nil -} - -func (d *S3Detector) detectVhostStyle(region, bucket string, parts []string) (string, bool, error) { - urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s/%s", region, bucket, strings.Join(parts, "/")) - url, err := url.Parse(urlStr) - if err != nil { - return "", false, fmt.Errorf("error parsing S3 URL: %s", err) - } - - return "s3::" + url.String(), true, nil -} - -func (d *S3Detector) detectNewVhostStyle(region, bucket string, parts []string) (string, bool, error) { - urlStr := fmt.Sprintf("https://s3.%s.amazonaws.com/%s/%s", region, bucket, strings.Join(parts, "/")) - url, err := url.Parse(urlStr) - if err != nil { - return "", false, fmt.Errorf("error parsing S3 URL: %s", err) - } - - return "s3::" + url.String(), true, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go deleted file mode 100644 index 6aceafd8f3..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_s3_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package getter - -import ( - "testing" -) - -func TestS3Detector(t *testing.T) { - cases := []struct { - Input string - Output string - }{ - // Virtual hosted style - { - "bucket.s3.amazonaws.com/foo", - "s3::https://s3.amazonaws.com/bucket/foo", - }, - { - "bucket.s3.amazonaws.com/foo/bar", - "s3::https://s3.amazonaws.com/bucket/foo/bar", - }, - { - "bucket.s3.amazonaws.com/foo/bar.baz", - "s3::https://s3.amazonaws.com/bucket/foo/bar.baz", - }, - { - "bucket.s3-eu-west-1.amazonaws.com/foo", - "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo", - }, - { - "bucket.s3-eu-west-1.amazonaws.com/foo/bar", - "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar", - }, - { - "bucket.s3-eu-west-1.amazonaws.com/foo/bar.baz", - "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz", - }, - // 5 parts Virtual hosted-style - { - "bucket.s3.eu-west-1.amazonaws.com/foo/bar.baz", - "s3::https://s3.eu-west-1.amazonaws.com/bucket/foo/bar.baz", - }, - // Path style - { - "s3.amazonaws.com/bucket/foo", - "s3::https://s3.amazonaws.com/bucket/foo", - }, - { - "s3.amazonaws.com/bucket/foo/bar", - "s3::https://s3.amazonaws.com/bucket/foo/bar", - }, - { - "s3.amazonaws.com/bucket/foo/bar.baz", - "s3::https://s3.amazonaws.com/bucket/foo/bar.baz", - }, - { - "s3-eu-west-1.amazonaws.com/bucket/foo", - "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo", - }, - { - "s3-eu-west-1.amazonaws.com/bucket/foo/bar", - "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar", - }, - { - "s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz", - "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz", - }, - // Misc tests - { - "s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz?version=1234", - "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz?version=1234", - }, - } - - pwd := "/pwd" - f := new(S3Detector) - for i, tc := range cases { - output, ok, err := f.Detect(tc.Input, pwd) - if err != nil { - t.Fatalf("err: %s", err) - } - if !ok { - t.Fatal("not ok") - } - - if output != tc.Output { - t.Fatalf("%d: bad: %#v", i, output) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go deleted file mode 100644 index c0dbe9d475..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_ssh.go +++ /dev/null @@ -1,49 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "regexp" - "strings" -) - -// Note that we do not have an SSH-getter currently so this file serves -// only to hold the detectSSH helper that is used by other detectors. - -// sshPattern matches SCP-like SSH patterns (user@host:path) -var sshPattern = regexp.MustCompile("^(?:([^@]+)@)?([^:]+):/?(.+)$") - -// detectSSH determines if the src string matches an SSH-like URL and -// converts it into a net.URL compatible string. This returns nil if the -// string doesn't match the SSH pattern. -// -// This function is tested indirectly via detect_git_test.go -func detectSSH(src string) (*url.URL, error) { - matched := sshPattern.FindStringSubmatch(src) - if matched == nil { - return nil, nil - } - - user := matched[1] - host := matched[2] - path := matched[3] - qidx := strings.Index(path, "?") - if qidx == -1 { - qidx = len(path) - } - - var u url.URL - u.Scheme = "ssh" - u.User = url.User(user) - u.Host = host - u.Path = path[0:qidx] - if qidx < len(path) { - q, err := url.ParseQuery(path[qidx+1:]) - if err != nil { - return nil, fmt.Errorf("error parsing GitHub SSH URL: %s", err) - } - u.RawQuery = q.Encode() - } - - return &u, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go deleted file mode 100644 index 9bef662a7b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/detect_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package getter - -import ( - "fmt" - "testing" -) - -func TestDetect(t *testing.T) { - cases := []struct { - Input string - Pwd string - Output string - Err bool - }{ - {"./foo", "/foo", "file:///foo/foo", false}, - {"git::./foo", "/foo", "git::file:///foo/foo", false}, - { - "git::github.com/hashicorp/foo", - "", - "git::https://github.com/hashicorp/foo.git", - false, - }, - { - "./foo//bar", - "/foo", - "file:///foo/foo//bar", - false, - }, - { - "git::github.com/hashicorp/foo//bar", - "", - "git::https://github.com/hashicorp/foo.git//bar", - false, - }, - { - "git::https://github.com/hashicorp/consul.git", - "", - "git::https://github.com/hashicorp/consul.git", - false, - }, - { - "git::https://person@someothergit.com/foo/bar", - "", - "git::https://person@someothergit.com/foo/bar", - false, - }, - { - "git::https://person@someothergit.com/foo/bar", - "/bar", - "git::https://person@someothergit.com/foo/bar", - false, - }, - { - "./foo/archive//*", - "/bar", - "file:///bar/foo/archive//*", - false, - }, - - // https://github.com/hashicorp/go-getter/pull/124 - { - "git::ssh://git@my.custom.git/dir1/dir2", - "", - "git::ssh://git@my.custom.git/dir1/dir2", - false, - }, - { - "git::git@my.custom.git:dir1/dir2", - "/foo", - "git::ssh://git@my.custom.git/dir1/dir2", - false, - }, - { - "git::git@my.custom.git:dir1/dir2", - "", - "git::ssh://git@my.custom.git/dir1/dir2", - false, - }, - } - - for i, tc := range cases { - t.Run(fmt.Sprintf("%d %s", i, tc.Input), func(t *testing.T) { - output, err := Detect(tc.Input, tc.Pwd, Detectors) - if err != nil != tc.Err { - t.Fatalf("%d: bad err: %s", i, err) - } - if output != tc.Output { - t.Fatalf("%d: bad output: %s\nexpected: %s", i, output, tc.Output) - } - }) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go b/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go deleted file mode 100644 index 647ccf4592..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage.go +++ /dev/null @@ -1,65 +0,0 @@ -package getter - -import ( - "crypto/md5" - "encoding/hex" - "fmt" - "os" - "path/filepath" -) - -// FolderStorage is an implementation of the Storage interface that manages -// modules on the disk. -type FolderStorage struct { - // StorageDir is the directory where the modules will be stored. - StorageDir string -} - -// Dir implements Storage.Dir -func (s *FolderStorage) Dir(key string) (d string, e bool, err error) { - d = s.dir(key) - _, err = os.Stat(d) - if err == nil { - // Directory exists - e = true - return - } - if os.IsNotExist(err) { - // Directory doesn't exist - d = "" - e = false - err = nil - return - } - - // An error - d = "" - e = false - return -} - -// Get implements Storage.Get -func (s *FolderStorage) Get(key string, source string, update bool) error { - dir := s.dir(key) - if !update { - if _, err := os.Stat(dir); err == nil { - // If the directory already exists, then we're done since - // we're not updating. - return nil - } else if !os.IsNotExist(err) { - // If the error we got wasn't a file-not-exist error, then - // something went wrong and we should report it. - return fmt.Errorf("Error reading module directory: %s", err) - } - } - - // Get the source. This always forces an update. - return Get(dir, source) -} - -// dir returns the directory name internally that we'll use to map to -// internally. -func (s *FolderStorage) dir(key string) string { - sum := md5.Sum([]byte(key)) - return filepath.Join(s.StorageDir, hex.EncodeToString(sum[:])) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go deleted file mode 100644 index feb8d34252..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/folder_storage_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package getter - -import ( - "os" - "path/filepath" - "testing" -) - -func TestFolderStorage_impl(t *testing.T) { - var _ Storage = new(FolderStorage) -} - -func TestFolderStorage(t *testing.T) { - s := &FolderStorage{StorageDir: tempDir(t)} - - module := testModule("basic") - - // A module shouldn't exist at first... - _, ok, err := s.Dir(module) - if err != nil { - t.Fatalf("err: %s", err) - } - if ok { - t.Fatal("should not exist") - } - - key := "foo" - - // We can get it - err = s.Get(key, module, false) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Now the module exists - dir, ok, err := s.Dir(key) - if err != nil { - t.Fatalf("err: %s", err) - } - if !ok { - t.Fatal("should exist") - } - - mainPath := filepath.Join(dir, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get.go b/test/integration/licenses/github.com/hashicorp/go-getter/get.go deleted file mode 100644 index c233763c67..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get.go +++ /dev/null @@ -1,152 +0,0 @@ -// getter is a package for downloading files or directories from a variety of -// protocols. -// -// getter is unique in its ability to download both directories and files. -// It also detects certain source strings to be protocol-specific URLs. For -// example, "github.com/hashicorp/go-getter" would turn into a Git URL and -// use the Git protocol. -// -// Protocols and detectors are extensible. -// -// To get started, see Client. -package getter - -import ( - "bytes" - "fmt" - "net/url" - "os/exec" - "regexp" - "syscall" - - cleanhttp "github.com/hashicorp/go-cleanhttp" -) - -// Getter defines the interface that schemes must implement to download -// things. -type Getter interface { - // Get downloads the given URL into the given directory. This always - // assumes that we're updating and gets the latest version that it can. - // - // The directory may already exist (if we're updating). If it is in a - // format that isn't understood, an error should be returned. Get shouldn't - // simply nuke the directory. - Get(string, *url.URL) error - - // GetFile downloads the give URL into the given path. The URL must - // reference a single file. If possible, the Getter should check if - // the remote end contains the same file and no-op this operation. - GetFile(string, *url.URL) error - - // ClientMode returns the mode based on the given URL. This is used to - // allow clients to let the getters decide which mode to use. - ClientMode(*url.URL) (ClientMode, error) - - // SetClient allows a getter to know it's client - // in order to access client's Get functions or - // progress tracking. - SetClient(*Client) -} - -// Getters is the mapping of scheme to the Getter implementation that will -// be used to get a dependency. -var Getters map[string]Getter - -// forcedRegexp is the regular expression that finds forced getters. This -// syntax is schema::url, example: git::https://foo.com -var forcedRegexp = regexp.MustCompile(`^([A-Za-z0-9]+)::(.+)$`) - -// httpClient is the default client to be used by HttpGetters. -var httpClient = cleanhttp.DefaultClient() - -func init() { - httpGetter := &HttpGetter{ - Netrc: true, - } - - Getters = map[string]Getter{ - "file": new(FileGetter), - "git": new(GitGetter), - "gcs": new(GCSGetter), - "hg": new(HgGetter), - "s3": new(S3Getter), - "http": httpGetter, - "https": httpGetter, - } -} - -// Get downloads the directory specified by src into the folder specified by -// dst. If dst already exists, Get will attempt to update it. -// -// src is a URL, whereas dst is always just a file path to a folder. This -// folder doesn't need to exist. It will be created if it doesn't exist. -func Get(dst, src string, opts ...ClientOption) error { - return (&Client{ - Src: src, - Dst: dst, - Dir: true, - Options: opts, - }).Get() -} - -// GetAny downloads a URL into the given destination. Unlike Get or -// GetFile, both directories and files are supported. -// -// dst must be a directory. If src is a file, it will be downloaded -// into dst with the basename of the URL. If src is a directory or -// archive, it will be unpacked directly into dst. -func GetAny(dst, src string, opts ...ClientOption) error { - return (&Client{ - Src: src, - Dst: dst, - Mode: ClientModeAny, - Options: opts, - }).Get() -} - -// GetFile downloads the file specified by src into the path specified by -// dst. -func GetFile(dst, src string, opts ...ClientOption) error { - return (&Client{ - Src: src, - Dst: dst, - Dir: false, - Options: opts, - }).Get() -} - -// getRunCommand is a helper that will run a command and capture the output -// in the case an error happens. -func getRunCommand(cmd *exec.Cmd) error { - var buf bytes.Buffer - cmd.Stdout = &buf - cmd.Stderr = &buf - err := cmd.Run() - if err == nil { - return nil - } - if exiterr, ok := err.(*exec.ExitError); ok { - // The program has exited with an exit code != 0 - if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { - return fmt.Errorf( - "%s exited with %d: %s", - cmd.Path, - status.ExitStatus(), - buf.String()) - } - } - - return fmt.Errorf("error running %s: %s", cmd.Path, buf.String()) -} - -// getForcedGetter takes a source and returns the tuple of the forced -// getter and the raw URL (without the force syntax). -func getForcedGetter(src string) (string, string) { - var forced string - if ms := forcedRegexp.FindStringSubmatch(src); ms != nil { - forced = ms[1] - src = ms[2] - } - - return forced, src -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_base.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_base.go deleted file mode 100644 index 09e9b6313b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_base.go +++ /dev/null @@ -1,20 +0,0 @@ -package getter - -import "context" - -// getter is our base getter; it regroups -// fields all getters have in common. -type getter struct { - client *Client -} - -func (g *getter) SetClient(c *Client) { g.client = c } - -// Context tries to returns the Contex from the getter's -// client. otherwise context.Background() is returned. -func (g *getter) Context() context.Context { - if g == nil || g.client == nil { - return context.Background() - } - return g.client.Ctx -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file.go deleted file mode 100644 index 78660839a0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_file.go +++ /dev/null @@ -1,36 +0,0 @@ -package getter - -import ( - "net/url" - "os" -) - -// FileGetter is a Getter implementation that will download a module from -// a file scheme. -type FileGetter struct { - getter - - // Copy, if set to true, will copy data instead of using a symlink. If - // false, attempts to symlink to speed up the operation and to lower the - // disk space usage. If the symlink fails, may attempt to copy on windows. - Copy bool -} - -func (g *FileGetter) ClientMode(u *url.URL) (ClientMode, error) { - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - fi, err := os.Stat(path) - if err != nil { - return 0, err - } - - // Check if the source is a directory. - if fi.IsDir() { - return ClientModeDir, nil - } - - return ClientModeFile, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go deleted file mode 100644 index 6eeda23ca9..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy.go +++ /dev/null @@ -1,86 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "io" - "os" -) - -// readerFunc is syntactic sugar for read interface. -type readerFunc func(p []byte) (n int, err error) - -func (rf readerFunc) Read(p []byte) (n int, err error) { return rf(p) } - -// Copy is a io.Copy cancellable by context -func Copy(ctx context.Context, dst io.Writer, src io.Reader) (int64, error) { - // Copy will call the Reader and Writer interface multiple time, in order - // to copy by chunk (avoiding loading the whole file in memory). - return io.Copy(dst, readerFunc(func(p []byte) (int, error) { - - select { - case <-ctx.Done(): - // context has been canceled - // stop process and propagate "context canceled" error - return 0, ctx.Err() - default: - // otherwise just run default io.Reader implementation - return src.Read(p) - } - })) -} - -// copyReader copies from an io.Reader into a file, using umask to create the dst file -func copyReader(dst string, src io.Reader, fmode, umask os.FileMode) error { - dstF, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, fmode) - if err != nil { - return err - } - defer dstF.Close() - - _, err = io.Copy(dstF, src) - if err != nil { - return err - } - - // Explicitly chmod; the process umask is unconditionally applied otherwise. - // We'll mask the mode with our own umask, but that may be different than - // the process umask - return os.Chmod(dst, mode(fmode, umask)) -} - -// copyFile copies a file in chunks from src path to dst path, using umask to create the dst file -func copyFile(ctx context.Context, dst, src string, disableSymlinks bool, fmode, umask os.FileMode) (int64, error) { - if disableSymlinks { - fileInfo, err := os.Lstat(src) - if err != nil { - return 0, fmt.Errorf("failed to check copy file source for symlinks: %w", err) - } - if fileInfo.Mode()&os.ModeSymlink == os.ModeSymlink { - return 0, ErrSymlinkCopy - } - } - - srcF, err := os.Open(src) - if err != nil { - return 0, err - } - defer srcF.Close() - - dstF, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE|os.O_TRUNC, fmode) - if err != nil { - return 0, err - } - defer dstF.Close() - - count, err := Copy(ctx, dstF, srcF) - if err != nil { - return 0, err - } - - // Explicitly chmod; the process umask is unconditionally applied otherwise. - // We'll mask the mode with our own umask, but that may be different than - // the process umask - err = os.Chmod(dst, mode(fmode, umask)) - return count, err -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go deleted file mode 100644 index 659edd2003..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_copy_test.go +++ /dev/null @@ -1,82 +0,0 @@ -package getter - -import ( - "bytes" - "context" - "io" - "testing" - "time" -) - -// OneDoneContext is a context that is -// cancelled after a first done is called. -type OneDoneContext bool - -func (*OneDoneContext) Deadline() (deadline time.Time, ok bool) { return } -func (*OneDoneContext) Value(key interface{}) interface{} { return nil } - -func (o *OneDoneContext) Err() error { - if *o == false { - return nil - } - return context.Canceled -} - -func (o *OneDoneContext) Done() <-chan struct{} { - if *o == false { - *o = true - return nil - } - c := make(chan struct{}) - close(c) - return c -} - -func (o *OneDoneContext) String() string { - if *o { - return "done OneDoneContext" - } - return "OneDoneContext" -} - -func TestCopy(t *testing.T) { - const text3lines = `line1 - line2 - line3 - ` - - cancelledContext, cancel := context.WithCancel(context.Background()) - _ = cancelledContext - cancel() - type args struct { - ctx context.Context - src io.Reader - } - tests := []struct { - name string - args args - want int64 - wantDst string - wantErr error - }{ - {"read all", args{context.Background(), bytes.NewBufferString(text3lines)}, int64(len(text3lines)), text3lines, nil}, - {"read none", args{cancelledContext, bytes.NewBufferString(text3lines)}, 0, "", context.Canceled}, - {"cancel after read", args{new(OneDoneContext), bytes.NewBufferString(text3lines)}, int64(len(text3lines)), text3lines, context.Canceled}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - dst := &bytes.Buffer{} - got, err := Copy(tt.args.ctx, dst, tt.args.src) - if err != tt.wantErr { - t.Errorf("Copy() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("Copy() = %v, want %v", got, tt.want) - } - if gotDst := dst.String(); gotDst != tt.wantDst { - t.Errorf("Copy() = %v, want %v", gotDst, tt.wantDst) - } - }) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go deleted file mode 100644 index 94ab3c1c14..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_test.go +++ /dev/null @@ -1,204 +0,0 @@ -package getter - -import ( - "os" - "path/filepath" - "testing" -) - -func TestFileGetter_impl(t *testing.T) { - var _ Getter = new(FileGetter) -} - -func TestFileGetter(t *testing.T) { - g := new(FileGetter) - dst := tempDir(t) - - // With a dir that doesn't exist - if err := g.Get(dst, testModuleURL("basic")); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the destination folder is a symlink - fi, err := os.Lstat(dst) - if err != nil { - t.Fatalf("err: %s", err) - } - if fi.Mode()&os.ModeSymlink == 0 { - t.Fatal("destination is not a symlink") - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestFileGetter_sourceFile(t *testing.T) { - g := new(FileGetter) - dst := tempDir(t) - - // With a source URL that is a path to a file - u := testModuleURL("basic") - u.Path += "/main.tf" - if err := g.Get(dst, u); err == nil { - t.Fatal("should error") - } -} - -func TestFileGetter_sourceNoExist(t *testing.T) { - g := new(FileGetter) - dst := tempDir(t) - - // With a source URL that doesn't exist - u := testModuleURL("basic") - u.Path += "/main" - if err := g.Get(dst, u); err == nil { - t.Fatal("should error") - } -} - -func TestFileGetter_dir(t *testing.T) { - g := new(FileGetter) - dst := tempDir(t) - - if err := os.MkdirAll(dst, 0755); err != nil { - t.Fatalf("err: %s", err) - } - - // With a dir that exists that isn't a symlink - if err := g.Get(dst, testModuleURL("basic")); err == nil { - t.Fatal("should error") - } -} - -func TestFileGetter_dirSymlink(t *testing.T) { - g := new(FileGetter) - dst := tempDir(t) - dst2 := tempDir(t) - - // Make parents - if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { - t.Fatalf("err: %s", err) - } - if err := os.MkdirAll(dst2, 0755); err != nil { - t.Fatalf("err: %s", err) - } - - // Make a symlink - if err := os.Symlink(dst2, dst); err != nil { - t.Fatalf("err: %s", err) - } - - // With a dir that exists that isn't a symlink - if err := g.Get(dst, testModuleURL("basic")); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestFileGetter_GetFile(t *testing.T) { - g := new(FileGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // With a dir that doesn't exist - if err := g.GetFile(dst, testModuleURL("basic-file/foo.txt")); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the destination folder is a symlink - fi, err := os.Lstat(dst) - if err != nil { - t.Fatalf("err: %s", err) - } - if fi.Mode()&os.ModeSymlink == 0 { - t.Fatal("destination is not a symlink") - } - - // Verify the main file exists - assertContents(t, dst, "Hello\n") -} - -func TestFileGetter_GetFile_Copy(t *testing.T) { - g := new(FileGetter) - g.Copy = true - - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // With a dir that doesn't exist - if err := g.GetFile(dst, testModuleURL("basic-file/foo.txt")); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the destination folder is a symlink - fi, err := os.Lstat(dst) - if err != nil { - t.Fatalf("err: %s", err) - } - if fi.Mode()&os.ModeSymlink != 0 { - t.Fatal("destination is a symlink") - } - - // Verify the main file exists - assertContents(t, dst, "Hello\n") -} - -// https://github.com/hashicorp/terraform/issues/8418 -func TestFileGetter_percent2F(t *testing.T) { - g := new(FileGetter) - dst := tempDir(t) - - // With a dir that doesn't exist - if err := g.Get(dst, testModuleURL("basic%2Ftest")); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestFileGetter_ClientMode_notexist(t *testing.T) { - g := new(FileGetter) - - u := testURL("nonexistent") - if _, err := g.ClientMode(u); err == nil { - t.Fatal("expect source file error") - } -} - -func TestFileGetter_ClientMode_file(t *testing.T) { - g := new(FileGetter) - - // Check the client mode when pointed at a file. - mode, err := g.ClientMode(testModuleURL("basic-file/foo.txt")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeFile { - t.Fatal("expect ClientModeFile") - } -} - -func TestFileGetter_ClientMode_dir(t *testing.T) { - g := new(FileGetter) - - // Check the client mode when pointed at a directory. - mode, err := g.ClientMode(testModuleURL("basic")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeDir { - t.Fatal("expect ClientModeDir") - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go deleted file mode 100644 index a14a38263e..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_unix.go +++ /dev/null @@ -1,99 +0,0 @@ -// +build !windows - -package getter - -import ( - "fmt" - "net/url" - "os" - "path/filepath" -) - -func (g *FileGetter) Get(dst string, u *url.URL) error { - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a directory to be usable. - if fi, err := os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if !fi.IsDir() { - return fmt.Errorf("source path must be a directory") - } - - fi, err := os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - mode := fi.Mode() - if mode&os.ModeSymlink == 0 { - return fmt.Errorf("destination exists and is not a symlink") - } - - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - return os.Symlink(path, dst) -} - -func (g *FileGetter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a file to be usable. - var fi os.FileInfo - var err error - if fi, err = os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if fi.IsDir() { - return fmt.Errorf("source path must be a file") - } - - _, err = os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err = os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - // If we're not copying, just symlink and we're done - if !g.Copy { - return os.Symlink(path, dst) - } - - var disableSymlinks bool - - if g.client != nil && g.client.DisableSymlinks { - disableSymlinks = true - } - - // Copy - _, err = copyFile(ctx, dst, path, disableSymlinks, fi.Mode(), g.client.umask()) - return err -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go deleted file mode 100644 index 31146f5753..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_file_windows.go +++ /dev/null @@ -1,130 +0,0 @@ -// +build windows - -package getter - -import ( - "fmt" - "net/url" - "os" - "os/exec" - "path/filepath" - "strings" - "syscall" -) - -func (g *FileGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a directory to be usable. - if fi, err := os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if !fi.IsDir() { - return fmt.Errorf("source path must be a directory") - } - - fi, err := os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - mode := fi.Mode() - if mode&os.ModeSymlink == 0 { - return fmt.Errorf("destination exists and is not a symlink") - } - - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - sourcePath := toBackslash(path) - - // Use mklink to create a junction point - output, err := exec.CommandContext(ctx, "cmd", "/c", "mklink", "/J", dst, sourcePath).CombinedOutput() - if err != nil { - return fmt.Errorf("failed to run mklink %v %v: %v %q", dst, sourcePath, err, output) - } - - return nil -} - -func (g *FileGetter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - path := u.Path - if u.RawPath != "" { - path = u.RawPath - } - - // The source path must exist and be a directory to be usable. - if fi, err := os.Stat(path); err != nil { - return fmt.Errorf("source path error: %s", err) - } else if fi.IsDir() { - return fmt.Errorf("source path must be a file") - } - - _, err := os.Lstat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - // If the destination already exists, it must be a symlink - if err == nil { - // Remove the destination - if err := os.Remove(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - // If we're not copying, just symlink and we're done - if !g.Copy { - if err = os.Symlink(path, dst); err == nil { - return err - } - lerr, ok := err.(*os.LinkError) - if !ok { - return err - } - switch lerr.Err { - case syscall.ERROR_PRIVILEGE_NOT_HELD: - // no symlink privilege, let's - // fallback to a copy to avoid an error. - break - default: - return err - } - } - - var disableSymlinks bool - - if g.client != nil && g.client.DisableSymlinks { - disableSymlinks = true - } - - // Copy - _, err = copyFile(ctx, dst, path, disableSymlinks, 0666, g.client.umask()) - return err -} - -// toBackslash returns the result of replacing each slash character -// in path with a backslash ('\') character. Multiple separators are -// replaced by multiple backslashes. -func toBackslash(path string) string { - return strings.Replace(path, "/", "\\", -1) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go deleted file mode 100644 index abf2f1d4fc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs.go +++ /dev/null @@ -1,220 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "net/url" - "os" - "path/filepath" - "strconv" - "strings" - "time" - - "golang.org/x/oauth2" - "google.golang.org/api/option" - - "cloud.google.com/go/storage" - "google.golang.org/api/iterator" -) - -// GCSGetter is a Getter implementation that will download a module from -// a GCS bucket. -type GCSGetter struct { - getter - - // Timeout sets a deadline which all GCS operations should - // complete within. Zero value means no timeout. - Timeout time.Duration -} - -func (g *GCSGetter) ClientMode(u *url.URL) (ClientMode, error) { - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - // Parse URL - bucket, object, _, err := g.parseURL(u) - if err != nil { - return 0, err - } - - client, err := g.getClient(ctx) - if err != nil { - return 0, err - } - iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) - for { - obj, err := iter.Next() - if err != nil && err != iterator.Done { - return 0, err - } - - if err == iterator.Done { - break - } - if strings.HasSuffix(obj.Name, "/") { - // A directory matched the prefix search, so this must be a directory - return ClientModeDir, nil - } else if obj.Name != object { - // A file matched the prefix search and doesn't have the same name - // as the query, so this must be a directory - return ClientModeDir, nil - } - } - // There are no directories or subdirectories, and if a match was returned, - // it was exactly equal to the prefix search. So return File mode - return ClientModeFile, nil -} - -func (g *GCSGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - // Parse URL - bucket, object, _, err := g.parseURL(u) - if err != nil { - return err - } - - // Remove destination if it already exists - _, err = os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - if err == nil { - // Remove the destination - if err := os.RemoveAll(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - client, err := g.getClient(ctx) - if err != nil { - return err - } - - // Iterate through all matching objects. - iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) - for { - obj, err := iter.Next() - if err != nil && err != iterator.Done { - return err - } - if err == iterator.Done { - break - } - - if !strings.HasSuffix(obj.Name, "/") { - // Get the object destination path - objDst, err := filepath.Rel(object, obj.Name) - if err != nil { - return err - } - objDst = filepath.Join(dst, objDst) - // Download the matching object. - err = g.getObject(ctx, client, objDst, bucket, obj.Name, "") - if err != nil { - return err - } - } - } - return nil -} - -func (g *GCSGetter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - // Parse URL - bucket, object, fragment, err := g.parseURL(u) - if err != nil { - return err - } - - client, err := g.getClient(ctx) - if err != nil { - return err - } - return g.getObject(ctx, client, dst, bucket, object, fragment) -} - -func (g *GCSGetter) getObject(ctx context.Context, client *storage.Client, dst, bucket, object, fragment string) error { - var rc *storage.Reader - var err error - if fragment != "" { - generation, err := strconv.ParseInt(fragment, 10, 64) - if err != nil { - return err - } - rc, err = client.Bucket(bucket).Object(object).Generation(generation).NewReader(ctx) - } else { - rc, err = client.Bucket(bucket).Object(object).NewReader(ctx) - } - if err != nil { - return err - } - defer rc.Close() - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - return copyReader(dst, rc, 0666, g.client.umask()) -} - -func (g *GCSGetter) parseURL(u *url.URL) (bucket, path, fragment string, err error) { - if strings.Contains(u.Host, "googleapis.com") { - hostParts := strings.Split(u.Host, ".") - if len(hostParts) != 3 { - err = fmt.Errorf("URL is not a valid GCS URL") - return - } - - pathParts := strings.SplitN(u.Path, "/", 5) - if len(pathParts) != 5 { - err = fmt.Errorf("URL is not a valid GCS URL") - return - } - bucket = pathParts[3] - path = pathParts[4] - fragment = u.Fragment - } - return -} - -func (g *GCSGetter) getClient(ctx context.Context) (client *storage.Client, err error) { - var opts []option.ClientOption - - if v, ok := os.LookupEnv("GOOGLE_OAUTH_ACCESS_TOKEN"); ok { - tokenSource := oauth2.StaticTokenSource(&oauth2.Token{ - AccessToken: v, - }) - opts = append(opts, option.WithTokenSource(tokenSource)) - } - - newClient, err := storage.NewClient(ctx, opts...) - if err != nil { - return nil, err - } - return newClient, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go deleted file mode 100644 index cdd3e68c93..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_gcs_test.go +++ /dev/null @@ -1,261 +0,0 @@ -package getter - -import ( - "io/ioutil" - "net/url" - "os" - "path/filepath" - "testing" -) - -// initGCPCredentials writes a temporary GCS credentials file if necessary and -// returns the path and a function to clean it up. allAuthenticatedUsers can -// access go-getter-test with read only access. -func initGCPCredentials(t *testing.T) func() { - if gc := os.Getenv("GOOGLE_CREDENTIALS"); gc != "" && - os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") == "" { - file, cleanup := tempFileContents(t, gc) - os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", file) - return func() { - os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", "") - cleanup() - } - } - return func() {} -} - -func TestGCSGetter_impl(t *testing.T) { - var _ Getter = new(GCSGetter) -} - -func TestGCSGetter(t *testing.T) { - defer initGCPCredentials(t)() - - g := new(GCSGetter) - dst := tempDir(t) - - // With a dir that doesn't exist - err := g.Get( - dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGCSGetter_subdir(t *testing.T) { - defer initGCPCredentials(t)() - - g := new(GCSGetter) - dst := tempDir(t) - - // With a dir that doesn't exist - err := g.Get( - dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the sub file exists - subPath := filepath.Join(dst, "sub.tf") - if _, err := os.Stat(subPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGCSGetter_GetFile(t *testing.T) { - defer initGCPCredentials(t)() - - g := new(GCSGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - err := g.GetFile( - dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/main.tf")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - if _, err := os.Stat(dst); err != nil { - t.Fatalf("err: %s", err) - } - assertContents(t, dst, "# Main\n") -} - -func TestGCSGetter_GetGenerationFile(t *testing.T) { - defer initGCPCredentials(t)() - - g := new(GCSGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - err := g.GetFile( - dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/versioned.txt#1615905097179533")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify contents are valid for this generation - content, err := ioutil.ReadFile(dst) - if err != nil { - t.Fatalf("err: %s", err) - } - if string(content) != "a\n" { - t.Fatalf("expected file contents from generation to be `a` but got `%s`", content) - } - - // Download - err = g.GetFile( - dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/versioned.txt#1615905174141919")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify contents are valid for this generation - content, err = ioutil.ReadFile(dst) - if err != nil { - t.Fatalf("err: %s", err) - } - if string(content) != "b\n" { - t.Fatalf("expected file contents from generation to be `b` but got `%s`", content) - } - -} - -func TestGCSGetter_GetFile_notfound(t *testing.T) { - g := new(GCSGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - err := g.GetFile( - dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/404.tf")) - if err == nil { - t.Fatalf("expected error, got none") - } -} - -func TestGCSGetter_ClientMode_dir(t *testing.T) { - defer initGCPCredentials(t)() - - g := new(GCSGetter) - - // Check client mode on a key prefix with only a single key. - mode, err := g.ClientMode( - testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeDir { - t.Fatal("expect ClientModeDir") - } -} - -func TestGCSGetter_ClientMode_file(t *testing.T) { - defer initGCPCredentials(t)() - - g := new(GCSGetter) - - // Check client mode on a key prefix which contains sub-keys. - mode, err := g.ClientMode( - testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/subfolder/sub.tf")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeFile { - t.Fatal("expect ClientModeFile") - } -} - -func TestGCSGetter_ClientMode_notfound(t *testing.T) { - defer initGCPCredentials(t)() - - g := new(GCSGetter) - - // Check the client mode when a non-existent key is looked up. This does not - // return an error, but rather should just return the file mode. - mode, err := g.ClientMode( - testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/foobar")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeFile { - t.Fatal("expect ClientModeFile") - } -} - -func TestGCSGetter_Url(t *testing.T) { - defer initGCPCredentials(t)() - - var gcstests = []struct { - name string - url string - bucket string - path string - }{ - { - name: "test1", - url: "gcs::https://www.googleapis.com/storage/v1/go-getter-test/go-getter/foo/null.zip", - bucket: "go-getter-test", - path: "go-getter/foo/null.zip", - }, - } - - for i, pt := range gcstests { - t.Run(pt.name, func(t *testing.T) { - g := new(GCSGetter) - forced, src := getForcedGetter(pt.url) - u, err := url.Parse(src) - - if err != nil { - t.Errorf("test %d: unexpected error: %s", i, err) - } - if forced != "gcs" { - t.Fatalf("expected forced protocol to be gcs") - } - - bucket, path, _, err := g.parseURL(u) - - if err != nil { - t.Fatalf("err: %s", err) - } - - if bucket != pt.bucket { - t.Fatalf("expected %s, got %s", pt.bucket, bucket) - } - if path != pt.path { - t.Fatalf("expected %s, got %s", pt.path, path) - } - }) - } -} - -func TestGCSGetter_GetFile_OAuthAccessToken(t *testing.T) { - if os.Getenv("GOOGLE_OAUTH_ACCESS_TOKEN") == "" { - t.Skip("Skipping; set GOOGLE_OAUTH_ACCESS_TOKEN to run") - } - g := new(GCSGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - err := g.GetFile( - dst, testURL("https://www.googleapis.com/storage/v1/go-getter-test/go-getter/folder/main.tf")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - if _, err := os.Stat(dst); err != nil { - t.Fatalf("err: %s", err) - } - assertContents(t, dst, "# Main\n") -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_git.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_git.go deleted file mode 100644 index db89edef8b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_git.go +++ /dev/null @@ -1,376 +0,0 @@ -package getter - -import ( - "bytes" - "context" - "encoding/base64" - "fmt" - "io/ioutil" - "net/url" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strconv" - "strings" - "time" - - urlhelper "github.com/hashicorp/go-getter/helper/url" - safetemp "github.com/hashicorp/go-safetemp" - version "github.com/hashicorp/go-version" -) - -// GitGetter is a Getter implementation that will download a module from -// a git repository. -type GitGetter struct { - getter - - // Timeout sets a deadline which all git CLI operations should - // complete within. Zero value means no timeout. - Timeout time.Duration -} - -var defaultBranchRegexp = regexp.MustCompile(`\s->\sorigin/(.*)`) -var lsRemoteSymRefRegexp = regexp.MustCompile(`ref: refs/heads/([^\s]+).*`) - -func (g *GitGetter) ClientMode(_ *url.URL) (ClientMode, error) { - return ClientModeDir, nil -} - -func (g *GitGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - if _, err := exec.LookPath("git"); err != nil { - return fmt.Errorf("git must be available and on the PATH") - } - - // The port number must be parseable as an integer. If not, the user - // was probably trying to use a scp-style address, in which case the - // ssh:// prefix must be removed to indicate that. - // - // This is not necessary in versions of Go which have patched - // CVE-2019-14809 (e.g. Go 1.12.8+) - if portStr := u.Port(); portStr != "" { - if _, err := strconv.ParseUint(portStr, 10, 16); err != nil { - return fmt.Errorf("invalid port number %q; if using the \"scp-like\" git address scheme where a colon introduces the path instead, remove the ssh:// portion and use just the git:: prefix", portStr) - } - } - - // Extract some query parameters we use - var ref, sshKey string - depth := 0 // 0 means "don't use shallow clone" - q := u.Query() - if len(q) > 0 { - ref = q.Get("ref") - q.Del("ref") - - sshKey = q.Get("sshkey") - q.Del("sshkey") - - if n, err := strconv.Atoi(q.Get("depth")); err == nil { - depth = n - } - q.Del("depth") - - // Copy the URL - var newU url.URL = *u - u = &newU - u.RawQuery = q.Encode() - } - - var sshKeyFile string - if sshKey != "" { - // Check that the git version is sufficiently new. - if err := checkGitVersion(ctx, "2.3"); err != nil { - return fmt.Errorf("Error using ssh key: %v", err) - } - - // We have an SSH key - decode it. - raw, err := base64.StdEncoding.DecodeString(sshKey) - if err != nil { - return err - } - - // Create a temp file for the key and ensure it is removed. - fh, err := ioutil.TempFile("", "go-getter") - if err != nil { - return err - } - sshKeyFile = fh.Name() - defer os.Remove(sshKeyFile) - - // Set the permissions prior to writing the key material. - if err := os.Chmod(sshKeyFile, 0600); err != nil { - return err - } - - // Write the raw key into the temp file. - _, err = fh.Write(raw) - fh.Close() - if err != nil { - return err - } - } - - // Clone or update the repository - _, err := os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - if err == nil { - err = g.update(ctx, dst, sshKeyFile, ref, depth) - } else { - err = g.clone(ctx, dst, sshKeyFile, u, ref, depth) - } - if err != nil { - return err - } - - // Next: check out the proper tag/branch if it is specified, and checkout - if ref != "" { - if err := g.checkout(ctx, dst, ref); err != nil { - return err - } - } - - // Lastly, download any/all submodules. - return g.fetchSubmodules(ctx, dst, sshKeyFile, depth) -} - -// GetFile for Git doesn't support updating at this time. It will download -// the file every time. -func (g *GitGetter) GetFile(dst string, u *url.URL) error { - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - // Get the filename, and strip the filename from the URL so we can - // just get the repository directly. - filename := filepath.Base(u.Path) - u.Path = filepath.Dir(u.Path) - - // Get the full repository - if err := g.Get(td, u); err != nil { - return err - } - - // Copy the single file - u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) - if err != nil { - return err - } - - fg := &FileGetter{Copy: true} - return fg.GetFile(dst, u) -} - -func (g *GitGetter) checkout(ctx context.Context, dst string, ref string) error { - cmd := exec.CommandContext(ctx, "git", "checkout", ref) - cmd.Dir = dst - return getRunCommand(cmd) -} - -// gitCommitIDRegex is a pattern intended to match strings that seem -// "likely to be" git commit IDs, rather than named refs. This cannot be -// an exact decision because it's valid to name a branch or tag after a series -// of hexadecimal digits too. -// -// We require at least 7 digits here because that's the smallest size git -// itself will typically generate, and so it'll reduce the risk of false -// positives on short branch names that happen to also be "hex words". -var gitCommitIDRegex = regexp.MustCompile("^[0-9a-fA-F]{7,40}$") - -func (g *GitGetter) clone(ctx context.Context, dst, sshKeyFile string, u *url.URL, ref string, depth int) error { - args := []string{"clone"} - - originalRef := ref // we handle an unspecified ref differently than explicitly selecting the default branch below - if ref == "" { - ref = findRemoteDefaultBranch(ctx, u) - } - if depth > 0 { - args = append(args, "--depth", strconv.Itoa(depth)) - args = append(args, "--branch", ref) - } - args = append(args, u.String(), dst) - - cmd := exec.CommandContext(ctx, "git", args...) - setupGitEnv(cmd, sshKeyFile) - err := getRunCommand(cmd) - if err != nil { - if depth > 0 && originalRef != "" { - // If we're creating a shallow clone then the given ref must be - // a named ref (branch or tag) rather than a commit directly. - // We can't accurately recognize the resulting error here without - // hard-coding assumptions about git's human-readable output, but - // we can at least try a heuristic. - if gitCommitIDRegex.MatchString(originalRef) { - return fmt.Errorf("%w (note that setting 'depth' requires 'ref' to be a branch or tag name)", err) - } - } - return err - } - - if depth < 1 && originalRef != "" { - // If we didn't add --depth and --branch above then we will now be - // on the remote repository's default branch, rather than the selected - // ref, so we'll need to fix that before we return. - return g.checkout(ctx, dst, originalRef) - } - return nil -} - -func (g *GitGetter) update(ctx context.Context, dst, sshKeyFile, ref string, depth int) error { - // Determine if we're a branch. If we're NOT a branch, then we just - // switch to master prior to checking out - cmd := exec.CommandContext(ctx, "git", "show-ref", "-q", "--verify", "refs/heads/"+ref) - cmd.Dir = dst - - if getRunCommand(cmd) != nil { - // Not a branch, switch to default branch. This will also catch - // non-existent branches, in which case we want to switch to default - // and then checkout the proper branch later. - ref = findDefaultBranch(ctx, dst) - } - - // We have to be on a branch to pull - if err := g.checkout(ctx, dst, ref); err != nil { - return err - } - - if depth > 0 { - cmd = exec.CommandContext(ctx, "git", "pull", "--depth", strconv.Itoa(depth), "--ff-only") - } else { - cmd = exec.CommandContext(ctx, "git", "pull", "--ff-only") - } - - cmd.Dir = dst - setupGitEnv(cmd, sshKeyFile) - return getRunCommand(cmd) -} - -// fetchSubmodules downloads any configured submodules recursively. -func (g *GitGetter) fetchSubmodules(ctx context.Context, dst, sshKeyFile string, depth int) error { - args := []string{"submodule", "update", "--init", "--recursive"} - if depth > 0 { - args = append(args, "--depth", strconv.Itoa(depth)) - } - cmd := exec.CommandContext(ctx, "git", args...) - cmd.Dir = dst - setupGitEnv(cmd, sshKeyFile) - return getRunCommand(cmd) -} - -// findDefaultBranch checks the repo's origin remote for its default branch -// (generally "master"). "master" is returned if an origin default branch -// can't be determined. -func findDefaultBranch(ctx context.Context, dst string) string { - var stdoutbuf bytes.Buffer - cmd := exec.CommandContext(ctx, "git", "branch", "-r", "--points-at", "refs/remotes/origin/HEAD") - cmd.Dir = dst - cmd.Stdout = &stdoutbuf - err := cmd.Run() - matches := defaultBranchRegexp.FindStringSubmatch(stdoutbuf.String()) - if err != nil || matches == nil { - return "master" - } - return matches[len(matches)-1] -} - -// findRemoteDefaultBranch checks the remote repo's HEAD symref to return the remote repo's -// default branch. "master" is returned if no HEAD symref exists. -func findRemoteDefaultBranch(ctx context.Context, u *url.URL) string { - var stdoutbuf bytes.Buffer - cmd := exec.CommandContext(ctx, "git", "ls-remote", "--symref", u.String(), "HEAD") - cmd.Stdout = &stdoutbuf - err := cmd.Run() - matches := lsRemoteSymRefRegexp.FindStringSubmatch(stdoutbuf.String()) - if err != nil || matches == nil { - return "master" - } - return matches[len(matches)-1] -} - -// setupGitEnv sets up the environment for the given command. This is used to -// pass configuration data to git and ssh and enables advanced cloning methods. -func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) { - const gitSSHCommand = "GIT_SSH_COMMAND=" - var sshCmd []string - - // If we have an existing GIT_SSH_COMMAND, we need to append our options. - // We will also remove our old entry to make sure the behavior is the same - // with versions of Go < 1.9. - env := os.Environ() - for i, v := range env { - if strings.HasPrefix(v, gitSSHCommand) && len(v) > len(gitSSHCommand) { - sshCmd = []string{v} - - env[i], env[len(env)-1] = env[len(env)-1], env[i] - env = env[:len(env)-1] - break - } - } - - if len(sshCmd) == 0 { - sshCmd = []string{gitSSHCommand + "ssh"} - } - - if sshKeyFile != "" { - // We have an SSH key temp file configured, tell ssh about this. - if runtime.GOOS == "windows" { - sshKeyFile = strings.Replace(sshKeyFile, `\`, `/`, -1) - } - sshCmd = append(sshCmd, "-i", sshKeyFile) - } - - env = append(env, strings.Join(sshCmd, " ")) - cmd.Env = env -} - -// checkGitVersion is used to check the version of git installed on the system -// against a known minimum version. Returns an error if the installed version -// is older than the given minimum. -func checkGitVersion(ctx context.Context, min string) error { - want, err := version.NewVersion(min) - if err != nil { - return err - } - - out, err := exec.CommandContext(ctx, "git", "version").Output() - if err != nil { - return err - } - - fields := strings.Fields(string(out)) - if len(fields) < 3 { - return fmt.Errorf("Unexpected 'git version' output: %q", string(out)) - } - v := fields[2] - if runtime.GOOS == "windows" && strings.Contains(v, ".windows.") { - // on windows, git version will return for example: - // git version 2.20.1.windows.1 - // Which does not follow the semantic versionning specs - // https://semver.org. We remove that part in order for - // go-version to not error. - v = v[:strings.Index(v, ".windows.")] - } - - have, err := version.NewVersion(v) - if err != nil { - return err - } - - if have.LessThan(want) { - return fmt.Errorf("Required git version = %s, have %s", want, have) - } - - return nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go deleted file mode 100644 index df6ad03906..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_git_test.go +++ /dev/null @@ -1,913 +0,0 @@ -package getter - -import ( - "bytes" - "context" - "encoding/base64" - "errors" - "fmt" - "io/ioutil" - "net/url" - "os" - "os/exec" - "path/filepath" - "runtime" - "strings" - "testing" - - urlhelper "github.com/hashicorp/go-getter/helper/url" -) - -var testHasGit bool - -func init() { - if _, err := exec.LookPath("git"); err == nil { - testHasGit = true - } -} - -func TestGitGetter_impl(t *testing.T) { - var _ Getter = new(GitGetter) -} - -func TestGitGetter(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "basic") - repo.commitFile("foo.txt", "hello") - - // With a dir that doesn't exist - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "foo.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_branch(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "branch") - repo.git("checkout", "-b", "test-branch") - repo.commitFile("branch.txt", "branch") - - q := repo.url.Query() - q.Add("ref", "test-branch") - repo.url.RawQuery = q.Encode() - - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "branch.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - - // Get again should work - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath = filepath.Join(dst, "branch.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_commitID(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - // We're going to create different content on the main branch vs. - // another branch here, so that below we can recognize if we - // correctly cloned the commit actually requested (from the - // "other branch"), not the one at HEAD. - repo := testGitRepo(t, "commit_id") - repo.git("checkout", "-b", "main-branch") - repo.commitFile("wrong.txt", "Nope") - repo.git("checkout", "-b", "other-branch") - repo.commitFile("hello.txt", "Yep") - commitID, err := repo.latestCommit() - if err != nil { - t.Fatal(err) - } - // Return to the main branch so that HEAD of this repository - // will be that, rather than "test-branch". - repo.git("checkout", "main-branch") - - q := repo.url.Query() - q.Add("ref", commitID) - repo.url.RawQuery = q.Encode() - - t.Logf("Getting %s", repo.url) - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "hello.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - - // Get again should work - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath = filepath.Join(dst, "hello.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_remoteWithoutMaster(t *testing.T) { - if !testHasGit { - t.Log("git not found, skipping") - t.Skip() - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "branch") - repo.git("checkout", "-b", "test-branch") - repo.commitFile("branch.txt", "branch") - - q := repo.url.Query() - repo.url.RawQuery = q.Encode() - - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "branch.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - - // Get again should work - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath = filepath.Join(dst, "branch.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_shallowClone(t *testing.T) { - if !testHasGit { - t.Log("git not found, skipping") - t.Skip() - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "upstream") - repo.commitFile("upstream.txt", "0") - repo.commitFile("upstream.txt", "1") - - // Specifiy a clone depth of 1 - q := repo.url.Query() - q.Add("depth", "1") - repo.url.RawQuery = q.Encode() - - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Assert rev-list count is '1' - cmd := exec.Command("git", "rev-list", "HEAD", "--count") - cmd.Dir = dst - b, err := cmd.Output() - if err != nil { - t.Fatalf("err: %s", err) - } - - out := strings.TrimSpace(string(b)) - if out != "1" { - t.Fatalf("expected rev-list count to be '1' but got %v", out) - } -} - -func TestGitGetter_shallowCloneWithTag(t *testing.T) { - if !testHasGit { - t.Log("git not found, skipping") - t.Skip() - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "upstream") - repo.commitFile("v1.0.txt", "0") - repo.git("tag", "v1.0") - repo.commitFile("v1.1.txt", "1") - - // Specifiy a clone depth of 1 with a tag - q := repo.url.Query() - q.Add("ref", "v1.0") - q.Add("depth", "1") - repo.url.RawQuery = q.Encode() - - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Assert rev-list count is '1' - cmd := exec.Command("git", "rev-list", "HEAD", "--count") - cmd.Dir = dst - b, err := cmd.Output() - if err != nil { - t.Fatalf("err: %s", err) - } - - out := strings.TrimSpace(string(b)) - if out != "1" { - t.Fatalf("expected rev-list count to be '1' but got %v", out) - } - - // Verify the v1.0 file exists - mainPath := filepath.Join(dst, "v1.0.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the v1.1 file does not exists - mainPath = filepath.Join(dst, "v1.1.txt") - if _, err := os.Stat(mainPath); err == nil { - t.Fatalf("expected v1.1 file to not exist") - } -} - -func TestGitGetter_shallowCloneWithCommitID(t *testing.T) { - if !testHasGit { - t.Log("git not found, skipping") - t.Skip() - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "upstream") - repo.commitFile("v1.0.txt", "0") - repo.git("tag", "v1.0") - repo.commitFile("v1.1.txt", "1") - - commitID, err := repo.latestCommit() - if err != nil { - t.Fatal(err) - } - - // Specify a clone depth of 1 with a naked commit ID - // This is intentionally invalid: shallow clone always requires a named ref. - q := repo.url.Query() - q.Add("ref", commitID[:8]) - q.Add("depth", "1") - repo.url.RawQuery = q.Encode() - - t.Logf("Getting %s", repo.url) - err = g.Get(dst, repo.url) - if err == nil { - t.Fatalf("success; want error") - } - // We use a heuristic to generate an extra hint in the error message if - // it looks like the user was trying to combine ref=COMMIT with depth. - if got, want := err.Error(), "(note that setting 'depth' requires 'ref' to be a branch or tag name)"; !strings.Contains(got, want) { - t.Errorf("missing error message hint\ngot: %s\nwant substring: %s", got, want) - } -} - -func TestGitGetter_branchUpdate(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - // First setup the state with a fresh branch - repo := testGitRepo(t, "branch-update") - repo.git("checkout", "-b", "test-branch") - repo.commitFile("branch.txt", "branch") - - // Get the "test-branch" branch - q := repo.url.Query() - q.Add("ref", "test-branch") - repo.url.RawQuery = q.Encode() - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "branch.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - - // Commit an update to the branch - repo.commitFile("branch-update.txt", "branch-update") - - // Get again should work - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath = filepath.Join(dst, "branch-update.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_tag(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "tag") - repo.commitFile("tag.txt", "tag") - repo.git("tag", "v1.0") - - q := repo.url.Query() - q.Add("ref", "v1.0") - repo.url.RawQuery = q.Encode() - - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "tag.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - - // Get again should work - if err := g.Get(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath = filepath.Join(dst, "tag.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_GetFile(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - repo := testGitRepo(t, "file") - repo.commitFile("file.txt", "hello") - - // Download the file - repo.url.Path = filepath.Join(repo.url.Path, "file.txt") - if err := g.GetFile(dst, repo.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - if _, err := os.Stat(dst); err != nil { - t.Fatalf("err: %s", err) - } - assertContents(t, dst, "hello") -} - -func TestGitGetter_gitVersion(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - if runtime.GOOS == "windows" { - t.Skip("skipping on windows since the test requires sh") - } - dir, err := ioutil.TempDir("", "go-getter") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(dir) - - script := filepath.Join(dir, "git") - err = ioutil.WriteFile( - script, - []byte("#!/bin/sh\necho \"git version 2.0 (Some Metadata Here)\n\""), - 0700) - if err != nil { - t.Fatal(err) - } - - defer func(v string) { - os.Setenv("PATH", v) - }(os.Getenv("PATH")) - - os.Setenv("PATH", dir) - - // Asking for a higher version throws an error - if err := checkGitVersion(context.Background(), "2.3"); err == nil { - t.Fatal("expect git version error") - } - - // Passes when version is satisfied - if err := checkGitVersion(context.Background(), "1.9"); err != nil { - t.Fatal(err) - } -} - -func TestGitGetter_sshKey(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) - - // avoid getting locked by a github authenticity validation prompt - os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") - defer os.Setenv("GIT_SSH_COMMAND", "") - - u, err := urlhelper.Parse("ssh://git@github.com/hashicorp/test-private-repo" + - "?sshkey=" + encodedKey) - if err != nil { - t.Fatal(err) - } - - if err := g.Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - readmePath := filepath.Join(dst, "README.md") - if _, err := os.Stat(readmePath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_sshSCPStyle(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) - - // avoid getting locked by a github authenticity validation prompt - os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") - defer os.Setenv("GIT_SSH_COMMAND", "") - - // This test exercises the combination of the git detector and the - // git getter, to make sure that together they make scp-style URLs work. - client := &Client{ - Src: "git@github.com:hashicorp/test-private-repo?sshkey=" + encodedKey, - Dst: dst, - Pwd: ".", - - Mode: ClientModeDir, - - Detectors: []Detector{ - new(GitDetector), - }, - Getters: map[string]Getter{ - "git": g, - }, - } - - if err := client.Get(); err != nil { - t.Fatalf("client.Get failed: %s", err) - } - - readmePath := filepath.Join(dst, "README.md") - if _, err := os.Stat(readmePath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_sshExplicitPort(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) - - // avoid getting locked by a github authenticity validation prompt - os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") - defer os.Setenv("GIT_SSH_COMMAND", "") - - // This test exercises the combination of the git detector and the - // git getter, to make sure that together they make scp-style URLs work. - client := &Client{ - Src: "git::ssh://git@github.com:22/hashicorp/test-private-repo?sshkey=" + encodedKey, - Dst: dst, - Pwd: ".", - - Mode: ClientModeDir, - - Detectors: []Detector{ - new(GitDetector), - }, - Getters: map[string]Getter{ - "git": g, - }, - } - - if err := client.Get(); err != nil { - t.Fatalf("client.Get failed: %s", err) - } - - readmePath := filepath.Join(dst, "README.md") - if _, err := os.Stat(readmePath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGitGetter_sshSCPStyleInvalidScheme(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - encodedKey := base64.StdEncoding.EncodeToString([]byte(testGitToken)) - - // avoid getting locked by a github authenticity validation prompt - os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") - defer os.Setenv("GIT_SSH_COMMAND", "") - - // This test exercises the combination of the git detector and the - // git getter, to make sure that together they make scp-style URLs work. - client := &Client{ - Src: "git::ssh://git@github.com:hashicorp/test-private-repo?sshkey=" + encodedKey, - Dst: dst, - Pwd: ".", - - Mode: ClientModeDir, - - Detectors: []Detector{ - new(GitDetector), - }, - Getters: map[string]Getter{ - "git": g, - }, - } - - err := client.Get() - if err == nil { - t.Fatalf("get succeeded; want error") - } - - got := err.Error() - want1, want2 := `invalid source string`, `invalid port number "hashicorp"` - if !(strings.Contains(got, want1) || strings.Contains(got, want2)) { - t.Fatalf("wrong error\ngot: %s\nwant: %q or %q", got, want1, want2) - } -} - -func TestGitGetter_submodule(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - relpath := func(basepath, targpath string) string { - relpath, err := filepath.Rel(basepath, targpath) - if err != nil { - t.Fatal(err) - } - return strings.Replace(relpath, `\`, `/`, -1) - // on windows git still prefers relatives paths - // containing `/` for submodules - } - - // Set up the grandchild - gc := testGitRepo(t, "grandchild") - gc.commitFile("grandchild.txt", "grandchild") - - // Set up the child - c := testGitRepo(t, "child") - c.commitFile("child.txt", "child") - c.git("submodule", "add", "-f", relpath(c.dir, gc.dir)) - c.git("commit", "-m", "Add grandchild submodule") - - // Set up the parent - p := testGitRepo(t, "parent") - p.commitFile("parent.txt", "parent") - p.git("submodule", "add", "-f", relpath(p.dir, c.dir)) - p.git("commit", "-m", "Add child submodule") - - // Clone the root repository - if err := g.Get(dst, p.url); err != nil { - t.Fatalf("err: %s", err) - } - - // Check that the files exist - for _, path := range []string{ - filepath.Join(dst, "parent.txt"), - filepath.Join(dst, "child", "child.txt"), - filepath.Join(dst, "child", "grandchild", "grandchild.txt"), - } { - if _, err := os.Stat(path); err != nil { - t.Fatalf("err: %s", err) - } - } -} - -func TestGitGetter_setupGitEnv_sshKey(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skip("skipping on windows since the test requires sh") - } - - cmd := exec.Command("/bin/sh", "-c", "echo $GIT_SSH_COMMAND") - setupGitEnv(cmd, "/tmp/foo.pem") - out, err := cmd.Output() - if err != nil { - t.Fatal(err) - } - - actual := strings.TrimSpace(string(out)) - if actual != "ssh -i /tmp/foo.pem" { - t.Fatalf("unexpected GIT_SSH_COMMAND: %q", actual) - } -} - -func TestGitGetter_setupGitEnvWithExisting_sshKey(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skipf("skipping on windows since the test requires sh") - return - } - - // start with an existing ssh command configuration - os.Setenv("GIT_SSH_COMMAND", "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes") - defer os.Setenv("GIT_SSH_COMMAND", "") - - cmd := exec.Command("/bin/sh", "-c", "echo $GIT_SSH_COMMAND") - setupGitEnv(cmd, "/tmp/foo.pem") - out, err := cmd.Output() - if err != nil { - t.Fatal(err) - } - - actual := strings.TrimSpace(string(out)) - if actual != "ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /tmp/foo.pem" { - t.Fatalf("unexpected GIT_SSH_COMMAND: %q", actual) - } -} - -func TestGitGetter_subdirectory_symlink(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - target, err := ioutil.TempFile("", "link-target") - if err != nil { - t.Fatal(err) - } - defer os.Remove(target.Name()) - - repo := testGitRepo(t, "repo-with-symlink") - innerDir := filepath.Join(repo.dir, "this-directory-contains-a-symlink") - if err := os.Mkdir(innerDir, 0700); err != nil { - t.Fatal(err) - } - path := filepath.Join(innerDir, "this-is-a-symlink") - if err := os.Symlink(target.Name(), path); err != nil { - t.Fatal(err) - } - - repo.git("add", path) - repo.git("commit", "-m", "Adding "+path) - - u, err := url.Parse(fmt.Sprintf("git::%s//this-directory-contains-a-symlink", repo.url.String())) - if err != nil { - t.Fatal(err) - } - - client := &Client{ - Src: u.String(), - Dst: dst, - Pwd: ".", - Mode: ClientModeDir, - DisableSymlinks: true, - Detectors: []Detector{ - new(GitDetector), - }, - Getters: map[string]Getter{ - "git": g, - }, - } - - err = client.Get() - - if runtime.GOOS == "windows" { - // Windows doesn't handle symlinks as one might expect with git. - // - // https://github.com/git-for-windows/git/wiki/Symbolic-Links - filepath.Walk(dst, func(path string, info os.FileInfo, err error) error { - if strings.Contains(path, "this-is-a-symlink") { - if info.Mode()&os.ModeSymlink == os.ModeSymlink { - // If you see this test fail in the future, you've probably enabled - // symlinks within git on your Windows system. Our CI/CD system does - // not do this, so this is this is the only way we can make this test - // make any sense. - t.Fatalf("windows git should not have cloned a symlink") - } - } - return nil - }) - } else { - // We can rely on POSIX compliant systems running git to do the right thing. - if err == nil { - t.Fatalf("expected client get to fail") - } - if !errors.Is(err, ErrSymlinkCopy) { - t.Fatalf("unexpected error: %v", err) - } - } - -} - -func TestGitGetter_subdirectory(t *testing.T) { - if !testHasGit { - t.Skip("git not found, skipping") - } - - g := new(GitGetter) - dst := tempDir(t) - - repo := testGitRepo(t, "empty-repo") - u, err := url.Parse(fmt.Sprintf("git::%s//../../../../../../etc/passwd", repo.url.String())) - if err != nil { - t.Fatal(err) - } - - client := &Client{ - Src: u.String(), - Dst: dst, - Pwd: ".", - - Mode: ClientModeDir, - - Detectors: []Detector{ - new(GitDetector), - }, - Getters: map[string]Getter{ - "git": g, - }, - } - - err = client.Get() - if err == nil { - t.Fatalf("expected client get to fail") - } - if !strings.Contains(err.Error(), "subdirectory component contain path traversal out of the repository") { - t.Fatalf("unexpected error: %v", err) - } -} - -// gitRepo is a helper struct which controls a single temp git repo. -type gitRepo struct { - t *testing.T - url *url.URL - dir string -} - -// testGitRepo creates a new test git repository. -func testGitRepo(t *testing.T, name string) *gitRepo { - dir, err := ioutil.TempDir("", "go-getter") - if err != nil { - t.Fatal(err) - } - dir = filepath.Join(dir, name) - if err := os.Mkdir(dir, 0700); err != nil { - t.Fatal(err) - } - - r := &gitRepo{ - t: t, - dir: dir, - } - - url, err := urlhelper.Parse("file://" + r.dir) - if err != nil { - t.Fatal(err) - } - r.url = url - - t.Logf("initializing git repo in %s", dir) - r.git("init") - r.git("config", "user.name", "go-getter") - r.git("config", "user.email", "go-getter@hashicorp.com") - - return r -} - -// git runs a git command against the repo. -func (r *gitRepo) git(args ...string) { - cmd := exec.Command("git", args...) - cmd.Dir = r.dir - bfr := bytes.NewBuffer(nil) - cmd.Stderr = bfr - if err := cmd.Run(); err != nil { - r.t.Fatal(err, bfr.String()) - } -} - -// commitFile writes and commits a text file to the repo. -func (r *gitRepo) commitFile(file, content string) { - path := filepath.Join(r.dir, file) - if err := ioutil.WriteFile(path, []byte(content), 0600); err != nil { - r.t.Fatal(err) - } - r.git("add", file) - r.git("commit", "-m", "Adding "+file) -} - -// latestCommit returns the full commit id of the latest commit on the current -// branch. -func (r *gitRepo) latestCommit() (string, error) { - cmd := exec.Command("git", "rev-parse", "HEAD") - cmd.Dir = r.dir - rawOut, err := cmd.Output() - if err != nil { - return "", err - } - rawOut = bytes.TrimSpace(rawOut) - return string(rawOut), nil -} - -// This is a read-only deploy key for an empty test repository. -// Note: This is split over multiple lines to avoid being disabled by key -// scanners automatically. -var testGitToken = `-----BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEA9cHsxCl3Jjgu9DHpwvmfFOl1XEdY+ShHDR/cMnzJ5ddk5/oV -Wy6EWatvyHZfRSZMwzv4PtKeUPm6iXjqWp4xdWU9khlPzozyj+U9Fq70TRVUW9E5 -T1XdQVwJE421yffr4VMMwu60wBqjI1epapH2i2inYvw9Zl9X2MXq0+jTvFvDerbT -mDtfStDPljenELAIZtWVETSvbI46gALwbxbM2292ZUIL4D6jRz0aZMmyy/twYv8r -9WGJLwmYzU518Ie7zqKW/mCTdTrV0WRiDj0MeRaPgrGY9amuHE4r9iG/cJkwpKAO -Ccz0Hs6i89u9vZnTqZU9V7weJqRAQcMjXXR6yQIDAQABAoIBAQDBzICKnGxiTlHw -rd+6qqChnAy5jWYDbZjCJ8q8YZ3RS08+g/8NXZxvHftTqM0uOaq1FviHig3gq15H -hHvCpBc6jXDFYoKFzq6FfO/0kFkE5HoWweIgxwRow0xBCDJAJ+ryUEyy+Ay/pQHb -IAjwilRS0V+WdnVw4mTjBAhPvb4jPOo97Yfy3PYUyx2F3newkqXOZy+zx3G/ANoa -ncypfMGyy76sfCWKqw4J1gVkVQLwbB6gQkXUFGYwY9sRrxbG93kQw76Flc/E/s52 -62j4v1IM0fq0t/St+Y/+s6Lkw` + `aqt3ft1nsqWcRaVDdqvMfkzgJGXlw0bGzJG5MEQ -AIBq3dHRAoGBAP8OeG/DKG2Z1VmSfzuz1pas1fbZ+F7venOBrjez3sKlb3Pyl2aH -mt2wjaTUi5v10VrHgYtOEdqyhQeUSYydWXIBKNMag0NLLrfFUKZK+57wrHWFdFjn -VgpsdkLSNTOZpC8gA5OaJ+36IcOPfGqyyP9wuuRoaYnVT1KEzqLa9FEFAoGBAPaq -pglwhil2rxjJE4zq0afQLNpAfi7Xqcrepij+xvJIcIj7nawxXuPxqRFxONE/h3yX -zkybO8wLdbHX9Iw/wc1j50Uf1Z5gHdLf7/hQJoWKpz1RnkWRy6CYON8v1tpVp0tb -OAajR/kZnzebq2mfa7pyy5zDCX++2kp/dcFwHf31AoGAE8oupBVTZLWj7TBFuP8q -LkS40U92Sv9v09iDCQVmylmFvUxcXPM2m+7f/qMTNgWrucxzC7kB/6MMWVszHbrz -vrnCTibnemgx9sZTjKOSxHFOIEw7i85fSa3Cu0qOIDPSnmlwfZpfcMKQrhjLAYhf -uhooFiLX1X78iZ2OXup4PHUCgYEAsmBrm83sp1V1gAYBBlnVbXakyNv0pCk/Vz61 -iFXeRt1NzDGxLxGw3kQnED8BaIh5kQcyn8Fud7sdzJMv/LAqlT4Ww60mzNYTGyjo -H3jOsqm3ESfRvduWFreeAQBWbiOczGjV1i8D4EbAFfWT+tjXjchwKBf+6Yt5zn/o -Bw/uEHUCgYAFs+JPOR25oRyBs7ujrMo/OY1z/eXTVVgZxY+tYGe1FJqDeFyR7ytK -+JBB1MuDwQKGm2wSIXdCzTNoIx2B9zTseiPTwT8G7vqNFhXoIaTBp4P2xIQb45mJ -7GkTsMBHwpSMOXgX9Weq3v5xOJ2WxVtjENmd6qzxcYCO5lP15O17hA== ------END RSA PRIVATE KEY-----` diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go deleted file mode 100644 index afa3bde818..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_hg.go +++ /dev/null @@ -1,147 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "net/url" - "os" - "os/exec" - "path/filepath" - "runtime" - "time" - - urlhelper "github.com/hashicorp/go-getter/helper/url" - safetemp "github.com/hashicorp/go-safetemp" -) - -// HgGetter is a Getter implementation that will download a module from -// a Mercurial repository. -type HgGetter struct { - getter - - // Timeout sets a deadline which all hg CLI operations should - // complete within. Zero value means no timeout. - Timeout time.Duration -} - -func (g *HgGetter) ClientMode(_ *url.URL) (ClientMode, error) { - return ClientModeDir, nil -} - -func (g *HgGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - if _, err := exec.LookPath("hg"); err != nil { - return fmt.Errorf("hg must be available and on the PATH") - } - - newURL, err := urlhelper.Parse(u.String()) - if err != nil { - return err - } - if fixWindowsDrivePath(newURL) { - // See valid file path form on http://www.selenic.com/hg/help/urls - newURL.Path = fmt.Sprintf("/%s", newURL.Path) - } - - // Extract some query parameters we use - var rev string - q := newURL.Query() - if len(q) > 0 { - rev = q.Get("rev") - q.Del("rev") - - newURL.RawQuery = q.Encode() - } - - _, err = os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - if err != nil { - if err := g.clone(ctx, dst, newURL); err != nil { - return err - } - } - - if err := g.pull(ctx, dst, newURL); err != nil { - return err - } - - return g.update(ctx, dst, newURL, rev) -} - -// GetFile for Hg doesn't support updating at this time. It will download -// the file every time. -func (g *HgGetter) GetFile(dst string, u *url.URL) error { - // Create a temporary directory to store the full source. This has to be - // a non-existent directory. - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - // Get the filename, and strip the filename from the URL so we can - // just get the repository directly. - filename := filepath.Base(u.Path) - u.Path = filepath.ToSlash(filepath.Dir(u.Path)) - - // If we're on Windows, we need to set the host to "localhost" for hg - if runtime.GOOS == "windows" { - u.Host = "localhost" - } - - // Get the full repository - if err := g.Get(td, u); err != nil { - return err - } - - // Copy the single file - u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) - if err != nil { - return err - } - - fg := &FileGetter{Copy: true, getter: g.getter} - return fg.GetFile(dst, u) -} - -func (g *HgGetter) clone(ctx context.Context, dst string, u *url.URL) error { - cmd := exec.CommandContext(ctx, "hg", "clone", "-U", "--", u.String(), dst) - return getRunCommand(cmd) -} - -func (g *HgGetter) pull(ctx context.Context, dst string, u *url.URL) error { - cmd := exec.CommandContext(ctx, "hg", "pull") - cmd.Dir = dst - return getRunCommand(cmd) -} - -func (g *HgGetter) update(ctx context.Context, dst string, u *url.URL, rev string) error { - args := []string{"update"} - if rev != "" { - args = append(args, "--", rev) - } - - cmd := exec.CommandContext(ctx, "hg", args...) - cmd.Dir = dst - return getRunCommand(cmd) -} - -func fixWindowsDrivePath(u *url.URL) bool { - // hg assumes a file:/// prefix for Windows drive letter file paths. - // (e.g. file:///c:/foo/bar) - // If the URL Path does not begin with a '/' character, the resulting URL - // path will have a file:// prefix. (e.g. file://c:/foo/bar) - // See http://www.selenic.com/hg/help/urls and the examples listed in - // http://selenic.com/repo/hg-stable/file/1265a3a71d75/mercurial/util.py#l1936 - return runtime.GOOS == "windows" && u.Scheme == "file" && - len(u.Path) > 1 && u.Path[0] != '/' && u.Path[1] == ':' -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go deleted file mode 100644 index 7ed4466913..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_hg_test.go +++ /dev/null @@ -1,143 +0,0 @@ -package getter - -import ( - "net/url" - "os" - "os/exec" - "path/filepath" - "strings" - "testing" -) - -var testHasHg bool - -func init() { - if _, err := exec.LookPath("hg"); err == nil { - testHasHg = true - } -} - -func TestHgGetter_impl(t *testing.T) { - var _ Getter = new(HgGetter) -} - -func TestHgGetter(t *testing.T) { - if !testHasHg { - t.Log("hg not found, skipping") - t.Skip() - } - - g := new(HgGetter) - dst := tempDir(t) - - // With a dir that doesn't exist - if err := g.Get(dst, testModuleURL("basic-hg")); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestHgGetter_branch(t *testing.T) { - if !testHasHg { - t.Log("hg not found, skipping") - t.Skip() - } - - g := new(HgGetter) - dst := tempDir(t) - - url := testModuleURL("basic-hg") - q := url.Query() - q.Add("rev", "test-branch") - url.RawQuery = q.Encode() - - if err := g.Get(dst, url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main_branch.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - - // Get again should work - if err := g.Get(dst, url); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath = filepath.Join(dst, "main_branch.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestHgGetter_GetFile(t *testing.T) { - if !testHasHg { - t.Log("hg not found, skipping") - t.Skip() - } - - g := new(HgGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - if err := g.GetFile(dst, testModuleURL("basic-hg/foo.txt")); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - if _, err := os.Stat(dst); err != nil { - t.Fatalf("err: %s", err) - } - assertContents(t, dst, "Hello\n") -} - -func TestHgGetter_HgArgumentsNotAllowed(t *testing.T) { - if !testHasHg { - t.Log("hg not found, skipping") - t.Skip() - } - - g := new(HgGetter) - - // If arguments are allowed in the destination, this Get call will fail - dst := "--config=alias.clone=!false" - defer os.RemoveAll(dst) - err := g.Get(dst, testModuleURL("basic-hg")) - if err != nil { - t.Fatalf("Expected no err, got: %s", err) - } - - dst = tempDir(t) - // Test arguments passed into the `rev` parameter - // This clone call will fail regardless, but an exit code of 1 indicates - // that the `false` command executed - // We are expecting an hg parse error - err = g.Get(dst, testModuleURL("basic-hg?rev=--config=alias.update=!false")) - if err != nil { - if !strings.Contains(err.Error(), "hg: parse error") { - t.Fatalf("Expected no err, got: %s", err) - } - } - - dst = tempDir(t) - // Test arguments passed in the repository URL - // This Get call will fail regardless, but it should fail - // because the repository can't be found. - // Other failures indicate that hg interpretted the argument passed in the URL - err = g.Get(dst, &url.URL{Path: "--config=alias.clone=false"}) - if err != nil { - if !strings.Contains(err.Error(), "repository --config=alias.clone=false not found") { - t.Fatalf("Expected no err, got: %s", err) - } - } - -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_http.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_http.go deleted file mode 100644 index a4d273f14f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_http.go +++ /dev/null @@ -1,622 +0,0 @@ -package getter - -import ( - "context" - "crypto/tls" - "encoding/xml" - "fmt" - "io" - "net/http" - "net/url" - "os" - "path/filepath" - "regexp" - "strings" - "time" - - "github.com/hashicorp/go-cleanhttp" - safetemp "github.com/hashicorp/go-safetemp" -) - -// HttpGetter is a Getter implementation that will download from an HTTP -// endpoint. -// -// For file downloads, HTTP is used directly. -// -// The protocol for downloading a directory from an HTTP endpoint is as follows: -// -// An HTTP GET request is made to the URL with the additional GET parameter -// "terraform-get=1". This lets you handle that scenario specially if you -// wish. The response must be a 2xx. -// -// First, a header is looked for "X-Terraform-Get" which should contain -// a source URL to download. This source must use one of the configured -// protocols and getters for the client, or "http"/"https" if using -// the HttpGetter directly. -// -// If the header is not present, then a meta tag is searched for named -// "terraform-get" and the content should be a source URL. -// -// The source URL, whether from the header or meta tag, must be a fully -// formed URL. The shorthand syntax of "github.com/foo/bar" or relative -// paths are not allowed. -type HttpGetter struct { - getter - - // Netrc, if true, will lookup and use auth information found - // in the user's netrc file if available. - Netrc bool - - // Client is the http.Client to use for Get requests. - // This defaults to a cleanhttp.DefaultClient if left unset. - Client *http.Client - - // Header contains optional request header fields that should be included - // with every HTTP request. Note that the zero value of this field is nil, - // and as such it needs to be initialized before use, via something like - // make(http.Header). - Header http.Header - - // DoNotCheckHeadFirst configures the client to NOT check if the server - // supports HEAD requests. - DoNotCheckHeadFirst bool - - // HeadFirstTimeout configures the client to enforce a timeout when - // the server supports HEAD requests. - // - // The zero value means no timeout. - HeadFirstTimeout time.Duration - - // ReadTimeout configures the client to enforce a timeout when - // making a request to an HTTP server and reading its response body. - // - // The zero value means no timeout. - ReadTimeout time.Duration - - // MaxBytes limits the number of bytes that will be ready from an HTTP - // response body returned from a server. The zero value means no limit. - MaxBytes int64 - - // XTerraformGetLimit configures how many times the client with follow - // the " X-Terraform-Get" header value. - // - // The zero value means no limit. - XTerraformGetLimit int - - // XTerraformGetDisabled disables the client's usage of the "X-Terraform-Get" - // header value. - XTerraformGetDisabled bool -} - -func (g *HttpGetter) ClientMode(u *url.URL) (ClientMode, error) { - if strings.HasSuffix(u.Path, "/") { - return ClientModeDir, nil - } - return ClientModeFile, nil -} - -type contextKey int - -const ( - xTerraformGetDisable contextKey = 0 - xTerraformGetLimit contextKey = 1 - xTerraformGetLimitCurrentValue contextKey = 2 - httpClientValue contextKey = 3 - httpMaxBytesValue contextKey = 4 -) - -func xTerraformGetDisabled(ctx context.Context) bool { - value, ok := ctx.Value(xTerraformGetDisable).(bool) - if !ok { - return false - } - return value -} - -func xTerraformGetLimitCurrentValueFromContext(ctx context.Context) int { - value, ok := ctx.Value(xTerraformGetLimitCurrentValue).(int) - if !ok { - return 1 - } - return value -} - -func xTerraformGetLimiConfiguredtFromContext(ctx context.Context) int { - value, ok := ctx.Value(xTerraformGetLimit).(int) - if !ok { - return 0 - } - return value -} - -func httpClientFromContext(ctx context.Context) *http.Client { - value, ok := ctx.Value(httpClientValue).(*http.Client) - if !ok { - return nil - } - return value -} - -func httpMaxBytesFromContext(ctx context.Context) int64 { - value, ok := ctx.Value(httpMaxBytesValue).(int64) - if !ok { - return 0 // no limit - } - return value -} - -type limitedWrappedReaderCloser struct { - underlying io.Reader - closeFn func() error -} - -func (l *limitedWrappedReaderCloser) Read(p []byte) (n int, err error) { - return l.underlying.Read(p) -} - -func (l *limitedWrappedReaderCloser) Close() (err error) { - return l.closeFn() -} - -func newLimitedWrappedReaderCloser(r io.ReadCloser, limit int64) io.ReadCloser { - return &limitedWrappedReaderCloser{ - underlying: io.LimitReader(r, limit), - closeFn: r.Close, - } -} - -func (g *HttpGetter) Get(dst string, u *url.URL) error { - ctx := g.Context() - - // Optionally disable any X-Terraform-Get redirects. This is reccomended for usage of - // this client outside of Terraform's. This feature is likely not required if the - // source server can provider normal HTTP redirects. - if g.XTerraformGetDisabled { - ctx = context.WithValue(ctx, xTerraformGetDisable, g.XTerraformGetDisabled) - } - - // Optionally enforce a limit on X-Terraform-Get redirects. We check this for every - // invocation of this function, because the value is not passed down to subsequent - // client Get function invocations. - if g.XTerraformGetLimit > 0 { - ctx = context.WithValue(ctx, xTerraformGetLimit, g.XTerraformGetLimit) - } - - // If there was a limit on X-Terraform-Get redirects, check what the current count value. - // - // If the value is greater than the limit, return an error. Otherwise, increment the value, - // and include it in the the context to be passed along in all the subsequent client - // Get function invocations. - if limit := xTerraformGetLimiConfiguredtFromContext(ctx); limit > 0 { - currentValue := xTerraformGetLimitCurrentValueFromContext(ctx) - - if currentValue > limit { - return fmt.Errorf("too many X-Terraform-Get redirects: %d", currentValue) - } - - currentValue++ - - ctx = context.WithValue(ctx, xTerraformGetLimitCurrentValue, currentValue) - } - - // Optionally enforce a maxiumum HTTP response body size. - if g.MaxBytes > 0 { - ctx = context.WithValue(ctx, httpMaxBytesValue, g.MaxBytes) - } - - // Copy the URL so we can modify it - var newU url.URL = *u - u = &newU - - if g.Netrc { - // Add auth from netrc if we can - if err := addAuthFromNetrc(u); err != nil { - return err - } - } - - // If the HTTP client is nil, check if there is one available in the context, - // otherwise create one using cleanhttp's default transport. - if g.Client == nil { - if client := httpClientFromContext(ctx); client != nil { - g.Client = client - } else { - client := httpClient - if g.client != nil && g.client.Insecure { - insecureTransport := cleanhttp.DefaultTransport() - insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - client.Transport = insecureTransport - } - g.Client = client - } - } - - // Pass along the configured HTTP client in the context for usage with the X-Terraform-Get feature. - ctx = context.WithValue(ctx, httpClientValue, g.Client) - - // Add terraform-get to the parameter. - q := u.Query() - q.Add("terraform-get", "1") - u.RawQuery = q.Encode() - - readCtx := ctx - - if g.ReadTimeout > 0 { - var cancel context.CancelFunc - readCtx, cancel = context.WithTimeout(ctx, g.ReadTimeout) - defer cancel() - } - - // Get the URL - req, err := http.NewRequestWithContext(readCtx, "GET", u.String(), nil) - if err != nil { - return err - } - - if g.Header != nil { - req.Header = g.Header.Clone() - } - - resp, err := g.Client.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - body := resp.Body - - if maxBytes := httpMaxBytesFromContext(ctx); maxBytes > 0 { - body = newLimitedWrappedReaderCloser(body, maxBytes) - } - - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return fmt.Errorf("bad response code: %d", resp.StatusCode) - } - - if disabled := xTerraformGetDisabled(ctx); disabled { - return nil - } - - // Extract the source URL, - var source string - if v := resp.Header.Get("X-Terraform-Get"); v != "" { - source = v - } else { - source, err = g.parseMeta(readCtx, body) - if err != nil { - return err - } - } - if source == "" { - return fmt.Errorf("no source URL was returned") - } - - // If there is a subdir component, then we download the root separately - // into a temporary directory, then copy over the proper subdir. - source, subDir := SourceDirSubdir(source) - - var opts []ClientOption - - // Check if the protocol was switched to one which was not configured. - if g.client != nil && g.client.Getters != nil { - // We must first use the Detectors provided, because `X-Terraform-Get does - // not necessarily return a valid URL. We can replace the source string - // here, since the detectors would have been called immediately during the - // next Get anyway. - source, err = Detect(source, g.client.Pwd, g.client.Detectors) - if err != nil { - return err - } - - protocol := "" - // X-Terraform-Get allows paths relative to the previous request too, - // which won't have a protocol. - if !relativeGet(source) { - protocol = strings.Split(source, ":")[0] - } - - // Otherwise, all default getters are allowed. - if protocol != "" { - _, allowed := g.client.Getters[protocol] - if !allowed { - return fmt.Errorf("no getter available for X-Terraform-Get source protocol: %q", protocol) - } - } - } - - // Add any getter client options. - if g.client != nil { - opts = g.client.Options - } - - // If the client is nil, we know we're using the HttpGetter directly. In - // this case, we don't know exactly which protocols are configured, but we - // can make a good guess. - // - // This prevents all default getters from being allowed when only using the - // HttpGetter directly. To enable protocol switching, a client "wrapper" must - // be used. - if g.client == nil { - switch { - case subDir != "": - // If there's a subdirectory, we will also need a file getter to - // unpack it. - opts = append(opts, WithGetters(map[string]Getter{ - "file": new(FileGetter), - "http": g, - "https": g, - })) - default: - opts = append(opts, WithGetters(map[string]Getter{ - "http": g, - "https": g, - })) - } - } - - // Ensure we pass along the context we constructed in this function. - // - // This is especially important to enforce a limit on X-Terraform-Get redirects - // which could be setup, if configured, at the top of this function. - opts = append(opts, WithContext(ctx)) - - if subDir != "" { - // We have a subdir, time to jump some hoops - return g.getSubdir(ctx, dst, source, subDir, opts...) - } - - // Note: this allows the protocol to be switched to another configured getters. - return Get(dst, source, opts...) -} - -// GetFile fetches the file from src and stores it at dst. -// If the server supports Accept-Range, HttpGetter will attempt a range -// request. This means it is the caller's responsibility to ensure that an -// older version of the destination file does not exist, else it will be either -// falsely identified as being replaced, or corrupted with extra bytes -// appended. -func (g *HttpGetter) GetFile(dst string, src *url.URL) error { - ctx := g.Context() - - // Optionally enforce a maxiumum HTTP response body size. - if g.MaxBytes > 0 { - ctx = context.WithValue(ctx, httpMaxBytesValue, g.MaxBytes) - } - - if g.Netrc { - // Add auth from netrc if we can - if err := addAuthFromNetrc(src); err != nil { - return err - } - } - // Create all the parent directories if needed - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - f, err := os.OpenFile(dst, os.O_RDWR|os.O_CREATE, g.client.mode(0666)) - if err != nil { - return err - } - defer f.Close() - - if g.Client == nil { - g.Client = httpClient - if g.client != nil && g.client.Insecure { - insecureTransport := cleanhttp.DefaultTransport() - insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} - g.Client.Transport = insecureTransport - } - } - - var ( - currentFileSize int64 - req *http.Request - ) - - if !g.DoNotCheckHeadFirst { - headCtx := ctx - - if g.HeadFirstTimeout > 0 { - var cancel context.CancelFunc - - headCtx, cancel = context.WithTimeout(ctx, g.HeadFirstTimeout) - defer cancel() - } - - // We first make a HEAD request so we can check - // if the server supports range queries. If the server/URL doesn't - // support HEAD requests, we just fall back to GET. - req, err = http.NewRequestWithContext(headCtx, "HEAD", src.String(), nil) - if err != nil { - return err - } - if g.Header != nil { - req.Header = g.Header.Clone() - } - headResp, err := g.Client.Do(req) - if err == nil { - headResp.Body.Close() - if headResp.StatusCode == 200 { - // If the HEAD request succeeded, then attempt to set the range - // query if we can. - if headResp.Header.Get("Accept-Ranges") == "bytes" && headResp.ContentLength >= 0 { - if fi, err := f.Stat(); err == nil { - if _, err = f.Seek(0, io.SeekEnd); err == nil { - currentFileSize = fi.Size() - if currentFileSize >= headResp.ContentLength { - // file already present - return nil - } - } - } - } - } - } - } - - readCtx := ctx - - if g.ReadTimeout > 0 { - var cancel context.CancelFunc - readCtx, cancel = context.WithTimeout(ctx, g.ReadTimeout) - defer cancel() - } - - req, err = http.NewRequestWithContext(readCtx, "GET", src.String(), nil) - if err != nil { - return err - } - if g.Header != nil { - req.Header = g.Header.Clone() - } - if currentFileSize > 0 { - req.Header.Set("Range", fmt.Sprintf("bytes=%d-", currentFileSize)) - } - - resp, err := g.Client.Do(req) - if err != nil { - return err - } - switch resp.StatusCode { - case http.StatusOK, http.StatusPartialContent: - // all good - default: - resp.Body.Close() - return fmt.Errorf("bad response code: %d", resp.StatusCode) - } - - body := resp.Body - - if maxBytes := httpMaxBytesFromContext(ctx); maxBytes > 0 { - body = newLimitedWrappedReaderCloser(body, maxBytes) - } - - if g.client != nil && g.client.ProgressListener != nil { - // track download - fn := filepath.Base(src.EscapedPath()) - body = g.client.ProgressListener.TrackProgress(fn, currentFileSize, currentFileSize+resp.ContentLength, resp.Body) - } - defer body.Close() - - n, err := Copy(readCtx, f, body) - if err == nil && n < resp.ContentLength { - err = io.ErrShortWrite - } - return err -} - -// getSubdir downloads the source into the destination, but with -// the proper subdir. -func (g *HttpGetter) getSubdir(ctx context.Context, dst, source, subDir string, opts ...ClientOption) error { - // Create a temporary directory to store the full source. This has to be - // a non-existent directory. - td, tdcloser, err := safetemp.Dir("", "getter") - if err != nil { - return err - } - defer tdcloser.Close() - - // Download that into the given directory - if err := Get(td, source, opts...); err != nil { - return err - } - - // Process any globbing - sourcePath, err := SubdirGlob(td, subDir) - if err != nil { - return err - } - - // Make sure the subdir path actually exists - if _, err := os.Stat(sourcePath); err != nil { - return fmt.Errorf( - "Error downloading %s: %s", source, err) - } - - // Copy the subdirectory into our actual destination. - if err := os.RemoveAll(dst); err != nil { - return err - } - - // Make the final destination - if err := os.MkdirAll(dst, g.client.mode(0755)); err != nil { - return err - } - - var disableSymlinks bool - - if g.client != nil && g.client.DisableSymlinks { - disableSymlinks = true - } - - return copyDir(ctx, dst, sourcePath, false, disableSymlinks, g.client.umask()) -} - -// parseMeta looks for the first meta tag in the given reader that -// will give us the source URL. -func (g *HttpGetter) parseMeta(ctx context.Context, r io.Reader) (string, error) { - d := xml.NewDecoder(r) - d.CharsetReader = charsetReader - d.Strict = false - var err error - var t xml.Token - for { - if ctx.Err() != nil { - return "", fmt.Errorf("context error while parsing meta tag: %w", ctx.Err()) - } - - t, err = d.Token() - if err != nil { - if err == io.EOF { - err = nil - } - return "", err - } - if e, ok := t.(xml.StartElement); ok && strings.EqualFold(e.Name.Local, "body") { - return "", nil - } - if e, ok := t.(xml.EndElement); ok && strings.EqualFold(e.Name.Local, "head") { - return "", nil - } - e, ok := t.(xml.StartElement) - if !ok || !strings.EqualFold(e.Name.Local, "meta") { - continue - } - if attrValue(e.Attr, "name") != "terraform-get" { - continue - } - if f := attrValue(e.Attr, "content"); f != "" { - return f, nil - } - } -} - -// X-Terraform-Get allows paths relative to the previous request -var relativeGet = regexp.MustCompile(`^\.{0,2}/`).MatchString - -// attrValue returns the attribute value for the case-insensitive key -// `name', or the empty string if nothing is found. -func attrValue(attrs []xml.Attr, name string) string { - for _, a := range attrs { - if strings.EqualFold(a.Name.Local, name) { - return a.Value - } - } - return "" -} - -// charsetReader returns a reader for the given charset. Currently -// it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful -// error which is printed by go get, so the user can find why the package -// wasn't downloaded if the encoding is not supported. Note that, in -// order to reduce potential errors, ASCII is treated as UTF-8 (i.e. characters -// greater than 0x7f are not rejected). -func charsetReader(charset string, input io.Reader) (io.Reader, error) { - switch strings.ToLower(charset) { - case "ascii": - return input, nil - default: - return nil, fmt.Errorf("can't decode XML document using charset %q", charset) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go deleted file mode 100644 index 8e46530e29..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_http_test.go +++ /dev/null @@ -1,1111 +0,0 @@ -package getter - -import ( - "context" - "crypto/sha256" - "encoding/hex" - "errors" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "strconv" - "strings" - "testing" - - "github.com/hashicorp/go-cleanhttp" -) - -func TestHttpGetter_impl(t *testing.T) { - var _ Getter = new(HttpGetter) -} - -func TestHttpGetter_header(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/header" - - // Get it, which should error because it uses the file protocol. - err := g.Get(dst, &u) - - if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { - t.Fatalf("unexpected error: %v", err) - } - - // But, using a wrapper client with a file getter will work. - c := &Client{ - Getters: map[string]Getter{ - "http": g, - "file": new(FileGetter), - }, - Src: u.String(), - Dst: dst, - Mode: ClientModeDir, - } - - err = c.Get() - - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - -} - -func TestHttpGetter_requestHeader(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - g.Header = make(http.Header) - g.Header.Add("X-Foobar", "foobar") - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/expect-header" - u.RawQuery = "expected=X-Foobar" - - // Get it! - if err := g.GetFile(dst, &u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - if _, err := os.Stat(dst); err != nil { - t.Fatalf("err: %s", err) - } - assertContents(t, dst, "Hello\n") -} - -func TestHttpGetter_meta(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/meta" - - // Get it, which should error because it uses the file protocol. - err := g.Get(dst, &u) - - if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { - t.Fatalf("unexpected error: %v", err) - } - - // But, using a wrapper client with a file getter will work. - c := &Client{ - Getters: map[string]Getter{ - "http": g, - "file": new(FileGetter), - }, - Src: u.String(), - Dst: dst, - Mode: ClientModeDir, - } - - err = c.Get() - - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestHttpGetter_metaSubdir(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/meta-subdir" - - // Get it! - if err := g.Get(dst, &u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "sub.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestHttpGetter_metaSubdirGlob(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/meta-subdir-glob" - - // Get it! - if err := g.Get(dst, &u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "sub.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestHttpGetter_none(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/none" - - // Get it! - if err := g.Get(dst, &u); err == nil { - t.Fatal("should error") - } -} - -func TestHttpGetter_resume(t *testing.T) { - load := []byte(testHttpMetaStr) - sha := sha256.New() - if n, err := sha.Write(load); n != len(load) || err != nil { - t.Fatalf("sha write failed: %d, %s", n, err) - } - checksum := hex.EncodeToString(sha.Sum(nil)) - downloadFrom := len(load) / 2 - - ln := testHttpServer(t) - defer ln.Close() - - dst := tempDir(t) - defer os.RemoveAll(dst) - - dst = filepath.Join(dst, "..", "range") - f, err := os.Create(dst) - if err != nil { - t.Fatalf("create: %v", err) - } - if n, err := f.Write(load[:downloadFrom]); n != downloadFrom || err != nil { - t.Fatalf("partial file write failed: %d, %s", n, err) - } - if err := f.Close(); err != nil { - t.Fatalf("close failed: %s", err) - } - - u := url.URL{ - Scheme: "http", - Host: ln.Addr().String(), - Path: "/range", - RawQuery: "checksum=" + checksum, - } - t.Logf("url: %s", u.String()) - - // Finish getting it! - if err := GetFile(dst, u.String()); err != nil { - t.Fatalf("finishing download should not error: %v", err) - } - - b, err := ioutil.ReadFile(dst) - if err != nil { - t.Fatalf("readfile failed: %v", err) - } - - if string(b) != string(load) { - t.Fatalf("file differs: got:\n%s\n expected:\n%s\n", string(b), string(load)) - } - - // Get it again - if err := GetFile(dst, u.String()); err != nil { - t.Fatalf("should not error: %v", err) - } -} - -// The server may support Byte-Range, but has no size for the requested object -func TestHttpGetter_resumeNoRange(t *testing.T) { - load := []byte(testHttpMetaStr) - sha := sha256.New() - if n, err := sha.Write(load); n != len(load) || err != nil { - t.Fatalf("sha write failed: %d, %s", n, err) - } - checksum := hex.EncodeToString(sha.Sum(nil)) - downloadFrom := len(load) / 2 - - ln := testHttpServer(t) - defer ln.Close() - - dst := tempDir(t) - defer os.RemoveAll(dst) - - dst = filepath.Join(dst, "..", "range") - f, err := os.Create(dst) - if err != nil { - t.Fatalf("create: %v", err) - } - if n, err := f.Write(load[:downloadFrom]); n != downloadFrom || err != nil { - t.Fatalf("partial file write failed: %d, %s", n, err) - } - if err := f.Close(); err != nil { - t.Fatalf("close failed: %s", err) - } - - u := url.URL{ - Scheme: "http", - Host: ln.Addr().String(), - Path: "/no-range", - RawQuery: "checksum=" + checksum, - } - t.Logf("url: %s", u.String()) - - // Finish getting it! - if err := GetFile(dst, u.String()); err != nil { - t.Fatalf("finishing download should not error: %v", err) - } - - b, err := ioutil.ReadFile(dst) - if err != nil { - t.Fatalf("readfile failed: %v", err) - } - - if string(b) != string(load) { - t.Fatalf("file differs: got:\n%s\n expected:\n%s\n", string(b), string(load)) - } -} - -func TestHttpGetter_file(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/file" - - // Get it! - if err := g.GetFile(dst, &u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - if _, err := os.Stat(dst); err != nil { - t.Fatalf("err: %s", err) - } - assertContents(t, dst, "Hello\n") -} - -// TestHttpGetter_http2server tests that http.Request is not reused -// between HEAD & GET, which would lead to race condition in HTTP/2. -// This test is only meaningful for the race detector (go test -race). -func TestHttpGetter_http2server(t *testing.T) { - g := new(HttpGetter) - src, err := url.Parse("https://releases.hashicorp.com/terraform/0.14.0/terraform_0.14.0_SHA256SUMS") - if err != nil { - t.Fatal(err) - } - dst := tempTestFile(t) - - err = g.GetFile(dst, src) - if err != nil { - t.Fatal(err) - } -} - -func TestHttpGetter_auth(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/meta-auth" - u.User = url.UserPassword("foo", "bar") - - // Get it, which should error because it uses the file protocol. - err := g.Get(dst, &u) - - if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { - t.Fatalf("unexpected error: %v", err) - } - - // But, using a wrapper client with a file getter will work. - c := &Client{ - Getters: map[string]Getter{ - "http": g, - "file": new(FileGetter), - }, - Src: u.String(), - Dst: dst, - Mode: ClientModeDir, - } - - err = c.Get() - - if err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestHttpGetter_authNetrc(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/meta" - - // Write the netrc file - path, closer := tempFileContents(t, fmt.Sprintf(testHttpNetrc, ln.Addr().String())) - defer closer() - defer tempEnv(t, "NETRC", path)() - - // Get it, which should error because it uses the file protocol. - err := g.Get(dst, &u) - - if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { - t.Fatalf("unexpected error: %v", err) - } - - // But, using a wrapper client with a file getter will work. - c := &Client{ - Getters: map[string]Getter{ - "http": g, - "file": new(FileGetter), - }, - Src: u.String(), - Dst: dst, - Mode: ClientModeDir, - } - - err = c.Get() - - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -// test round tripper that only returns an error -type errRoundTripper struct{} - -func (errRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - return nil, errors.New("test round tripper") -} - -// verify that the default httpClient no longer comes from http.DefaultClient -func TestHttpGetter_cleanhttp(t *testing.T) { - ln := testHttpServer(t) - defer ln.Close() - - // break the default http client - http.DefaultClient.Transport = errRoundTripper{} - defer func() { - http.DefaultClient.Transport = http.DefaultTransport - }() - - g := new(HttpGetter) - dst := tempDir(t) - defer os.RemoveAll(dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/header" - - // Get it, which should error because it uses the file protocol. - err := g.Get(dst, &u) - - if !strings.Contains(err.Error(), "download not supported for scheme 'file'") { - t.Fatalf("unexpected error: %v", err) - } - - // But, using a wrapper client with a file getter will work. - c := &Client{ - Getters: map[string]Getter{ - "http": g, - "file": new(FileGetter), - }, - Src: u.String(), - Dst: dst, - Mode: ClientModeDir, - } - - err = c.Get() - - if err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestHttpGetter__RespectsContextCanceled(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - cancel() // cancel immediately - - ln := testHttpServer(t) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/file" - dst := tempDir(t) - - rt := hookableHTTPRoundTripper{ - before: func(req *http.Request) { - err := req.Context().Err() - if !errors.Is(err, context.Canceled) { - t.Fatalf("Expected http.Request with canceled.Context, got: %v", err) - } - }, - RoundTripper: http.DefaultTransport, - } - - g := new(HttpGetter) - g.client = &Client{ - Ctx: ctx, - } - g.Client = &http.Client{ - Transport: &rt, - } - - err := g.Get(dst, &u) - if !errors.Is(err, context.Canceled) { - t.Fatalf("expected context.Canceled, got: %v", err) - } -} - -func TestHttpGetter__XTerraformGetLimit(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ln := testHttpServerWithXTerraformGetLoop(t) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/loop" - dst := tempDir(t) - - g := new(HttpGetter) - g.XTerraformGetLimit = 10 - g.client = &Client{ - Ctx: ctx, - } - g.Client = &http.Client{} - - err := g.Get(dst, &u) - if !strings.Contains(err.Error(), "too many X-Terraform-Get redirects") { - t.Fatalf("too many X-Terraform-Get redirects, got: %v", err) - } -} - -func TestHttpGetter__XTerraformGetDisabled(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ln := testHttpServerWithXTerraformGetLoop(t) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/loop" - dst := tempDir(t) - - g := new(HttpGetter) - g.XTerraformGetDisabled = true - g.client = &Client{ - Ctx: ctx, - } - g.Client = &http.Client{} - - err := g.Get(dst, &u) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } -} - -type testCustomDetector struct{} - -func (testCustomDetector) Detect(src, _ string) (string, bool, error) { - if strings.HasPrefix(src, "custom|") { - return "http://" + src[7:], true, nil - } - return "", false, nil -} - -// test a source url with no protocol -func TestHttpGetter__XTerraformGetDetected(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ln := testHttpServerWithXTerraformGetDetected(t) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/first" - dst := tempDir(t) - - c := &Client{ - Ctx: ctx, - Src: u.String(), - Dst: dst, - Mode: ClientModeDir, - Options: []ClientOption{ - func(c *Client) error { - c.Detectors = append(c.Detectors, testCustomDetector{}) - return nil - }, - }, - } - - err := c.Get() - if err != nil { - t.Fatal(err) - } -} - -func TestHttpGetter__XTerraformGetProxyBypass(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ln := testHttpServerWithXTerraformGetProxyBypass(t) - - proxyLn := testHttpServerProxy(t, ln.Addr().String()) - - t.Logf("starting malicious server on: %v", ln.Addr().String()) - t.Logf("starting proxy on: %v", proxyLn.Addr().String()) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/start" - dst := tempDir(t) - - proxy, err := url.Parse(fmt.Sprintf("http://%s/", proxyLn.Addr().String())) - if err != nil { - t.Fatalf("failed to parse proxy URL: %v", err) - } - - transport := cleanhttp.DefaultTransport() - transport.Proxy = http.ProxyURL(proxy) - - httpGetter := new(HttpGetter) - httpGetter.XTerraformGetLimit = 10 - httpGetter.Client = &http.Client{ - Transport: transport, - } - - client := &Client{ - Ctx: ctx, - Getters: map[string]Getter{ - "http": httpGetter, - }, - } - - client.Src = u.String() - client.Dst = dst - - err = client.Get() - if err != nil { - t.Logf("client get error: %v", err) - } -} - -func TestHttpGetter__XTerraformGetConfiguredGettersBypass(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ln := testHttpServerWithXTerraformGetConfiguredGettersBypass(t) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/start" - dst := tempDir(t) - - rt := hookableHTTPRoundTripper{ - before: func(req *http.Request) { - t.Logf("making request") - }, - RoundTripper: http.DefaultTransport, - } - - httpGetter := new(HttpGetter) - httpGetter.XTerraformGetLimit = 10 - httpGetter.Client = &http.Client{ - Transport: &rt, - } - - client := &Client{ - Ctx: ctx, - Mode: ClientModeDir, - Getters: map[string]Getter{ - "http": httpGetter, - }, - } - - t.Logf("%v", u.String()) - - client.Src = u.String() - client.Dst = dst - - err := client.Get() - if err != nil { - if !strings.Contains(err.Error(), "no getter available for X-Terraform-Get source protocol") { - t.Fatalf("expected no getter available for X-Terraform-Get source protocol, got: %v", err) - } - } -} - -func TestHttpGetter__endless_body(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - ln := testHttpServerWithEndlessBody(t) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/" - dst := tempDir(t) - - httpGetter := new(HttpGetter) - httpGetter.MaxBytes = 10 - httpGetter.DoNotCheckHeadFirst = true - - client := &Client{ - Ctx: ctx, - Mode: ClientModeFile, - Getters: map[string]Getter{ - "http": httpGetter, - }, - } - - t.Logf("%v", u.String()) - - client.Src = u.String() - client.Dst = dst - - err := client.Get() - if err != nil { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestHttpGetter_subdirLink(t *testing.T) { - ln := testHttpServerSubDir(t) - defer ln.Close() - - httpGetter := new(HttpGetter) - dst, err := ioutil.TempDir("", "tf") - if err != nil { - t.Fatalf("err: %s", err) - } - - t.Logf("dst: %q", dst) - - var u url.URL - u.Scheme = "http" - u.Host = ln.Addr().String() - u.Path = "/regular-subdir//meta-subdir" - - t.Logf("url: %q", u.String()) - - client := &Client{ - Src: u.String(), - Dst: dst, - Mode: ClientModeAny, - Getters: map[string]Getter{ - "http": httpGetter, - }, - } - - err = client.Get() - if err != nil { - t.Fatalf("get err: %v", err) - } -} - -func testHttpServerWithXTerraformGetLoop(t *testing.T) net.Listener { - t.Helper() - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - header := fmt.Sprintf("http://%v:%v", ln.Addr().String(), "/loop") - - mux := http.NewServeMux() - mux.HandleFunc("/loop", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Terraform-Get", header) - t.Logf("serving loop") - }) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -func testHttpServerWithXTerraformGetDetected(t *testing.T) net.Listener { - t.Helper() - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - // This location requires a custom detector to work. - first := fmt.Sprintf("custom|%s/archive.tar.gz", ln.Addr()) - - mux := http.NewServeMux() - mux.HandleFunc("/first", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Terraform-Get", first) - }) - mux.HandleFunc("/archive.tar.gz", func(w http.ResponseWriter, r *http.Request) { - f, err := ioutil.ReadFile("testdata/archive.tar.gz") - if err != nil { - t.Fatal(err) - } - w.Write(f) - }) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -func testHttpServerWithXTerraformGetProxyBypass(t *testing.T) net.Listener { - t.Helper() - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - header := fmt.Sprintf("http://%v/bypass", ln.Addr().String()) - - mux := http.NewServeMux() - mux.HandleFunc("/start/start", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Terraform-Get", header) - t.Logf("serving start") - }) - - mux.HandleFunc("/bypass", func(w http.ResponseWriter, r *http.Request) { - t.Fail() - t.Logf("bypassed proxy") - }) - - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - t.Logf("serving HTTP server path: %v", r.URL.Path) - }) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -func testHttpServerWithXTerraformGetConfiguredGettersBypass(t *testing.T) net.Listener { - t.Helper() - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - header := fmt.Sprintf("git::http://%v/some/repository.git", ln.Addr().String()) - - mux := http.NewServeMux() - mux.HandleFunc("/start", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Terraform-Get", header) - t.Logf("serving start") - }) - - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - t.Logf("serving git HTTP server path: %v", r.URL.Path) - }) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -func testHttpServerProxy(t *testing.T, upstreamHost string) net.Listener { - t.Helper() - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - mux := http.NewServeMux() - - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - t.Logf("serving proxy: %v: %#+v", r.URL.Path, r.Header) - // create the reverse proxy - proxy := httputil.NewSingleHostReverseProxy(r.URL) - // Note that ServeHttp is non blocking & uses a go routine under the hood - proxy.ServeHTTP(w, r) - }) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -func testHttpServer(t *testing.T) net.Listener { - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - mux := http.NewServeMux() - mux.HandleFunc("/expect-header", testHttpHandlerExpectHeader) - mux.HandleFunc("/file", testHttpHandlerFile) - mux.HandleFunc("/header", testHttpHandlerHeader) - mux.HandleFunc("/meta", testHttpHandlerMeta) - mux.HandleFunc("/meta-auth", testHttpHandlerMetaAuth) - mux.HandleFunc("/meta-subdir", testHttpHandlerMetaSubdir) - mux.HandleFunc("/meta-subdir-glob", testHttpHandlerMetaSubdirGlob) - mux.HandleFunc("/range", testHttpHandlerRange) - mux.HandleFunc("/no-range", testHttpHandlerNoRange) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -func testHttpHandlerExpectHeader(w http.ResponseWriter, r *http.Request) { - if expected, ok := r.URL.Query()["expected"]; ok { - if r.Header.Get(expected[0]) != "" { - w.Write([]byte("Hello\n")) - return - } - } - - w.WriteHeader(400) -} - -func testHttpHandlerFile(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("Hello\n")) -} - -func testHttpHandlerHeader(w http.ResponseWriter, r *http.Request) { - w.Header().Add("X-Terraform-Get", testModuleURL("basic").String()) - w.WriteHeader(200) -} - -func testHttpHandlerMeta(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic").String()))) -} - -func testHttpHandlerMetaAuth(w http.ResponseWriter, r *http.Request) { - user, pass, ok := r.BasicAuth() - if !ok { - w.WriteHeader(401) - return - } - - if user != "foo" || pass != "bar" { - w.WriteHeader(401) - return - } - - w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic").String()))) -} - -func testHttpServerWithEndlessBody(t *testing.T) net.Listener { - t.Helper() - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - for { - w.Write([]byte(".\n")) - } - }) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -func testHttpHandlerMetaSubdir(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic//subdir").String()))) -} - -func testHttpHandlerMetaSubdirGlob(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(fmt.Sprintf(testHttpMetaStr, testModuleURL("basic//sub*").String()))) -} - -func testHttpHandlerNone(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(testHttpNoneStr)) -} - -func testHttpHandlerRange(w http.ResponseWriter, r *http.Request) { - load := []byte(testHttpMetaStr) - switch r.Method { - case "HEAD": - w.Header().Add("accept-ranges", "bytes") - w.Header().Add("content-length", strconv.Itoa(len(load))) - default: - // request should have header "Range: bytes=0-1023" - // or "Range: bytes=123-" - rangeHeaderValue := strings.Split(r.Header.Get("Range"), "=")[1] - rng, _ := strconv.Atoi(strings.Split(rangeHeaderValue, "-")[0]) - if rng < 1 || rng > len(load) { - http.Error(w, "", http.StatusBadRequest) - } - w.Write(load[rng:]) - } -} - -func testHttpHandlerNoRange(w http.ResponseWriter, r *http.Request) { - load := []byte(testHttpMetaStr) - switch r.Method { - case "HEAD": - // we support range, but the object size isn't known - w.Header().Add("accept-ranges", "bytes") - default: - if r.Header.Get("Range") != "" { - http.Error(w, "range not supported", http.StatusBadRequest) - } - w.Write(load) - } -} - -func testHttpServerSubDir(t *testing.T) net.Listener { - t.Helper() - - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - t.Fatalf("err: %s", err) - } - - mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - switch r.Method { - case http.MethodGet: - t.Logf("serving: %v: %v: %#+[1]v", r.Method, r.URL.String(), r.Header) - } - }) - - var server http.Server - server.Handler = mux - go server.Serve(ln) - - return ln -} - -const testHttpMetaStr = ` - - - - - -` - -const testHttpNoneStr = ` - - - - -` - -const testHttpNetrc = ` -machine %s -login foo -password bar -` - -type hookableHTTPRoundTripper struct { - before func(req *http.Request) - http.RoundTripper -} - -func (m *hookableHTTPRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - if m.before != nil { - m.before(req) - } - return m.RoundTripper.RoundTrip(req) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go deleted file mode 100644 index e2a98ea284..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_mock.go +++ /dev/null @@ -1,54 +0,0 @@ -package getter - -import ( - "net/url" -) - -// MockGetter is an implementation of Getter that can be used for tests. -type MockGetter struct { - getter - - // Proxy, if set, will be called after recording the calls below. - // If it isn't set, then the *Err values will be returned. - Proxy Getter - - GetCalled bool - GetDst string - GetURL *url.URL - GetErr error - - GetFileCalled bool - GetFileDst string - GetFileURL *url.URL - GetFileErr error -} - -func (g *MockGetter) Get(dst string, u *url.URL) error { - g.GetCalled = true - g.GetDst = dst - g.GetURL = u - - if g.Proxy != nil { - return g.Proxy.Get(dst, u) - } - - return g.GetErr -} - -func (g *MockGetter) GetFile(dst string, u *url.URL) error { - g.GetFileCalled = true - g.GetFileDst = dst - g.GetFileURL = u - - if g.Proxy != nil { - return g.Proxy.GetFile(dst, u) - } - return g.GetFileErr -} - -func (g *MockGetter) ClientMode(u *url.URL) (ClientMode, error) { - if l := len(u.Path); l > 0 && u.Path[l-1:] == "/" { - return ClientModeDir, nil - } - return ClientModeFile, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go deleted file mode 100644 index 7e0d853ba2..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_s3.go +++ /dev/null @@ -1,344 +0,0 @@ -package getter - -import ( - "context" - "fmt" - "net/url" - "os" - "path/filepath" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" -) - -// S3Getter is a Getter implementation that will download a module from -// a S3 bucket. -type S3Getter struct { - getter - - // Timeout sets a deadline which all S3 operations should - // complete within. Zero value means no timeout. - Timeout time.Duration -} - -func (g *S3Getter) ClientMode(u *url.URL) (ClientMode, error) { - // Parse URL - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - region, bucket, path, _, creds, err := g.parseUrl(u) - if err != nil { - return 0, err - } - - // Create client config - client, err := g.newS3Client(region, u, creds) - if err != nil { - return 0, err - } - - // List the object(s) at the given prefix - req := &s3.ListObjectsInput{ - Bucket: aws.String(bucket), - Prefix: aws.String(path), - } - resp, err := client.ListObjectsWithContext(ctx, req) - if err != nil { - return 0, err - } - - for _, o := range resp.Contents { - // Use file mode on exact match. - if *o.Key == path { - return ClientModeFile, nil - } - - // Use dir mode if child keys are found. - if strings.HasPrefix(*o.Key, path+"/") { - return ClientModeDir, nil - } - } - - // There was no match, so just return file mode. The download is going - // to fail but we will let S3 return the proper error later. - return ClientModeFile, nil -} - -func (g *S3Getter) Get(dst string, u *url.URL) error { - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - // Parse URL - region, bucket, path, _, creds, err := g.parseUrl(u) - if err != nil { - return err - } - - // Remove destination if it already exists - _, err = os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return err - } - - if err == nil { - // Remove the destination - if err := os.RemoveAll(dst); err != nil { - return err - } - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - client, err := g.newS3Client(region, u, creds) - if err != nil { - return err - } - - // List files in path, keep listing until no more objects are found - lastMarker := "" - hasMore := true - for hasMore { - req := &s3.ListObjectsInput{ - Bucket: aws.String(bucket), - Prefix: aws.String(path), - } - if lastMarker != "" { - req.Marker = aws.String(lastMarker) - } - - resp, err := client.ListObjectsWithContext(ctx, req) - if err != nil { - return err - } - - hasMore = aws.BoolValue(resp.IsTruncated) - - // Get each object storing each file relative to the destination path - for _, object := range resp.Contents { - lastMarker = aws.StringValue(object.Key) - objPath := aws.StringValue(object.Key) - - // If the key ends with a backslash assume it is a directory and ignore - if strings.HasSuffix(objPath, "/") { - continue - } - - // Get the object destination path - objDst, err := filepath.Rel(path, objPath) - if err != nil { - return err - } - objDst = filepath.Join(dst, objDst) - - if err := g.getObject(ctx, client, objDst, bucket, objPath, ""); err != nil { - return err - } - } - } - - return nil -} - -func (g *S3Getter) GetFile(dst string, u *url.URL) error { - ctx := g.Context() - - if g.Timeout > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, g.Timeout) - defer cancel() - } - - region, bucket, path, version, creds, err := g.parseUrl(u) - if err != nil { - return err - } - - client, err := g.newS3Client(region, u, creds) - if err != nil { - return err - } - - return g.getObject(ctx, client, dst, bucket, path, version) -} - -func (g *S3Getter) getObject(ctx context.Context, client *s3.S3, dst, bucket, key, version string) error { - req := &s3.GetObjectInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - } - if version != "" { - req.VersionId = aws.String(version) - } - - resp, err := client.GetObjectWithContext(ctx, req) - if err != nil { - return err - } - - // Create all the parent directories - if err := os.MkdirAll(filepath.Dir(dst), g.client.mode(0755)); err != nil { - return err - } - - body := resp.Body - - if g.client != nil && g.client.ProgressListener != nil { - fn := filepath.Base(key) - body = g.client.ProgressListener.TrackProgress(fn, 0, *resp.ContentLength, resp.Body) - } - defer body.Close() - - return copyReader(dst, body, 0666, g.client.umask()) -} - -func (g *S3Getter) getAWSConfig(region string, url *url.URL, creds *credentials.Credentials) *aws.Config { - conf := &aws.Config{} - metadataURLOverride := os.Getenv("AWS_METADATA_URL") - if creds == nil && metadataURLOverride != "" { - creds = credentials.NewChainCredentials( - []credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - &ec2rolecreds.EC2RoleProvider{ - Client: ec2metadata.New(session.New(&aws.Config{ - Endpoint: aws.String(metadataURLOverride), - })), - }, - }) - } - - if creds != nil { - conf.Endpoint = &url.Host - conf.S3ForcePathStyle = aws.Bool(true) - if url.Scheme == "http" { - conf.DisableSSL = aws.Bool(true) - } - } - - conf.Credentials = creds - if region != "" { - conf.Region = aws.String(region) - } - - return conf.WithCredentialsChainVerboseErrors(true) -} - -func (g *S3Getter) parseUrl(u *url.URL) (region, bucket, path, version string, creds *credentials.Credentials, err error) { - // This just check whether we are dealing with S3 or - // any other S3 compliant service. S3 has a predictable - // url as others do not - if strings.Contains(u.Host, "amazonaws.com") { - // Amazon S3 supports both virtual-hosted–style and path-style URLs to access a bucket, although path-style is deprecated - // In both cases few older regions supports dash-style region indication (s3-Region) even if AWS discourages their use. - // The same bucket could be reached with: - // bucket.s3.region.amazonaws.com/path - // bucket.s3-region.amazonaws.com/path - // s3.amazonaws.com/bucket/path - // s3-region.amazonaws.com/bucket/path - - hostParts := strings.Split(u.Host, ".") - switch len(hostParts) { - // path-style - case 3: - // Parse the region out of the first part of the host - region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") - if region == "" { - region = "us-east-1" - } - pathParts := strings.SplitN(u.Path, "/", 3) - bucket = pathParts[1] - path = pathParts[2] - // vhost-style, dash region indication - case 4: - // Parse the region out of the first part of the host - region = strings.TrimPrefix(strings.TrimPrefix(hostParts[1], "s3-"), "s3") - if region == "" { - err = fmt.Errorf("URL is not a valid S3 URL") - return - } - pathParts := strings.SplitN(u.Path, "/", 2) - bucket = hostParts[0] - path = pathParts[1] - //vhost-style, dot region indication - case 5: - region = hostParts[2] - pathParts := strings.SplitN(u.Path, "/", 2) - bucket = hostParts[0] - path = pathParts[1] - - } - if len(hostParts) < 3 && len(hostParts) > 5 { - err = fmt.Errorf("URL is not a valid S3 URL") - return - } - version = u.Query().Get("version") - - } else { - pathParts := strings.SplitN(u.Path, "/", 3) - if len(pathParts) != 3 { - err = fmt.Errorf("URL is not a valid S3 compliant URL") - return - } - bucket = pathParts[1] - path = pathParts[2] - version = u.Query().Get("version") - region = u.Query().Get("region") - if region == "" { - region = "us-east-1" - } - } - - _, hasAwsId := u.Query()["aws_access_key_id"] - _, hasAwsSecret := u.Query()["aws_access_key_secret"] - _, hasAwsToken := u.Query()["aws_access_token"] - if hasAwsId || hasAwsSecret || hasAwsToken { - creds = credentials.NewStaticCredentials( - u.Query().Get("aws_access_key_id"), - u.Query().Get("aws_access_key_secret"), - u.Query().Get("aws_access_token"), - ) - } - - return -} - -func (g *S3Getter) newS3Client( - region string, url *url.URL, creds *credentials.Credentials, -) (*s3.S3, error) { - var sess *session.Session - - if profile := url.Query().Get("aws_profile"); profile != "" { - var err error - sess, err = session.NewSessionWithOptions(session.Options{ - Profile: profile, - SharedConfigState: session.SharedConfigEnable, - }) - if err != nil { - return nil, err - } - } else { - config := g.getAWSConfig(region, url, creds) - sess = session.New(config) - } - - return s3.New(sess), nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go deleted file mode 100644 index 25ce483679..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_s3_test.go +++ /dev/null @@ -1,269 +0,0 @@ -package getter - -import ( - "net/url" - "os" - "path/filepath" - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -func init() { - // These are well known restricted IAM keys to a HashiCorp-managed bucket - // in a private AWS account that only has access to the open source test - // resources. - // - // We do the string concat below to avoid AWS autodetection of a key. This - // key is locked down an IAM policy that is read-only so we're purposely - // exposing it. - os.Setenv("AWS_ACCESS_KEY", "AKIAITTDR"+"WY2STXOZE2A") - os.Setenv("AWS_SECRET_KEY", "oMwSyqdass2kPF"+"/7ORZA9dlb/iegz+89B0Cy01Ea") -} - -func TestS3Getter_impl(t *testing.T) { - var _ Getter = new(S3Getter) -} - -func TestS3Getter(t *testing.T) { - g := new(S3Getter) - dst := tempDir(t) - - // With a dir that doesn't exist - err := g.Get( - dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestS3Getter_subdir(t *testing.T) { - g := new(S3Getter) - dst := tempDir(t) - - // With a dir that doesn't exist - err := g.Get( - dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/subfolder")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - subPath := filepath.Join(dst, "sub.tf") - if _, err := os.Stat(subPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestS3Getter_GetFile(t *testing.T) { - g := new(S3Getter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - err := g.GetFile( - dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/main.tf")) - if err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - if _, err := os.Stat(dst); err != nil { - t.Fatalf("err: %s", err) - } - assertContents(t, dst, "# Main\n") -} - -func TestS3Getter_GetFile_badParams(t *testing.T) { - g := new(S3Getter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - err := g.GetFile( - dst, - testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/main.tf?aws_access_key_id=foo&aws_access_key_secret=bar&aws_access_token=baz")) - if err == nil { - t.Fatalf("expected error, got none") - } - - if reqerr, ok := err.(awserr.RequestFailure); !ok || reqerr.StatusCode() != 403 { - t.Fatalf("expected InvalidAccessKeyId error") - } -} - -func TestS3Getter_GetFile_notfound(t *testing.T) { - g := new(S3Getter) - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - - // Download - err := g.GetFile( - dst, testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/404.tf")) - if err == nil { - t.Fatalf("expected error, got none") - } -} - -func TestS3Getter_ClientMode_dir(t *testing.T) { - g := new(S3Getter) - - // Check client mode on a key prefix with only a single key. - mode, err := g.ClientMode( - testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeDir { - t.Fatal("expect ClientModeDir") - } -} - -func TestS3Getter_ClientMode_file(t *testing.T) { - g := new(S3Getter) - - // Check client mode on a key prefix which contains sub-keys. - mode, err := g.ClientMode( - testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/folder/main.tf")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeFile { - t.Fatal("expect ClientModeFile") - } -} - -func TestS3Getter_ClientMode_notfound(t *testing.T) { - g := new(S3Getter) - - // Check the client mode when a non-existent key is looked up. This does not - // return an error, but rather should just return the file mode so that S3 - // can return an appropriate error later on. This also checks that the - // prefix is handled properly (e.g., "/fold" and "/folder" don't put the - // client mode into "dir". - mode, err := g.ClientMode( - testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/fold")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeFile { - t.Fatal("expect ClientModeFile") - } -} - -func TestS3Getter_ClientMode_collision(t *testing.T) { - g := new(S3Getter) - - // Check that the client mode is "file" if there is both an object and a - // folder with a common prefix (i.e., a "collision" in the namespace). - mode, err := g.ClientMode( - testURL("https://s3.amazonaws.com/hc-oss-test/go-getter/collision/foo")) - if err != nil { - t.Fatalf("err: %s", err) - } - if mode != ClientModeFile { - t.Fatal("expect ClientModeFile") - } -} - -func TestS3Getter_Url(t *testing.T) { - var s3tests = []struct { - name string - url string - region string - bucket string - path string - version string - }{ - { - name: "AWSv1234", - url: "s3::https://s3-eu-west-1.amazonaws.com/bucket/foo/bar.baz?version=1234", - region: "eu-west-1", - bucket: "bucket", - path: "foo/bar.baz", - version: "1234", - }, - { - name: "AWSVhostDot", - url: "s3::https://bucket.s3.eu-west-1.amazonaws.com/foo/bar.baz?version=1234", - region: "eu-west-1", - bucket: "bucket", - path: "foo/bar.baz", - version: "1234", - }, - { - name: "AWSVhostDash", - url: "s3::https://bucket.s3-eu-west-1.amazonaws.com/foo/bar.baz?version=1234", - region: "eu-west-1", - bucket: "bucket", - path: "foo/bar.baz", - version: "1234", - }, - { - name: "localhost-1", - url: "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=TESTID&aws_access_key_secret=TestSecret®ion=us-east-2&version=1", - region: "us-east-2", - bucket: "test-bucket", - path: "hello.txt", - version: "1", - }, - { - name: "localhost-2", - url: "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=TESTID&aws_access_key_secret=TestSecret&version=1", - region: "us-east-1", - bucket: "test-bucket", - path: "hello.txt", - version: "1", - }, - { - name: "localhost-3", - url: "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=TESTID&aws_access_key_secret=TestSecret", - region: "us-east-1", - bucket: "test-bucket", - path: "hello.txt", - version: "", - }, - } - - for i, pt := range s3tests { - t.Run(pt.name, func(t *testing.T) { - g := new(S3Getter) - forced, src := getForcedGetter(pt.url) - u, err := url.Parse(src) - - if err != nil { - t.Errorf("test %d: unexpected error: %s", i, err) - } - if forced != "s3" { - t.Fatalf("expected forced protocol to be s3") - } - - region, bucket, path, version, creds, err := g.parseUrl(u) - - if err != nil { - t.Fatalf("err: %s", err) - } - if region != pt.region { - t.Fatalf("expected %s, got %s", pt.region, region) - } - if bucket != pt.bucket { - t.Fatalf("expected %s, got %s", pt.bucket, bucket) - } - if path != pt.path { - t.Fatalf("expected %s, got %s", pt.path, path) - } - if version != pt.version { - t.Fatalf("expected %s, got %s", pt.version, version) - } - if &creds == nil { - t.Fatalf("expected to not be nil") - } - }) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/get_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/get_test.go deleted file mode 100644 index 34f9e87b92..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/get_test.go +++ /dev/null @@ -1,545 +0,0 @@ -package getter - -import ( - "os" - "path/filepath" - "strings" - "testing" -) - -func TestGet_badSchema(t *testing.T) { - dst := tempDir(t) - u := testModule("basic") - u = strings.Replace(u, "file", "nope", -1) - - if err := Get(dst, u); err == nil { - t.Fatal("should error") - } -} - -func TestGet_file(t *testing.T) { - dst := tempDir(t) - u := testModule("basic") - - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -// https://github.com/hashicorp/terraform/issues/11438 -func TestGet_fileDecompressorExt(t *testing.T) { - dst := tempDir(t) - u := testModule("basic-tgz") - - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -// https://github.com/hashicorp/terraform/issues/8418 -func TestGet_filePercent2F(t *testing.T) { - dst := tempDir(t) - u := testModule("basic%2Ftest") - - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGet_fileDetect(t *testing.T) { - dst := tempDir(t) - u := filepath.Join(".", "testdata", "basic") - pwd, err := os.Getwd() - if err != nil { - t.Fatalf("err: %s", err) - } - - client := &Client{ - Src: u, - Dst: dst, - Pwd: pwd, - Dir: true, - } - - if err := client.Configure(); err != nil { - t.Fatalf("configure: %s", err) - } - - if err := client.Get(); err != nil { - t.Fatalf("get: %s", err) - } - - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("stat: %s", err) - } -} - -func TestGet_fileForced(t *testing.T) { - dst := tempDir(t) - u := testModule("basic") - u = "file::" + u - - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGet_fileSubdir(t *testing.T) { - dst := tempDir(t) - u := testModule("basic//subdir") - - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "sub.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGet_archive(t *testing.T) { - dst := tempDir(t) - u := filepath.Join("./testdata", "archive.tar.gz") - u, _ = filepath.Abs(u) - - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGetAny_archive(t *testing.T) { - dst := tempDir(t) - u := filepath.Join("./testdata", "archive.tar.gz") - u, _ = filepath.Abs(u) - - if err := GetAny(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "main.tf") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGet_archiveRooted(t *testing.T) { - dst := tempDir(t) - u := testModule("archive-rooted/archive.tar.gz") - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "root", "hello.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGet_archiveSubdirWild(t *testing.T) { - dst := tempDir(t) - u := testModule("archive-rooted/archive.tar.gz") - u += "//*" - if err := Get(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "hello.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGet_archiveSubdirWildMultiMatch(t *testing.T) { - dst := tempDir(t) - u := testModule("archive-rooted-multi/archive.tar.gz") - u += "//*" - if err := Get(dst, u); err == nil { - t.Fatal("should error") - } else if !strings.Contains(err.Error(), "multiple") { - t.Fatalf("err: %s", err) - } -} - -func TestGetAny_file(t *testing.T) { - dst := tempDir(t) - u := testModule("basic-file/foo.txt") - - if err := GetAny(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "foo.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGetAny_dir(t *testing.T) { - dst := tempDir(t) - u := filepath.Join("./testdata", "basic") - u, _ = filepath.Abs(u) - - if err := GetAny(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - check := []string{ - "main.tf", - "foo/main.tf", - } - - for _, name := range check { - mainPath := filepath.Join(dst, name) - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } - } -} - -func TestGetFile(t *testing.T) { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - u := testModule("basic-file/foo.txt") - - if err := GetFile(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - assertContents(t, dst, "Hello\n") -} - -func TestGetFile_archive(t *testing.T) { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - u := testModule("basic-file-archive/archive.tar.gz") - - if err := GetFile(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - assertContents(t, dst, "Hello\n") -} - -func TestGetFile_archiveChecksum(t *testing.T) { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - u := testModule( - "basic-file-archive/archive.tar.gz?checksum=md5:fbd90037dacc4b1ab40811d610dde2f0") - - if err := GetFile(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - assertContents(t, dst, "Hello\n") -} - -func TestGetFile_archiveNoUnarchive(t *testing.T) { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - u := testModule("basic-file-archive/archive.tar.gz") - u += "?archive=false" - - if err := GetFile(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - // Verify the main file exists - actual := testMD5(t, dst) - expected := "fbd90037dacc4b1ab40811d610dde2f0" - if actual != expected { - t.Fatalf("bad: %s", actual) - } -} - -func TestGetFile_checksum(t *testing.T) { - cases := []struct { - Append string - Err bool - }{ - { - "", - false, - }, - - // MD5 - { - "?checksum=09f7e02f1290be211da707a266f153b3", - false, - }, - { - "?checksum=md5:09f7e02f1290be211da707a266f153b3", - false, - }, - { - "?checksum=md5:09f7e02f1290be211da707a266f153b4", - true, - }, - - // SHA1 - { - "?checksum=1d229271928d3f9e2bb0375bd6ce5db6c6d348d9", - false, - }, - { - "?checksum=sha1:1d229271928d3f9e2bb0375bd6ce5db6c6d348d9", - false, - }, - { - "?checksum=sha1:1d229271928d3f9e2bb0375bd6ce5db6c6d348d0", - true, - }, - - // SHA256 - { - "?checksum=66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18", - false, - }, - { - "?checksum=sha256:66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18", - false, - }, - { - "?checksum=sha256:66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f19", - true, - }, - - // SHA512 - { - "?checksum=c2bad2223811194582af4d1508ac02cd69eeeeedeeb98d54fcae4dcefb13cc882e7640328206603d3fb9cd5f949a9be0db054dd34fbfa190c498a5fe09750cef", - false, - }, - { - "?checksum=sha512:c2bad2223811194582af4d1508ac02cd69eeeeedeeb98d54fcae4dcefb13cc882e7640328206603d3fb9cd5f949a9be0db054dd34fbfa190c498a5fe09750cef", - false, - }, - { - "?checksum=sha512:c2bad2223811194582af4d1508ac02cd69eeeeedeeb98d54fcae4dcefb13cc882e7640328206603d3fb9cd5f949a9be0db054dd34fbfa190c498a5fe09750ced", - true, - }, - } - - for _, tc := range cases { - u := testModule("basic-file/foo.txt") + tc.Append - - func() { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - if err := GetFile(dst, u); (err != nil) != tc.Err { - t.Fatalf("append: %s\n\nerr: %s", tc.Append, err) - } - - // Verify the main file exists - assertContents(t, dst, "Hello\n") - }() - } -} - -func TestGetFile_checksum_from_file(t *testing.T) { - checksums := testModule("checksum-file") - httpChecksums := httpTestModule("checksum-file") - defer httpChecksums.Close() - - cases := []struct { - Append string - WantTransfer bool - WantErr bool - }{ - { - "", - true, - false, - }, - - // md5 - { - "?checksum=file:" + checksums + "/md5-p.sum", - true, - false, - }, - { - "?checksum=file:" + httpChecksums.URL + "/md5-bsd.sum", - true, - false, - }, - { - "?checksum=file:" + checksums + "/md5-bsd-bad.sum", - false, - true, - }, - { - "?checksum=file:" + httpChecksums.URL + "/md5-bsd-wrong.sum", - true, - true, - }, - - // sha1 - { - "?checksum=file:" + checksums + "/sha1-p.sum", - true, - false, - }, - { - "?checksum=file:" + httpChecksums.URL + "/sha1.sum", - true, - false, - }, - - // sha256 - { - "?checksum=file:" + checksums + "/sha256-p.sum", - true, - false, - }, - - // sha512 - { - "?checksum=file:" + httpChecksums.URL + "/sha512-p.sum", - true, - false, - }, - { - // checksum file does not have EOL, ends line with EOF - "?checksum=file:" + httpChecksums.URL + "/sha512-p-EOF.sum", - true, - false, - }, - } - - for _, tc := range cases { - u := checksums + "/content.txt" + tc.Append - t.Run(tc.Append, func(t *testing.T) { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - if err := GetFile(dst, u); (err != nil) != tc.WantErr { - t.Fatalf("append: %s\n\nerr: %s", tc.Append, err) - } - - if tc.WantTransfer { - // Verify the main file exists - assertContents(t, dst, "I am a file with some content\n") - } - }) - } -} - -func TestGetFile_checksumURL(t *testing.T) { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - u := testModule("basic-file/foo.txt") + "?checksum=md5:09f7e02f1290be211da707a266f153b3" - - getter := &MockGetter{Proxy: new(FileGetter)} - client := &Client{ - Src: u, - Dst: dst, - Dir: false, - Getters: map[string]Getter{ - "file": getter, - }, - } - - if err := client.Get(); err != nil { - t.Fatalf("err: %s", err) - } - - if v := getter.GetFileURL.Query().Get("checksum"); v != "" { - t.Fatalf("bad: %s", v) - } -} - -func TestGetFile_filename(t *testing.T) { - dst := tempDir(t) - u := testModule("basic-file/foo.txt") - - u += "?filename=bar.txt" - - if err := GetAny(dst, u); err != nil { - t.Fatalf("err: %s", err) - } - - mainPath := filepath.Join(dst, "bar.txt") - if _, err := os.Stat(mainPath); err != nil { - t.Fatalf("err: %s", err) - } -} - -func TestGetFile_filename_path_traversal(t *testing.T) { - dst := tempDir(t) - u := testModule("basic-file/foo.txt") - - u += "?filename=../../../../../../../../../../../../../tmp/bar.txt" - - err := GetAny(dst, u) - if err == nil { - t.Fatalf("expected error") - } - if !strings.Contains(err.Error(), "filename query parameter contain path traversal") { - t.Fatalf("unexpected err: %s", err) - } -} - -func TestGetFile_checksumSkip(t *testing.T) { - dst := tempTestFile(t) - defer os.RemoveAll(filepath.Dir(dst)) - u := testModule("basic-file/foo.txt") + "?checksum=md5:09f7e02f1290be211da707a266f153b3" - - getter := &MockGetter{Proxy: new(FileGetter)} - client := &Client{ - Src: u, - Dst: dst, - Dir: false, - Getters: map[string]Getter{ - "file": getter, - }, - } - - // get the file - if err := client.Get(); err != nil { - t.Fatalf("err: %s", err) - } - - if v := getter.GetFileURL.Query().Get("checksum"); v != "" { - t.Fatalf("bad: %s", v) - } - - // remove proxy file getter and reset GetFileCalled so that we can re-test. - getter.Proxy = nil - getter.GetFileCalled = false - - if err := client.Get(); err != nil { - t.Fatalf("err: %s", err) - } - - if getter.GetFileCalled { - t.Fatalf("get should not have been called") - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/go.mod b/test/integration/licenses/github.com/hashicorp/go-getter/go.mod deleted file mode 100644 index a3726a9214..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/go.mod +++ /dev/null @@ -1,28 +0,0 @@ -module github.com/hashicorp/go-getter - -require ( - cloud.google.com/go v0.45.1 - github.com/aws/aws-sdk-go v1.15.78 - github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d - github.com/cheggaaa/pb v1.0.27 - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.7.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 - github.com/hashicorp/go-safetemp v1.0.0 - github.com/hashicorp/go-version v1.1.0 - github.com/klauspost/compress v1.11.2 - github.com/mattn/go-colorable v0.0.9 // indirect - github.com/mattn/go-isatty v0.0.4 // indirect - github.com/mattn/go-runewidth v0.0.4 // indirect - github.com/mitchellh/go-homedir v1.0.0 - github.com/mitchellh/go-testing-interface v1.0.0 - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 // indirect - github.com/ulikunitz/xz v0.5.8 - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 - golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e // indirect - google.golang.org/api v0.9.0 - gopkg.in/cheggaaa/pb.v1 v1.0.27 // indirect -) - -go 1.13 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/go.sum b/test/integration/licenses/github.com/hashicorp/go-getter/go.sum deleted file mode 100644 index dc9ecf9ef6..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/go.sum +++ /dev/null @@ -1,162 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/aws/aws-sdk-go v1.15.78 h1:LaXy6lWR0YK7LKyuU0QWy2ws/LWTPfYV/UgfiBu4tvY= -github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= -github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= -github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= -github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -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 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e h1:w36l2Uw3dRan1K3TyXriXvY+6T56GNmlKGcqiQUJDfM= -golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= -gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go deleted file mode 100644 index 02497c2543..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url.go +++ /dev/null @@ -1,14 +0,0 @@ -package url - -import ( - "net/url" -) - -// Parse parses rawURL into a URL structure. -// The rawURL may be relative or absolute. -// -// Parse is a wrapper for the Go stdlib net/url Parse function, but returns -// Windows "safe" URLs on Windows platforms. -func Parse(rawURL string) (*url.URL, error) { - return parse(rawURL) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go deleted file mode 100644 index 1015f4afc5..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package url - -import ( - "runtime" - "testing" -) - -type parseTest struct { - rawURL string - scheme string - host string - path string - str string - err bool -} - -var parseTests = []parseTest{ - { - rawURL: "/foo/bar", - scheme: "", - host: "", - path: "/foo/bar", - str: "/foo/bar", - err: false, - }, - { - rawURL: "file:///dir/", - scheme: "file", - host: "", - path: "/dir/", - str: "file:///dir/", - err: false, - }, -} - -var winParseTests = []parseTest{ - { - rawURL: `C:\`, - scheme: `file`, - host: ``, - path: `C:/`, - str: `file://C:/`, - err: false, - }, - { - rawURL: `file://C:\`, - scheme: `file`, - host: ``, - path: `C:/`, - str: `file://C:/`, - err: false, - }, - { - rawURL: `file:///C:\`, - scheme: `file`, - host: ``, - path: `C:/`, - str: `file://C:/`, - err: false, - }, -} - -func TestParse(t *testing.T) { - if runtime.GOOS == "windows" { - parseTests = append(parseTests, winParseTests...) - } - for i, pt := range parseTests { - url, err := Parse(pt.rawURL) - if err != nil && !pt.err { - t.Errorf("test %d: unexpected error: %s", i, err) - } - if err == nil && pt.err { - t.Errorf("test %d: expected an error", i) - } - if url.Scheme != pt.scheme { - t.Errorf("test %d: expected Scheme = %q, got %q", i, pt.scheme, url.Scheme) - } - if url.Host != pt.host { - t.Errorf("test %d: expected Host = %q, got %q", i, pt.host, url.Host) - } - if url.Path != pt.path { - t.Errorf("test %d: expected Path = %q, got %q", i, pt.path, url.Path) - } - if url.String() != pt.str { - t.Errorf("test %d: expected url.String() = %q, got %q", i, pt.str, url.String()) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go deleted file mode 100644 index ed1352a917..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_unix.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build !windows - -package url - -import ( - "net/url" -) - -func parse(rawURL string) (*url.URL, error) { - return url.Parse(rawURL) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go b/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go deleted file mode 100644 index 4280ec59a8..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/helper/url/url_windows.go +++ /dev/null @@ -1,39 +0,0 @@ -package url - -import ( - "fmt" - "net/url" - "path/filepath" - "strings" -) - -func parse(rawURL string) (*url.URL, error) { - // Make sure we're using "/" since URLs are "/"-based. - rawURL = filepath.ToSlash(rawURL) - - if len(rawURL) > 1 && rawURL[1] == ':' { - // Assume we're dealing with a drive letter. In which case we - // force the 'file' scheme to avoid "net/url" URL.String() prepending - // our url with "./". - rawURL = "file://" + rawURL - } - - u, err := url.Parse(rawURL) - if err != nil { - return nil, err - } - - if len(u.Host) > 1 && u.Host[1] == ':' && strings.HasPrefix(rawURL, "file://") { - // Assume we're dealing with a drive letter file path where the drive - // letter has been parsed into the URL Host. - u.Path = fmt.Sprintf("%s%s", u.Host, u.Path) - u.Host = "" - } - - // Remove leading slash for absolute file paths. - if len(u.Path) > 2 && u.Path[0] == '/' && u.Path[2] == ':' { - u.Path = u.Path[1:] - } - - return u, err -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/module_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/module_test.go deleted file mode 100644 index 244c1cf2d4..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/module_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package getter - -import ( - "io/ioutil" - "net/http" - "net/http/httptest" - "net/url" - "os" - "path/filepath" - "reflect" - "testing" - - urlhelper "github.com/hashicorp/go-getter/helper/url" -) - -const fixtureDir = "./testdata" - -func tempDir(t *testing.T) string { - dir, err := ioutil.TempDir("", "tf") - if err != nil { - t.Fatalf("err: %s", err) - } - if err := os.RemoveAll(dir); err != nil { - t.Fatalf("err: %s", err) - } - - return dir -} - -func tempTestFile(t *testing.T) string { - dir := tempDir(t) - return filepath.Join(dir, "foo") -} - -func testModule(n string) string { - p := filepath.Join(fixtureDir, n) - p, err := filepath.Abs(p) - if err != nil { - panic(err) - } - return fmtFileURL(p) -} -func httpTestModule(n string) *httptest.Server { - p := filepath.Join(fixtureDir, n) - p, err := filepath.Abs(p) - if err != nil { - panic(err) - } - - return httptest.NewServer(http.FileServer(http.Dir(p))) -} - -func testModuleURL(n string) *url.URL { - n, subDir := SourceDirSubdir(n) - u, err := urlhelper.Parse(testModule(n)) - if err != nil { - panic(err) - } - if subDir != "" { - u.Path += "//" + subDir - u.RawPath = u.Path - } - - return u -} - -func testURL(s string) *url.URL { - u, err := urlhelper.Parse(s) - if err != nil { - panic(err) - } - - return u -} - -func testStorage(t *testing.T) Storage { - return &FolderStorage{StorageDir: tempDir(t)} -} - -func assertContents(t *testing.T, path string, contents string) { - data, err := ioutil.ReadFile(path) - if err != nil { - t.Fatalf("err: %s", err) - } - - if !reflect.DeepEqual(data, []byte(contents)) { - t.Fatalf("bad. expected:\n\n%s\n\nGot:\n\n%s", contents, string(data)) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/netrc.go b/test/integration/licenses/github.com/hashicorp/go-getter/netrc.go deleted file mode 100644 index c7f6a3fb3f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/netrc.go +++ /dev/null @@ -1,67 +0,0 @@ -package getter - -import ( - "fmt" - "net/url" - "os" - "runtime" - - "github.com/bgentry/go-netrc/netrc" - "github.com/mitchellh/go-homedir" -) - -// addAuthFromNetrc adds auth information to the URL from the user's -// netrc file if it can be found. This will only add the auth info -// if the URL doesn't already have auth info specified and the -// the username is blank. -func addAuthFromNetrc(u *url.URL) error { - // If the URL already has auth information, do nothing - if u.User != nil && u.User.Username() != "" { - return nil - } - - // Get the netrc file path - path := os.Getenv("NETRC") - if path == "" { - filename := ".netrc" - if runtime.GOOS == "windows" { - filename = "_netrc" - } - - var err error - path, err = homedir.Expand("~/" + filename) - if err != nil { - return err - } - } - - // If the file is not a file, then do nothing - if fi, err := os.Stat(path); err != nil { - // File doesn't exist, do nothing - if os.IsNotExist(err) { - return nil - } - - // Some other error! - return err - } else if fi.IsDir() { - // File is directory, ignore - return nil - } - - // Load up the netrc file - net, err := netrc.ParseFile(path) - if err != nil { - return fmt.Errorf("Error parsing netrc file at %q: %s", path, err) - } - - machine := net.FindMachine(u.Host) - if machine == nil { - // Machine not found, no problem - return nil - } - - // Set the user info - u.User = url.UserPassword(machine.Login, machine.Password) - return nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go deleted file mode 100644 index 618367619e..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/netrc_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package getter - -import ( - "net/url" - "testing" -) - -func TestAddAuthFromNetrc(t *testing.T) { - defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() - - u, err := url.Parse("http://example.com") - if err != nil { - t.Fatalf("err: %s", err) - } - - if err := addAuthFromNetrc(u); err != nil { - t.Fatalf("err: %s", err) - } - - expected := "http://foo:bar@example.com" - actual := u.String() - if expected != actual { - t.Fatalf("Mismatch: %q != %q", actual, expected) - } -} - -func TestAddAuthFromNetrc_hasAuth(t *testing.T) { - defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() - - u, err := url.Parse("http://username:password@example.com") - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := u.String() - if err := addAuthFromNetrc(u); err != nil { - t.Fatalf("err: %s", err) - } - - actual := u.String() - if expected != actual { - t.Fatalf("Mismatch: %q != %q", actual, expected) - } -} - -func TestAddAuthFromNetrc_hasUsername(t *testing.T) { - defer tempEnv(t, "NETRC", "./testdata/netrc/basic")() - - u, err := url.Parse("http://username@example.com") - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := u.String() - if err := addAuthFromNetrc(u); err != nil { - t.Fatalf("err: %s", err) - } - - actual := u.String() - if expected != actual { - t.Fatalf("Mismatch: %q != %q", actual, expected) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/source.go b/test/integration/licenses/github.com/hashicorp/go-getter/source.go deleted file mode 100644 index 48ac9234ed..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/source.go +++ /dev/null @@ -1,77 +0,0 @@ -package getter - -import ( - "fmt" - "path/filepath" - "strings" -) - -// SourceDirSubdir takes a source URL and returns a tuple of the URL without -// the subdir and the subdir. -// -// ex: -// dom.com/path/?q=p => dom.com/path/?q=p, "" -// proto://dom.com/path//*?q=p => proto://dom.com/path?q=p, "*" -// proto://dom.com/path//path2?q=p => proto://dom.com/path?q=p, "path2" -// -func SourceDirSubdir(src string) (string, string) { - - // URL might contains another url in query parameters - stop := len(src) - if idx := strings.Index(src, "?"); idx > -1 { - stop = idx - } - - // Calculate an offset to avoid accidentally marking the scheme - // as the dir. - var offset int - if idx := strings.Index(src[:stop], "://"); idx > -1 { - offset = idx + 3 - } - - // First see if we even have an explicit subdir - idx := strings.Index(src[offset:stop], "//") - if idx == -1 { - return src, "" - } - - idx += offset - subdir := src[idx+2:] - src = src[:idx] - - // Next, check if we have query parameters and push them onto the - // URL. - if idx = strings.Index(subdir, "?"); idx > -1 { - query := subdir[idx:] - subdir = subdir[:idx] - src += query - } - - return src, subdir -} - -// SubdirGlob returns the actual subdir with globbing processed. -// -// dst should be a destination directory that is already populated (the -// download is complete) and subDir should be the set subDir. If subDir -// is an empty string, this returns an empty string. -// -// The returned path is the full absolute path. -func SubdirGlob(dst, subDir string) (string, error) { - pattern := filepath.Join(dst, subDir) - - matches, err := filepath.Glob(pattern) - if err != nil { - return "", err - } - - if len(matches) == 0 { - return "", fmt.Errorf("subdir %q not found", subDir) - } - - if len(matches) > 1 { - return "", fmt.Errorf("subdir %q matches multiple paths", subDir) - } - - return matches[0], nil -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/source_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/source_test.go deleted file mode 100644 index c65f50f1b1..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/source_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package getter - -import ( - "io/ioutil" - "os" - "path/filepath" - "testing" -) - -func TestSourceDirSubdir(t *testing.T) { - cases := []struct { - Input string - Dir, Sub string - }{ - { - "hashicorp.com", - "hashicorp.com", "", - }, - { - "hashicorp.com//foo", - "hashicorp.com", "foo", - }, - { - "hashicorp.com//foo?bar=baz", - "hashicorp.com?bar=baz", "foo", - }, - { - "https://hashicorp.com/path//*?archive=foo", - "https://hashicorp.com/path?archive=foo", "*", - }, - { - "https://hashicorp.com/path?checksum=file:http://url.com/....iso.sha256", - "https://hashicorp.com/path?checksum=file:http://url.com/....iso.sha256", "", - }, - { - "https://hashicorp.com/path//*?checksum=file:http://url.com/....iso.sha256", - "https://hashicorp.com/path?checksum=file:http://url.com/....iso.sha256", "*", - }, - { - "file://foo//bar", - "file://foo", "bar", - }, - } - - for i, tc := range cases { - adir, asub := SourceDirSubdir(tc.Input) - if adir != tc.Dir { - t.Fatalf("%d: bad dir: %#v", i, adir) - } - if asub != tc.Sub { - t.Fatalf("%d: bad sub: %#v", i, asub) - } - } -} - -func TestSourceSubdirGlob(t *testing.T) { - td, err := ioutil.TempDir("", "subdir-glob") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(td) - - if err := os.Mkdir(filepath.Join(td, "subdir"), 0755); err != nil { - t.Fatal(err) - } - - if err := os.Mkdir(filepath.Join(td, "subdir/one"), 0755); err != nil { - t.Fatal(err) - } - - if err := os.Mkdir(filepath.Join(td, "subdir/two"), 0755); err != nil { - t.Fatal(err) - } - - subdir := filepath.Join(td, "subdir") - - // match the exact directory - res, err := SubdirGlob(td, "subdir") - if err != nil { - t.Fatal(err) - } - if res != subdir { - t.Fatalf(`expected "subdir", got: %q`, subdir) - } - - // single match from a wildcard - res, err = SubdirGlob(td, "*") - if err != nil { - t.Fatal(err) - } - if res != subdir { - t.Fatalf(`expected "subdir", got: %q`, subdir) - } - - // multiple matches - res, err = SubdirGlob(td, "subdir/*") - if err == nil { - t.Fatalf("expected multiple matches, got %q", res) - } - - // non-existent - res, err = SubdirGlob(td, "foo") - if err == nil { - t.Fatalf("expected no matches, got %q", res) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/storage.go b/test/integration/licenses/github.com/hashicorp/go-getter/storage.go deleted file mode 100644 index 2bc6b9ec33..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/storage.go +++ /dev/null @@ -1,13 +0,0 @@ -package getter - -// Storage is an interface that knows how to lookup downloaded directories -// as well as download and update directories from their sources into the -// proper location. -type Storage interface { - // Dir returns the directory on local disk where the directory source - // can be loaded from. - Dir(string) (string, bool, error) - - // Get will download and optionally update the given directory. - Get(string, string, bool) error -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-tar/permissions.tar b/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-tar/permissions.tar deleted file mode 100644 index 0c594eaa7e7ab851852532cb04543cc19bda8001..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3584 zcmeH|-425w4269Z-e9#*cpf)#Au*frXW8C<#hGa|nO;D$3wl$iq$%gi!P2$%(%;+H zDT@{WV2DKKv({qA0n58B++Pt0&Z4~!sBlkn^Kl`7^c>aLN|GVr$9GLlcwjW#> iqUX8?fI9a7_wT>X$M@f0^8Z@Lv`-2o1(E_G6?g+DMSD#E diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/permissions.zip b/test/integration/licenses/github.com/hashicorp/go-getter/test-fixtures/decompress-zip/permissions.zip deleted file mode 100644 index 40db777325da7ac539eacef2854999d3c10a0227..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 808 zcmWIWW@h1H00F@Wet$3nN^mjAFr;J_r6!l;7gg$qhHx@4PbvD5_Zi1MSt#3W7ishT+y-#aw~TztQjxTnl6-4PFroHHbN?6q&x_hwX4zn7EXO^<$4L{ zrf%Ej%YBcguG@v@d>%?<=roHW<^Mi;SA=KC@s9XCytPaD`&s@@*_gk~(ahYR=RX90 z+`9|xCH?<8>jGFY|E)59nEw^?e-l&wITyf+`9J3G;v!)FZ-My_0000000000006(? M1-c8Wy8tKv0H{@EKmY&$ diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted/archive.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive-rooted/archive.tar.gz deleted file mode 100644 index 038bdf847a401deaee21693ead822452c37fe2c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 173 zcmb2|=3r1zTNTN`{Pv-cch_>M@+bc}&gFiU5BppFw&;J5@|j!nzuSxN W|6R((fDG diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/archive.tar.gz deleted file mode 100644 index 999e5fc9d6974cb108aa94abadac6e2aecfac0dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 141 zcmb2|=3qGQG&PKY`RxTqu4V_G*2L?!u6_YV$#X3GJ=j^-Ug-NCzIsRYLT=60|F>wZ`SUo>_I@-|6W0$D QtU3%5&rQtC(0BXk*g#Z8m diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt deleted file mode 100644 index 86df9aae0f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/last-message.txt +++ /dev/null @@ -1,2 +0,0 @@ -add file - diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires deleted file mode 100644 index f634f664bf..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/requires +++ /dev/null @@ -1,4 +0,0 @@ -dotencode -fncache -revlogv1 -store diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00changelog.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00changelog.i deleted file mode 100644 index 6da1bc1e97dc6dad8799cbab64e2ea8a9273e438..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 528 zcmZQzWME`~fC3;@4P`U@hk`rnu9x~osQK(%Ix$Ifsf%*CLG?wL8W3GE$Mm!#7qcRd z!^OSJKd?;72omwqEV=B=^>}vhYRG!~=>ejxFxg7V^;JV-L`jXd&PhOer=+rTh@j}%%hBW{9?W+v?SN{IR z{@{bE57=&yOBoo7fp{vI#Q^aG$jQgzX7-lU|K9k|T86DEAkBO8@7N_!HDIb@PI3YR zv#)^P79V5JjV5N>P0anhjJ6qgZ}Zq_;$`M-WN75M$-vNWlaJ394$K# z%*;#-O*U-UU|?zE~8+H~68-ISJn6r11$%Jn~3hUUC z%+xn%FqHDjM}qBr3?_4dWDyWEK`}U(XR5ITRG&>V=l&_hGdC#bY_o~bez0mNQ87pK zgf$N@+y2{m{(Q$;`N}?Z3m1{Z?3)#zt~H&jT(g%UNz*NQ Kz5P)IrG)?+$-hnj diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00manifest.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/00manifest.i deleted file mode 100644 index 48ce4c674b153195539f398ff1e1eb6aea7bda89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmZQzWME`~03#q}2xT+;hXRIf+oy9R`GtjZS|7jmaf#B=uR&8JsyZaZ;PC)>%p#d_9?E$&b?Fbd>K5VinW9-mZ{n3tRZc7ugMN~&p! zp|ORzsfDSDVX|qOfvJ(1X<~|@iAiFTWm=+zS&Csw62uKC|%t=mYU_QL%PtD#*T|#Wao1Z*!=}z(P-jZ_J srFo0UX_aE<#UkBHRGLGKPpbrbE0~yU@GyMNl*#nSXF?u>nHJwY03C2?ssI20 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/foo.txt.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/foo.txt.i deleted file mode 100644 index 974eb7aede8a04f08905786459e9c21251b121d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 71 zcmZQzWME`~0Cph724yq-hXS`VD^B(wUGR5yp>FqvXR{+C139ik)qtr|kJOx;d@caL CG!@7I diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main.tf.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main.tf.i deleted file mode 100644 index f45ddc33f19db6ef2a8f723ce4e36e10db12a436..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 112 zcmZQzWME`~00SVU4`nm_hk{)i%ZqQMPS2Zr>zb=wCx2OxuW=Ym4TvsPR`5v8$;s#9 n%FRzH%}G^IO3TkzQmE!q0D|KD(xT*41zQCrJ$;ZcS1lI+ym=or diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main__branch.tf.i b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/data/main__branch.tf.i deleted file mode 100644 index a6bdf46f1091be151835fda73ea8ccb9f8c70c21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 64 ocmZQzWME{#1dRWoUQPrLGn6+WD*P;%#K*02?S1MgRZ+ diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache deleted file mode 100644 index b634e1f3ab..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/fncache +++ /dev/null @@ -1,3 +0,0 @@ -data/main.tf.i -data/foo.txt.i -data/main_branch.tf.i diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots deleted file mode 100644 index a08565294c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/phaseroots +++ /dev/null @@ -1 +0,0 @@ -1 dcaed7754d58264cb9a5916215a5442377307bd1 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/.hg/store/undo deleted file mode 100644 index 4fae5607035311eebbdaf33e347ec9edcda6e465..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmYdEEJ@T)%g@&xT(e P9R`W#CT8a8m81ax#aSAk diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt deleted file mode 100644 index e965047ad7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/foo.txt +++ /dev/null @@ -1 +0,0 @@ -Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf deleted file mode 100644 index 3830637158..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-hg/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "foo" { - source = "./foo" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf deleted file mode 100644 index b9b44f4640..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/a/a.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "b" { - source = "../c" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf deleted file mode 100644 index fec56017dc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/c/c.tf +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf deleted file mode 100644 index 2326ee22ac..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-parent/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "a" { - source = "./a" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/baz/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/baz/main.tf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf deleted file mode 100644 index 22905dd531..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/foo/sub/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "bar" { - source = "./baz" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf deleted file mode 100644 index 19fb5dde7f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-subdir/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "foo" { - source = "./foo//sub" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf deleted file mode 100644 index fec56017dc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic-tgz/main.tf +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf deleted file mode 100644 index fec56017dc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/foo/main.tf +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf deleted file mode 100644 index 3830637158..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "foo" { - source = "./foo" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/subdir/sub.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/basic/subdir/sub.tf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt deleted file mode 100644 index 13c6d88677..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/content.txt +++ /dev/null @@ -1 +0,0 @@ -I am a file with some content diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum deleted file mode 100644 index 807f6aa162..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-bad.sum +++ /dev/null @@ -1 +0,0 @@ -MD5 (content.txt) = bad diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum deleted file mode 100644 index 8cc6007f14..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd-wrong.sum +++ /dev/null @@ -1 +0,0 @@ -MD5 (content.txt) = 074729f0ccb41a391fb646c38f86ea53 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum deleted file mode 100644 index bc1c6ad3e4..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-bsd.sum +++ /dev/null @@ -1 +0,0 @@ -MD5 (content.txt) = 074729f0ccb41a391fb646c38f86ea54 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum deleted file mode 100644 index d6c61d90fa..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/md5-p.sum +++ /dev/null @@ -1 +0,0 @@ -074729f0ccb41a391fb646c38f86ea54 content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum deleted file mode 100644 index 5212fddbe3..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1-p.sum +++ /dev/null @@ -1 +0,0 @@ -e2c7dc83ac8aa7f181314387f6dfb132cd117e3a ?content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum deleted file mode 100644 index 0910848521..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha1.sum +++ /dev/null @@ -1 +0,0 @@ -e2c7dc83ac8aa7f181314387f6dfb132cd117e3a diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum deleted file mode 100644 index f782865716..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha256-p.sum +++ /dev/null @@ -1 +0,0 @@ -47afcdfff05a6e5d9db5f6c6df2140f04a6e7422d7ad7f6a7006a4f5a78570e4 ?content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum deleted file mode 100644 index 2c72e88172..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p-EOF.sum +++ /dev/null @@ -1 +0,0 @@ -060a8cc41c501e41b4537029661090597aeb4366702ac3cae8959f24b2c49005d6bd339833ebbeb481b127ac822d70b937c1637c8d0eaf81b6979d4c1d75d0e1 \ No newline at end of file diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum deleted file mode 100644 index c99a7dc3b0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/checksum-file/sha512-p.sum +++ /dev/null @@ -1 +0,0 @@ -060a8cc41c501e41b4537029661090597aeb4366702ac3cae8959f24b2c49005d6bd339833ebbeb481b127ac822d70b937c1637c8d0eaf81b6979d4c1d75d0e1 ?content.txt diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf deleted file mode 100644 index df59275018..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/bar/main.tf +++ /dev/null @@ -1,2 +0,0 @@ -# Hello - diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf deleted file mode 100644 index 548d21b99d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/foo/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "bar" { - source = "./bar" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf deleted file mode 100644 index 3830637158..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/child/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -# Hello - -module "foo" { - source = "./foo" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-bz2/single.bz2 b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-bz2/single.bz2 deleted file mode 100644 index 63d21a073723dfe5f5c1a12066087fe670213ab9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40 wcmZ>Y%CIzaj8qGbEc>?kDFXw;K?Vi^Mur6piZdizBw|mBJalrree3)b00(*wbpQYW diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-gz/single.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-gz/single.gz deleted file mode 100644 index 00754d02d1b766c6fe83562c04e4a1a3c389596d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29 kcmb2|=HL+Yn;OQzoR*oB%HVza{BtIT6{$vbEDQ_`0DQX$Hvj+t diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/extended_header.tar b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/extended_header.tar deleted file mode 100644 index aed74f06a99600f4368bf0f93ab297d081ce74d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10240 zcmeIyOK!s;5C&k@Jw5uwHyVHV zuk~h|gWs-SlaHye+c!?l7{h8$t?enOn2^#ct?HHHLg~S>&Fw$sbjQ#Ay0i+cS3{6ap z3>g#*XyF)iGfRt05{rON%SuWtO3BPamxl9!%F@!{JWK}EA0STxfdZz2!6}l068}jw eaU?K2NRNM`(fFrHWQ-a*8UmvsFd72T5C8xrgEKz> diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/unix_time_0.tar b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tar/unix_time_0.tar deleted file mode 100644 index 67cb72e1aa3fb85ed20b5bbdeb6b79135d99584f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10240 zcmeIy(F(#K7=~dl#XHEMZr9_|gCGjr26gxChZeSz7|ft}{}bIDPM%MVr<{)CHQx`a zTA8^z@73Hioi}AGLsIf?DP_UhwxVL;Pis2^YX z4^v-h4@j`v@^{ua^8dy*de1*p`K9FFI#-_iwmC z3TK~333zkY%CIzaj8qGbjI7@Agn>aMfZ+fG3j+g(0)xRBR?TI?N$TA@mF8%8=kY5~ diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/multiple.tar.bz2 b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/multiple.tar.bz2 deleted file mode 100644 index 1d59e6ad2ce760bf7ff834cee8570812ae501c24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166 zcmV;X09pS+T4*^jL0KkKS*=**^Z)>``;gHP2#`Pke}Di8Yi6DR1ONaiFaWqlG{j*V zU;qHdn2aM#000G2H8h%;lru)7C#jS5O`9*CnlxbJKvO7z7UyBRg2+OM-B@PTMx>`H zWZ)vlH64^mMhc_9WTiTM;^eF)#j7-}RthNzu1dCASsqclX3q}yyBF&hr=||A9vHbi UuDR^Hq9EA2k}1N3g=)typwQSw`2YX_ diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/ordering.tar.bz2 b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tbz2/ordering.tar.bz2 deleted file mode 100644 index 46f0d814a6e18920c439ff7eef39b7bedc5fb548..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 248 zcmVOD-F4K(#MXu!&8#Bv_bi;JH=ZKGGC^f)Isdsi{!^-KYv^%{>s%x`!D*mO0S#*Wbg{9VZu;X*<)AdK{;By2NC#0hYyhCR~w{Pwah*C7LewukF%UHc4vzO8hz+9IHtv3LJQ!E(`&M))_)b(-tu-EZ2c*ZQKSU{X&+{@V9FCik+x?$Cc89r@HscY5K8 z$~!Z(lUK#RTPbfi--cuE^UL?F6YQgYy_eemG5Y`STmL=&|8M-q%zywgw}qcRy!Dnr HgMk46B&J9$ diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple_dir.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/multiple_dir.tar.gz deleted file mode 100644 index 452e6bef19f6217c11449ce77a70a432a9190076..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 194 zcmV;z06qU7iwFSozTH*;1MSpJ3c@fDhT*O~MNZJ>XPREYYlybAP!ZaAe`8xj1Pd-= z5#MJsn~+TMG0BTlHxyY?TI;GT)l~glwUxOpl(F7d&Q(rCY2%EQOqFTdnq9|m7-B2u zE*#ss@7p));#SKcmDqWJL{SMZ(#lb0000000000008)XH_0s6MgS-P0PK!n(*OVf diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/ordering.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/ordering.tar.gz deleted file mode 100644 index 4f6dcc3b66bfe30061b47b5e07144afdbb7e4573..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 187 zcmV;s07U;EiwFSs_25_l1MQQ`3c@fDMZ5MZ0`BePG0Eoy7g-e1)+Ac|`;JJp3m*s# zMVzy_kOy;z%kA5^3o+IEW9@x&XtMX4?o!PP09a!LsdNZa9kD`cuudTwX$45D04o9W z+IY?>yNO`A?4N5E|{h0AN?;jgZkhQ-}N7^{daV%92)As pp%0b7VvZ*KdH=`!OV0Qvf8`YAuMKL>pJ5oLBm>PK6tVye0067xT!{bx diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/outside_parent.tar.gz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tgz/outside_parent.tar.gz deleted file mode 100644 index 52cb14d0f88e3c1f9c67dfcf73c937936407535f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 192 zcmb2|=HQrSx-*LDe?fk-UP)pR!`sVy`I-zw+8&;ZaqYF9BKAtRg8keHe=nvh4EOf4 z#>(&rtIhfzxo=^7QPHe97JjRCegAlNdXm1@2Cuc1n|{vnN8 jr&}fb-%W8(Id3m`{Nu;hd<@8-;dPo|NzQQw4F(1PJX<=r diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/empty.tar.xz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/empty.tar.xz deleted file mode 100644 index 94451c0687f5871d650ec1e6dfc9fd00c032f6ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmV-y0F(dyH+ooF000E$*0e?f03iVu0001VFXf})C;tE}T>t=Y{r~@?xBo{zNELE9 zVNtk}DCVPv2l?*g9)i;^#X39zOR;{*id-@qWB>rK7!tEDRm?L00Z4#Q0002&vv0N!GYZUQ($2I#_b} z>oC8b$t$R`$L5H0txlV3Gj>X*7jOQ&v-S~xRZ+I?mmU+DN_)jdidSaZK1JO;z@xQ6 zu)zRW3@yQs#S#iJfyqh*8@T0;IH#3@>7JxKW^2e6i_G18X1Mw%c*eEd?^=Yx^VZPs zIgTybN-2N@X)m+k!1Ul#i>B5f0002BTz1gOS!vM#0jB|gPyhh1M9F)x#Ao{g00000 G1X)^tK3-M; diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple_dir.tar.xz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-txz/multiple_dir.tar.xz deleted file mode 100644 index 8de936c932d62d1c21daddf504ef15e6fcb76ab9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmVuvg$p>;GD6-*?fXk_4 zLp)$A(3sti>x9gailfrxDUVh_C+0rWf^Q#*N}bkddwrw?iLm)N7qK#9i{dPy&7kxWEjKG;S~A9T75{2rPr~))vmEO}%p@rTR$Bv|q%Bx?eo6L#%ohPT1 z__aqTq|yGI?x~}Sn?PGj=GnGjd@FD+5yzBm!qk6MKo%bQe^Z>xjevjhp^{@vp@_Vt z(omRw;C61&VoCeO3n43`_gjq5s4>DAQI*};4Y4sJsfMrM#Yx4+h<4-V-3OIy5C$ix zGBjv7pc+QVQO32_#&hFqUD;SnJm>%JA7)QEvv0N!GSFA+G`1uT>U5 za7vQNgao|r!+F=n80t5DLLSeS0L|^9a?Y2%4qgdJt07g7g7G~mxKA%W?prH*UZqb2u;#buVN=izs`L$R1r1;JvwLlPBx2j2n zhut#(5(@klm{bh>@-Q3r${&s+m}iA}Ct3cx5c9w7EYc7luv6Os{oljbdNA+8y{#*klBug9tVu{5BYy4ld<9LwjYSK{Tpom3OUD%zqb#WKa+R79b!4 zqqxuk{oRAHT%7~R1jz^gw`KNJH<)U=iy28%2QUN)r!XwAl!10p3Be?sg$Hx@GCDaU HjbMqH8T3J+ diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/ordering.tar.zst b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/ordering.tar.zst deleted file mode 100644 index d9cbbeeefc3ac468495999a5dec089e17fa593d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 164 zcmV;V09*ekwJ-eyV7&wYf=3q_fT;~Y*zQIxL)?oKGNB}WZjz5G95$Pg0_9rJmzzKP zTG6N9T=e>1+h%~J&EE5g^cO?froVV=CDW2N*+6oN(1iC=?j3T__P++=N||N&-`5 FVvE3mK#c$Z diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/single.tar.zst b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-tzst/single.tar.zst deleted file mode 100644 index 551371c387edb9e965aee440d95469b7fe2b434e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 104 zcmV-u0GIzLwJ-eyVBG=$(u5BbkO2nJ Kr=SH^v;eulpD`f- diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-xz/single.xz b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-xz/single.xz deleted file mode 100644 index 33d92e2b8bfd8fda39305b2754ecaa80383c4f58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60 zcmexsUKJ6=z`*kC+7>q^21Q0O1_p)_{ill=8JN@Z^SK!QUtbetU^wR!1EUN}zRsM3 Q^4mVwG6K~wutY`y07|YBvj6}9 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/empty.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/empty.zip deleted file mode 100644 index 15cb0ecb3e219d1701294bfdf0fe3f5cb5d208e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22 NcmWIWW@Tf*000g10H*)| diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/multiple.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/multiple.zip deleted file mode 100644 index a032181d43b89865241dd9e1d05dc5712706267d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 306 zcmWIWW@h1H0D%o5Ivy)hjp|r{Y!GH;kYPy6%tzw+5H!Mwun~+*a?H5gApx|AfdObG!;(f23+gIXh^x?C6yQy)QO;1KfUd)3 S6e}CZJ|-ZX2Bh0S90mY1;x;}2 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/outside_parent.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/outside_parent.zip deleted file mode 100644 index bafd7d6f361b997b579bdda1feb4c1269a78ff47..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 237 zcmWIWW@Zs#0D&!$RX%Erf*#U9HVAVAv7VlON@{MtUO|4cvZ8)cW}bd=23KlwM!tea zYEDkRLU?{rP6}55iWxv{aKH{^6N4fcr!AIFypogrl+A1#6q$dT_a2(hz6Mt Z0}YKXKqlNaRyL3X6AY!-u%r>hf|$q(F%iwQ0B=?{kQzoH^a9dOAPxfna#|Ph diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir.zip deleted file mode 100644 index 9fafb407d5aadff1697c141514b8042eab118b4f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 466 zcmWIWW@h1H0D-kdr5*|fR%UEKHVCsa$S|a3=A;^ihHx@4UrYTE_7#XrE4UdLS-vtd zFtCUK6=kI6V-N;xL~{iX!hqzA z%$yXkDffU50bw*#V2)vAl4Hi@Cke3AfX-)F(gGeFia#fkA-b wt)nZ@D7Zg?hGF$1!Z1u%VHniUKoha}H^7?}6j2P!K==wsUjlI$0OR^sn*aa+ diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_empty.zip b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zip/subdir_empty.zip deleted file mode 100644 index d95cb90d2a3cc524cfafedcf83bb38b60ca0b43a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 308 zcmWIWW@h1H0D-kdr5*|fR%UEKHVCsa$S|a3=A;^ihHx@4UrYTEmXr1&th9ogfsy4a zBLf4A2vAW*YEDi*R{-3Q-#|lv!f?P2G^DsRDJ8Q=A8bq}(1>D8V*zabkcsD=26fn1FCDke&$Q GFaQ8720M)a diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zst/single.zst b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/decompress-zst/single.zst deleted file mode 100644 index 5a56316bf434503831e56eb69600d6f0392eb521..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 YcmdPcs{dDoMUjCaEkB=2H&jIe04*m3UjP6A diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/detect-file-symlink-pwd/real/hello.txt b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/detect-file-symlink-pwd/real/hello.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/foo/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/foo/main.tf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf deleted file mode 100644 index 98efd6e4ff..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/dup/main.tf +++ /dev/null @@ -1,7 +0,0 @@ -module "foo" { - source = "./foo" -} - -module "foo" { - source = "./foo" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic deleted file mode 100644 index 574dd49ac5..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/netrc/basic +++ /dev/null @@ -1,3 +0,0 @@ -machine example.com -login foo -password bar diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf deleted file mode 100644 index 4d68c80b3e..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/child/main.tf +++ /dev/null @@ -1 +0,0 @@ -variable "memory" { default = "foo" } diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf deleted file mode 100644 index 4b627bbe57..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output-to-module/main.tf +++ /dev/null @@ -1,8 +0,0 @@ -module "child" { - source = "./child" -} - -module "child2" { - source = "./child" - memory = "${module.child.memory_max}" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/child/main.tf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf deleted file mode 100644 index a19233e12d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-output/main.tf +++ /dev/null @@ -1,7 +0,0 @@ -module "child" { - source = "./child" -} - -resource "aws_instance" "foo" { - memory = "${module.child.memory}" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/child/main.tf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf deleted file mode 100644 index 7cc785d178..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-bad-var/main.tf +++ /dev/null @@ -1,5 +0,0 @@ -module "child" { - source = "./child" - - memory = "foo" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf deleted file mode 100644 index 93b3654033..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/child/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -# Duplicate resources -resource "aws_instance" "foo" {} -resource "aws_instance" "foo" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf deleted file mode 100644 index 813f7ef8ec..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-bad/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "foo" { - source = "./child" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf deleted file mode 100644 index 2cfd2a80f5..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/child/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -variable "memory" {} - -output "result" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf deleted file mode 100644 index 5f3ad8da5b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-child-good/main.tf +++ /dev/null @@ -1,8 +0,0 @@ -module "child" { - source = "./child" - memory = "1G" -} - -resource "aws_instance" "foo" { - memory = "${module.child.result}" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf deleted file mode 100644 index 618ae3c42e..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/child/main.tf +++ /dev/null @@ -1 +0,0 @@ -variable "memory" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf deleted file mode 100644 index 0f6991c536..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-required-var/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -module "child" { - source = "./child" -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf b/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf deleted file mode 100644 index 93b3654033..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/testdata/validate-root-bad/main.tf +++ /dev/null @@ -1,3 +0,0 @@ -# Duplicate resources -resource "aws_instance" "foo" {} -resource "aws_instance" "foo" {} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/url.go b/test/integration/licenses/github.com/hashicorp/go-getter/url.go deleted file mode 100644 index a9aed7f508..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/url.go +++ /dev/null @@ -1,25 +0,0 @@ -package getter - -import "net/url" - -// RedactURL is a port of url.Redacted from the standard library, -// which is like url.String but replaces any password with "redacted". -// Only the password in u.URL is redacted. This allows the library -// to maintain compatibility with go1.14. -// This port was also extended to redact SSH key from URL query parameter. -func RedactURL(u *url.URL) string { - if u == nil { - return "" - } - - ru := *u - if _, has := ru.User.Password(); has { - ru.User = url.UserPassword(ru.User.Username(), "redacted") - } - q := ru.Query() - if q.Get("sshkey") != "" { - q.Set("sshkey", "redacted") - ru.RawQuery = q.Encode() - } - return ru.String() -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/url_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/url_test.go deleted file mode 100644 index 720359e5c7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/url_test.go +++ /dev/null @@ -1,95 +0,0 @@ -package getter - -import ( - "net/url" - "testing" -) - -func TestRedactURL(t *testing.T) { - cases := []struct { - name string - url *url.URL - want string - }{ - { - name: "non-blank Password", - url: &url.URL{ - Scheme: "http", - Host: "host.tld", - Path: "this:that", - User: url.UserPassword("user", "password"), - }, - want: "http://user:redacted@host.tld/this:that", - }, - { - name: "blank Password", - url: &url.URL{ - Scheme: "http", - Host: "host.tld", - Path: "this:that", - User: url.User("user"), - }, - want: "http://user@host.tld/this:that", - }, - { - name: "nil User", - url: &url.URL{ - Scheme: "http", - Host: "host.tld", - Path: "this:that", - User: url.UserPassword("", "password"), - }, - want: "http://:redacted@host.tld/this:that", - }, - { - name: "blank Username, blank Password", - url: &url.URL{ - Scheme: "http", - Host: "host.tld", - Path: "this:that", - }, - want: "http://host.tld/this:that", - }, - { - name: "empty URL", - url: &url.URL{}, - want: "", - }, - { - name: "nil URL", - url: nil, - want: "", - }, - { - name: "non-blank SSH key in URL query parameter", - url: &url.URL{ - Scheme: "ssh", - User: url.User("git"), - Host: "github.com", - Path: "hashicorp/go-getter-test-private.git", - RawQuery: "sshkey=LS0tLS1CRUdJTiBPUE", - }, - want: "ssh://git@github.com/hashicorp/go-getter-test-private.git?sshkey=redacted", - }, - { - name: "blank SSH key in URL query parameter", - url: &url.URL{ - Scheme: "ssh", - User: url.User("git"), - Host: "github.com", - Path: "hashicorp/go-getter-test-private.git", - RawQuery: "sshkey=", - }, - want: "ssh://git@github.com/hashicorp/go-getter-test-private.git?sshkey=", - }, - } - - for _, tt := range cases { - t := t - t.Run(tt.name, func(t *testing.T) { - if g, w := RedactURL(tt.url), tt.want; g != w { - t.Fatalf("got: %q\nwant: %q", g, w) - } - }) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-getter/util_test.go b/test/integration/licenses/github.com/hashicorp/go-getter/util_test.go deleted file mode 100644 index a3e7d829cb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-getter/util_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package getter - -import ( - "io" - "io/ioutil" - "os" - "strings" - "testing" -) - -// tempEnv sets the env var temporarily and returns a function that should -// be deferred to clean it up. -func tempEnv(t *testing.T, k, v string) func() { - old := os.Getenv(k) - - // Set env - if err := os.Setenv(k, v); err != nil { - t.Fatalf("err: %s", err) - } - - // Easy cleanup - return func() { - if err := os.Setenv(k, old); err != nil { - t.Fatalf("err: %s", err) - } - } -} - -// tempFileContents writes a temporary file and returns the path and a function -// to clean it up. -func tempFileContents(t *testing.T, contents string) (string, func()) { - tf, err := ioutil.TempFile("", "getter") - if err != nil { - t.Fatalf("err: %s", err) - } - - if _, err := io.Copy(tf, strings.NewReader(contents)); err != nil { - t.Fatalf("err: %s", err) - } - - tf.Close() - - path := tf.Name() - return path, func() { - if err := os.Remove(path); err != nil { - t.Fatalf("err: %s", err) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE b/test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE deleted file mode 100644 index be2cc4dfb6..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-safetemp/LICENSE +++ /dev/null @@ -1,362 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/README.md b/test/integration/licenses/github.com/hashicorp/go-safetemp/README.md deleted file mode 100644 index 02ece33171..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-safetemp/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# go-safetemp -[![Godoc](https://godoc.org/github.com/hashcorp/go-safetemp?status.svg)](https://godoc.org/github.com/hashicorp/go-safetemp) - -Functions for safely working with temporary directories and files. - -## Why? - -The Go standard library provides the excellent `ioutil` package for -working with temporary directories and files. This library builds on top -of that to provide safe abstractions above that. diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod b/test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod deleted file mode 100644 index 02bc5f5bb5..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-safetemp/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/hashicorp/go-safetemp diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go b/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go deleted file mode 100644 index c4ae72b789..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp.go +++ /dev/null @@ -1,40 +0,0 @@ -package safetemp - -import ( - "io" - "io/ioutil" - "os" - "path/filepath" -) - -// Dir creates a new temporary directory that isn't yet created. This -// can be used with calls that expect a non-existent directory. -// -// The directory is created as a child of a temporary directory created -// within the directory dir starting with prefix. The temporary directory -// returned is always named "temp". The parent directory has the specified -// prefix. -// -// The returned io.Closer should be used to clean up the returned directory. -// This will properly remove the returned directory and any other temporary -// files created. -// -// If an error is returned, the Closer does not need to be called (and will -// be nil). -func Dir(dir, prefix string) (string, io.Closer, error) { - // Create the temporary directory - td, err := ioutil.TempDir(dir, prefix) - if err != nil { - return "", nil, err - } - - return filepath.Join(td, "temp"), pathCloser(td), nil -} - -// pathCloser implements io.Closer to remove the given path on Close. -type pathCloser string - -// Close deletes this path. -func (p pathCloser) Close() error { - return os.RemoveAll(string(p)) -} diff --git a/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go b/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go deleted file mode 100644 index 6f7155c647..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-safetemp/safetemp_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package safetemp - -import ( - "os" - "path/filepath" - "testing" -) - -func TestDir(t *testing.T) { - d, c, err := Dir("", "test") - if err != nil { - t.Fatalf("err: %s", err) - } - - if _, err := os.Stat(d); err == nil || !os.IsNotExist(err) { - t.Fatalf("directory %q should not exist", d) - } - - parent := filepath.Dir(d) - fi, err := os.Stat(parent) - if err != nil { - t.Fatalf("parent directory error: %s", err) - } - if v := fi.Mode().Perm();v != 0700 { - t.Fatalf("parent directory should be 0700: %s", v) - } - - // Create the directory - if err := os.MkdirAll(d, 0755); err != nil { - t.Fatalf("err: %s", err) - } - if _, err := os.Stat(d); err != nil { - t.Fatalf("directory %q should exist", d) - } - - // Close should remove it - if err := c.Close(); err != nil { - t.Fatalf("err: %s", err) - } - if _, err := os.Stat(d); err == nil || !os.IsNotExist(err) { - t.Fatalf("directory %q should not exist", d) - } - if _, err := os.Stat(parent); err == nil || !os.IsNotExist(err) { - t.Fatalf("directory %q should not exist", parent) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml b/test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml deleted file mode 100644 index 7289c6b0a9..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/.circleci/config.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 2.1 - -references: - images: - go: &GOLANG_IMAGE circleci/golang:latest - environments: - tmp: &TEST_RESULTS_PATH /tmp/test-results # path to where test results are saved - -# reusable 'executor' object for jobs -executors: - go: - docker: - - image: *GOLANG_IMAGE - environment: - - TEST_RESULTS: *TEST_RESULTS_PATH - -jobs: - go-test: - executor: go - steps: - - checkout - - run: mkdir -p $TEST_RESULTS - - - restore_cache: # restore cache from dev-build job - keys: - - go-version-modcache-v1-{{ checksum "go.mod" }} - - - run: go mod download - - # Save go module cache if the go.mod file has changed - - save_cache: - key: go-version-modcache-v1-{{ checksum "go.mod" }} - paths: - - "/go/pkg/mod" - - # check go fmt output because it does not report non-zero when there are fmt changes - - run: - name: check go fmt - command: | - files=$(go fmt ./...) - if [ -n "$files" ]; then - echo "The following file(s) do not conform to go fmt:" - echo "$files" - exit 1 - fi - - # run go tests with gotestsum - - run: | - PACKAGE_NAMES=$(go list ./...) - gotestsum --format=short-verbose --junitfile $TEST_RESULTS/gotestsum-report.xml -- $PACKAGE_NAMES - - store_test_results: - path: *TEST_RESULTS_PATH - - store_artifacts: - path: *TEST_RESULTS_PATH - -workflows: - version: 2 - test-and-build: - jobs: - - go-test diff --git a/test/integration/licenses/github.com/hashicorp/go-version/LICENSE b/test/integration/licenses/github.com/hashicorp/go-version/LICENSE deleted file mode 100644 index c33dcc7c92..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/test/integration/licenses/github.com/hashicorp/go-version/README.md b/test/integration/licenses/github.com/hashicorp/go-version/README.md deleted file mode 100644 index 851a337beb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Versioning Library for Go -[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/master) -[![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version) - -go-version is a library for parsing versions and version constraints, -and verifying versions against a set of constraints. go-version -can sort a collection of versions properly, handles prerelease/beta -versions, can increment versions, etc. - -Versions used with go-version must follow [SemVer](http://semver.org/). - -## Installation and Usage - -Package documentation can be found on -[GoDoc](http://godoc.org/github.com/hashicorp/go-version). - -Installation can be done with a normal `go get`: - -``` -$ go get github.com/hashicorp/go-version -``` - -#### Version Parsing and Comparison - -```go -v1, err := version.NewVersion("1.2") -v2, err := version.NewVersion("1.5+metadata") - -// Comparison example. There is also GreaterThan, Equal, and just -// a simple Compare that returns an int allowing easy >=, <=, etc. -if v1.LessThan(v2) { - fmt.Printf("%s is less than %s", v1, v2) -} -``` - -#### Version Constraints - -```go -v1, err := version.NewVersion("1.2") - -// Constraints example. -constraints, err := version.NewConstraint(">= 1.0, < 1.4") -if constraints.Check(v1) { - fmt.Printf("%s satisfies constraints %s", v1, constraints) -} -``` - -#### Version Sorting - -```go -versionsRaw := []string{"1.1", "0.7.1", "1.4-beta", "1.4", "2"} -versions := make([]*version.Version, len(versionsRaw)) -for i, raw := range versionsRaw { - v, _ := version.NewVersion(raw) - versions[i] = v -} - -// After this, the versions are properly sorted -sort.Sort(version.Collection(versions)) -``` - -## Issues and Contributing - -If you find an issue with this library, please report an issue. If you'd -like, we welcome any contributions. Fork this library and submit a pull -request. diff --git a/test/integration/licenses/github.com/hashicorp/go-version/constraint.go b/test/integration/licenses/github.com/hashicorp/go-version/constraint.go deleted file mode 100644 index d055759611..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/constraint.go +++ /dev/null @@ -1,204 +0,0 @@ -package version - -import ( - "fmt" - "reflect" - "regexp" - "strings" -) - -// Constraint represents a single constraint for a version, such as -// ">= 1.0". -type Constraint struct { - f constraintFunc - check *Version - original string -} - -// Constraints is a slice of constraints. We make a custom type so that -// we can add methods to it. -type Constraints []*Constraint - -type constraintFunc func(v, c *Version) bool - -var constraintOperators map[string]constraintFunc - -var constraintRegexp *regexp.Regexp - -func init() { - constraintOperators = map[string]constraintFunc{ - "": constraintEqual, - "=": constraintEqual, - "!=": constraintNotEqual, - ">": constraintGreaterThan, - "<": constraintLessThan, - ">=": constraintGreaterThanEqual, - "<=": constraintLessThanEqual, - "~>": constraintPessimistic, - } - - ops := make([]string, 0, len(constraintOperators)) - for k := range constraintOperators { - ops = append(ops, regexp.QuoteMeta(k)) - } - - constraintRegexp = regexp.MustCompile(fmt.Sprintf( - `^\s*(%s)\s*(%s)\s*$`, - strings.Join(ops, "|"), - VersionRegexpRaw)) -} - -// NewConstraint will parse one or more constraints from the given -// constraint string. The string must be a comma-separated list of -// constraints. -func NewConstraint(v string) (Constraints, error) { - vs := strings.Split(v, ",") - result := make([]*Constraint, len(vs)) - for i, single := range vs { - c, err := parseSingle(single) - if err != nil { - return nil, err - } - - result[i] = c - } - - return Constraints(result), nil -} - -// Check tests if a version satisfies all the constraints. -func (cs Constraints) Check(v *Version) bool { - for _, c := range cs { - if !c.Check(v) { - return false - } - } - - return true -} - -// Returns the string format of the constraints -func (cs Constraints) String() string { - csStr := make([]string, len(cs)) - for i, c := range cs { - csStr[i] = c.String() - } - - return strings.Join(csStr, ",") -} - -// Check tests if a constraint is validated by the given version. -func (c *Constraint) Check(v *Version) bool { - return c.f(v, c.check) -} - -func (c *Constraint) String() string { - return c.original -} - -func parseSingle(v string) (*Constraint, error) { - matches := constraintRegexp.FindStringSubmatch(v) - if matches == nil { - return nil, fmt.Errorf("Malformed constraint: %s", v) - } - - check, err := NewVersion(matches[2]) - if err != nil { - return nil, err - } - - return &Constraint{ - f: constraintOperators[matches[1]], - check: check, - original: v, - }, nil -} - -func prereleaseCheck(v, c *Version) bool { - switch vPre, cPre := v.Prerelease() != "", c.Prerelease() != ""; { - case cPre && vPre: - // A constraint with a pre-release can only match a pre-release version - // with the same base segments. - return reflect.DeepEqual(c.Segments64(), v.Segments64()) - - case !cPre && vPre: - // A constraint without a pre-release can only match a version without a - // pre-release. - return false - - case cPre && !vPre: - // OK, except with the pessimistic operator - case !cPre && !vPre: - // OK - } - return true -} - -//------------------------------------------------------------------- -// Constraint functions -//------------------------------------------------------------------- - -func constraintEqual(v, c *Version) bool { - return v.Equal(c) -} - -func constraintNotEqual(v, c *Version) bool { - return !v.Equal(c) -} - -func constraintGreaterThan(v, c *Version) bool { - return prereleaseCheck(v, c) && v.Compare(c) == 1 -} - -func constraintLessThan(v, c *Version) bool { - return prereleaseCheck(v, c) && v.Compare(c) == -1 -} - -func constraintGreaterThanEqual(v, c *Version) bool { - return prereleaseCheck(v, c) && v.Compare(c) >= 0 -} - -func constraintLessThanEqual(v, c *Version) bool { - return prereleaseCheck(v, c) && v.Compare(c) <= 0 -} - -func constraintPessimistic(v, c *Version) bool { - // Using a pessimistic constraint with a pre-release, restricts versions to pre-releases - if !prereleaseCheck(v, c) || (c.Prerelease() != "" && v.Prerelease() == "") { - return false - } - - // If the version being checked is naturally less than the constraint, then there - // is no way for the version to be valid against the constraint - if v.LessThan(c) { - return false - } - // We'll use this more than once, so grab the length now so it's a little cleaner - // to write the later checks - cs := len(c.segments) - - // If the version being checked has less specificity than the constraint, then there - // is no way for the version to be valid against the constraint - if cs > len(v.segments) { - return false - } - - // Check the segments in the constraint against those in the version. If the version - // being checked, at any point, does not have the same values in each index of the - // constraints segments, then it cannot be valid against the constraint. - for i := 0; i < c.si-1; i++ { - if v.segments[i] != c.segments[i] { - return false - } - } - - // Check the last part of the segment in the constraint. If the version segment at - // this index is less than the constraints segment at this index, then it cannot - // be valid against the constraint - if c.segments[cs-1] > v.segments[cs-1] { - return false - } - - // If nothing has rejected the version by now, it's valid - return true -} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go b/test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go deleted file mode 100644 index 9c5bee312c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/constraint_test.go +++ /dev/null @@ -1,126 +0,0 @@ -package version - -import ( - "testing" -) - -func TestNewConstraint(t *testing.T) { - cases := []struct { - input string - count int - err bool - }{ - {">= 1.2", 1, false}, - {"1.0", 1, false}, - {">= 1.x", 0, true}, - {">= 1.2, < 1.0", 2, false}, - - // Out of bounds - {"11387778780781445675529500000000000000000", 0, true}, - } - - for _, tc := range cases { - v, err := NewConstraint(tc.input) - if tc.err && err == nil { - t.Fatalf("expected error for input: %s", tc.input) - } else if !tc.err && err != nil { - t.Fatalf("error for input %s: %s", tc.input, err) - } - - if len(v) != tc.count { - t.Fatalf("input: %s\nexpected len: %d\nactual: %d", - tc.input, tc.count, len(v)) - } - } -} - -func TestConstraintCheck(t *testing.T) { - cases := []struct { - constraint string - version string - check bool - }{ - {">= 1.0, < 1.2", "1.1.5", true}, - {"< 1.0, < 1.2", "1.1.5", false}, - {"= 1.0", "1.1.5", false}, - {"= 1.0", "1.0.0", true}, - {"1.0", "1.0.0", true}, - {"~> 1.0", "2.0", false}, - {"~> 1.0", "1.1", true}, - {"~> 1.0", "1.2.3", true}, - {"~> 1.0.0", "1.2.3", false}, - {"~> 1.0.0", "1.0.7", true}, - {"~> 1.0.0", "1.1.0", false}, - {"~> 1.0.7", "1.0.4", false}, - {"~> 1.0.7", "1.0.7", true}, - {"~> 1.0.7", "1.0.8", true}, - {"~> 1.0.7", "1.0.7.5", true}, - {"~> 1.0.7", "1.0.6.99", false}, - {"~> 1.0.7", "1.0.8.0", true}, - {"~> 1.0.9.5", "1.0.9.5", true}, - {"~> 1.0.9.5", "1.0.9.4", false}, - {"~> 1.0.9.5", "1.0.9.6", true}, - {"~> 1.0.9.5", "1.0.9.5.0", true}, - {"~> 1.0.9.5", "1.0.9.5.1", true}, - {"~> 2.0", "2.1.0-beta", false}, - {"~> 2.1.0-a", "2.2.0", false}, - {"~> 2.1.0-a", "2.1.0", false}, - {"~> 2.1.0-a", "2.1.0-beta", true}, - {"~> 2.1.0-a", "2.2.0-alpha", false}, - {"> 2.0", "2.1.0-beta", false}, - {">= 2.1.0-a", "2.1.0-beta", true}, - {">= 2.1.0-a", "2.1.1-beta", false}, - {">= 2.0.0", "2.1.0-beta", false}, - {">= 2.1.0-a", "2.1.1", true}, - {">= 2.1.0-a", "2.1.1-beta", false}, - {">= 2.1.0-a", "2.1.0", true}, - {"<= 2.1.0-a", "2.0.0", true}, - } - - for _, tc := range cases { - c, err := NewConstraint(tc.constraint) - if err != nil { - t.Fatalf("err: %s", err) - } - - v, err := NewVersion(tc.version) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := c.Check(v) - expected := tc.check - if actual != expected { - t.Fatalf("Version: %s\nConstraint: %s\nExpected: %#v", - tc.version, tc.constraint, expected) - } - } -} - -func TestConstraintsString(t *testing.T) { - cases := []struct { - constraint string - result string - }{ - {">= 1.0, < 1.2", ""}, - {"~> 1.0.7", ""}, - } - - for _, tc := range cases { - c, err := NewConstraint(tc.constraint) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := c.String() - expected := tc.result - if expected == "" { - expected = tc.constraint - } - - if actual != expected { - t.Fatalf("Constraint: %s\nExpected: %#v\nActual: %s", - tc.constraint, expected, actual) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/go.mod b/test/integration/licenses/github.com/hashicorp/go-version/go.mod deleted file mode 100644 index f5285555fa..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/hashicorp/go-version diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version.go b/test/integration/licenses/github.com/hashicorp/go-version/version.go deleted file mode 100644 index 09703e8e6f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/version.go +++ /dev/null @@ -1,384 +0,0 @@ -package version - -import ( - "bytes" - "fmt" - "reflect" - "regexp" - "strconv" - "strings" -) - -// The compiled regular expression used to test the validity of a version. -var ( - versionRegexp *regexp.Regexp - semverRegexp *regexp.Regexp -) - -// The raw regular expression string used for testing the validity -// of a version. -const ( - VersionRegexpRaw string = `v?([0-9]+(\.[0-9]+)*?)` + - `(-([0-9]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)|(-?([A-Za-z\-~]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)))?` + - `(\+([0-9A-Za-z\-~]+(\.[0-9A-Za-z\-~]+)*))?` + - `?` - - // SemverRegexpRaw requires a separator between version and prerelease - SemverRegexpRaw string = `v?([0-9]+(\.[0-9]+)*?)` + - `(-([0-9]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)|(-([A-Za-z\-~]+[0-9A-Za-z\-~]*(\.[0-9A-Za-z\-~]+)*)))?` + - `(\+([0-9A-Za-z\-~]+(\.[0-9A-Za-z\-~]+)*))?` + - `?` -) - -// Version represents a single version. -type Version struct { - metadata string - pre string - segments []int64 - si int - original string -} - -func init() { - versionRegexp = regexp.MustCompile("^" + VersionRegexpRaw + "$") - semverRegexp = regexp.MustCompile("^" + SemverRegexpRaw + "$") -} - -// NewVersion parses the given version and returns a new -// Version. -func NewVersion(v string) (*Version, error) { - return newVersion(v, versionRegexp) -} - -// NewSemver parses the given version and returns a new -// Version that adheres strictly to SemVer specs -// https://semver.org/ -func NewSemver(v string) (*Version, error) { - return newVersion(v, semverRegexp) -} - -func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { - matches := pattern.FindStringSubmatch(v) - if matches == nil { - return nil, fmt.Errorf("Malformed version: %s", v) - } - segmentsStr := strings.Split(matches[1], ".") - segments := make([]int64, len(segmentsStr)) - si := 0 - for i, str := range segmentsStr { - val, err := strconv.ParseInt(str, 10, 64) - if err != nil { - return nil, fmt.Errorf( - "Error parsing version: %s", err) - } - - segments[i] = int64(val) - si++ - } - - // Even though we could support more than three segments, if we - // got less than three, pad it with 0s. This is to cover the basic - // default usecase of semver, which is MAJOR.MINOR.PATCH at the minimum - for i := len(segments); i < 3; i++ { - segments = append(segments, 0) - } - - pre := matches[7] - if pre == "" { - pre = matches[4] - } - - return &Version{ - metadata: matches[10], - pre: pre, - segments: segments, - si: si, - original: v, - }, nil -} - -// Must is a helper that wraps a call to a function returning (*Version, error) -// and panics if error is non-nil. -func Must(v *Version, err error) *Version { - if err != nil { - panic(err) - } - - return v -} - -// Compare compares this version to another version. This -// returns -1, 0, or 1 if this version is smaller, equal, -// or larger than the other version, respectively. -// -// If you want boolean results, use the LessThan, Equal, -// GreaterThan, GreaterThanOrEqual or LessThanOrEqual methods. -func (v *Version) Compare(other *Version) int { - // A quick, efficient equality check - if v.String() == other.String() { - return 0 - } - - segmentsSelf := v.Segments64() - segmentsOther := other.Segments64() - - // If the segments are the same, we must compare on prerelease info - if reflect.DeepEqual(segmentsSelf, segmentsOther) { - preSelf := v.Prerelease() - preOther := other.Prerelease() - if preSelf == "" && preOther == "" { - return 0 - } - if preSelf == "" { - return 1 - } - if preOther == "" { - return -1 - } - - return comparePrereleases(preSelf, preOther) - } - - // Get the highest specificity (hS), or if they're equal, just use segmentSelf length - lenSelf := len(segmentsSelf) - lenOther := len(segmentsOther) - hS := lenSelf - if lenSelf < lenOther { - hS = lenOther - } - // Compare the segments - // Because a constraint could have more/less specificity than the version it's - // checking, we need to account for a lopsided or jagged comparison - for i := 0; i < hS; i++ { - if i > lenSelf-1 { - // This means Self had the lower specificity - // Check to see if the remaining segments in Other are all zeros - if !allZero(segmentsOther[i:]) { - // if not, it means that Other has to be greater than Self - return -1 - } - break - } else if i > lenOther-1 { - // this means Other had the lower specificity - // Check to see if the remaining segments in Self are all zeros - - if !allZero(segmentsSelf[i:]) { - //if not, it means that Self has to be greater than Other - return 1 - } - break - } - lhs := segmentsSelf[i] - rhs := segmentsOther[i] - if lhs == rhs { - continue - } else if lhs < rhs { - return -1 - } - // Otherwis, rhs was > lhs, they're not equal - return 1 - } - - // if we got this far, they're equal - return 0 -} - -func allZero(segs []int64) bool { - for _, s := range segs { - if s != 0 { - return false - } - } - return true -} - -func comparePart(preSelf string, preOther string) int { - if preSelf == preOther { - return 0 - } - - var selfInt int64 - selfNumeric := true - selfInt, err := strconv.ParseInt(preSelf, 10, 64) - if err != nil { - selfNumeric = false - } - - var otherInt int64 - otherNumeric := true - otherInt, err = strconv.ParseInt(preOther, 10, 64) - if err != nil { - otherNumeric = false - } - - // if a part is empty, we use the other to decide - if preSelf == "" { - if otherNumeric { - return -1 - } - return 1 - } - - if preOther == "" { - if selfNumeric { - return 1 - } - return -1 - } - - if selfNumeric && !otherNumeric { - return -1 - } else if !selfNumeric && otherNumeric { - return 1 - } else if !selfNumeric && !otherNumeric && preSelf > preOther { - return 1 - } else if selfInt > otherInt { - return 1 - } - - return -1 -} - -func comparePrereleases(v string, other string) int { - // the same pre release! - if v == other { - return 0 - } - - // split both pre releases for analyse their parts - selfPreReleaseMeta := strings.Split(v, ".") - otherPreReleaseMeta := strings.Split(other, ".") - - selfPreReleaseLen := len(selfPreReleaseMeta) - otherPreReleaseLen := len(otherPreReleaseMeta) - - biggestLen := otherPreReleaseLen - if selfPreReleaseLen > otherPreReleaseLen { - biggestLen = selfPreReleaseLen - } - - // loop for parts to find the first difference - for i := 0; i < biggestLen; i = i + 1 { - partSelfPre := "" - if i < selfPreReleaseLen { - partSelfPre = selfPreReleaseMeta[i] - } - - partOtherPre := "" - if i < otherPreReleaseLen { - partOtherPre = otherPreReleaseMeta[i] - } - - compare := comparePart(partSelfPre, partOtherPre) - // if parts are equals, continue the loop - if compare != 0 { - return compare - } - } - - return 0 -} - -// Equal tests if two versions are equal. -func (v *Version) Equal(o *Version) bool { - if v == nil || o == nil { - return v == o - } - - return v.Compare(o) == 0 -} - -// GreaterThan tests if this version is greater than another version. -func (v *Version) GreaterThan(o *Version) bool { - return v.Compare(o) > 0 -} - -// GreaterThanOrEqual tests if this version is greater than or equal to another version. -func (v *Version) GreaterThanOrEqual(o *Version) bool { - return v.Compare(o) >= 0 -} - -// LessThan tests if this version is less than another version. -func (v *Version) LessThan(o *Version) bool { - return v.Compare(o) < 0 -} - -// LessThanOrEqual tests if this version is less than or equal to another version. -func (v *Version) LessThanOrEqual(o *Version) bool { - return v.Compare(o) <= 0 -} - -// Metadata returns any metadata that was part of the version -// string. -// -// Metadata is anything that comes after the "+" in the version. -// For example, with "1.2.3+beta", the metadata is "beta". -func (v *Version) Metadata() string { - return v.metadata -} - -// Prerelease returns any prerelease data that is part of the version, -// or blank if there is no prerelease data. -// -// Prerelease information is anything that comes after the "-" in the -// version (but before any metadata). For example, with "1.2.3-beta", -// the prerelease information is "beta". -func (v *Version) Prerelease() string { - return v.pre -} - -// Segments returns the numeric segments of the version as a slice of ints. -// -// This excludes any metadata or pre-release information. For example, -// for a version "1.2.3-beta", segments will return a slice of -// 1, 2, 3. -func (v *Version) Segments() []int { - segmentSlice := make([]int, len(v.segments)) - for i, v := range v.segments { - segmentSlice[i] = int(v) - } - return segmentSlice -} - -// Segments64 returns the numeric segments of the version as a slice of int64s. -// -// This excludes any metadata or pre-release information. For example, -// for a version "1.2.3-beta", segments will return a slice of -// 1, 2, 3. -func (v *Version) Segments64() []int64 { - result := make([]int64, len(v.segments)) - copy(result, v.segments) - return result -} - -// String returns the full version string included pre-release -// and metadata information. -// -// This value is rebuilt according to the parsed segments and other -// information. Therefore, ambiguities in the version string such as -// prefixed zeroes (1.04.0 => 1.4.0), `v` prefix (v1.0.0 => 1.0.0), and -// missing parts (1.0 => 1.0.0) will be made into a canonicalized form -// as shown in the parenthesized examples. -func (v *Version) String() string { - var buf bytes.Buffer - fmtParts := make([]string, len(v.segments)) - for i, s := range v.segments { - // We can ignore err here since we've pre-parsed the values in segments - str := strconv.FormatInt(s, 10) - fmtParts[i] = str - } - fmt.Fprintf(&buf, strings.Join(fmtParts, ".")) - if v.pre != "" { - fmt.Fprintf(&buf, "-%s", v.pre) - } - if v.metadata != "" { - fmt.Fprintf(&buf, "+%s", v.metadata) - } - - return buf.String() -} - -// Original returns the original parsed version as-is, including any -// potential whitespace, `v` prefix, etc. -func (v *Version) Original() string { - return v.original -} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version_collection.go b/test/integration/licenses/github.com/hashicorp/go-version/version_collection.go deleted file mode 100644 index cc888d43e6..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/version_collection.go +++ /dev/null @@ -1,17 +0,0 @@ -package version - -// Collection is a type that implements the sort.Interface interface -// so that versions can be sorted. -type Collection []*Version - -func (v Collection) Len() int { - return len(v) -} - -func (v Collection) Less(i, j int) bool { - return v[i].LessThan(v[j]) -} - -func (v Collection) Swap(i, j int) { - v[i], v[j] = v[j], v[i] -} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go b/test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go deleted file mode 100644 index 14783d7e74..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/version_collection_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package version - -import ( - "reflect" - "sort" - "testing" -) - -func TestCollection(t *testing.T) { - versionsRaw := []string{ - "1.1.1", - "1.0", - "1.2", - "2", - "0.7.1", - } - - versions := make([]*Version, len(versionsRaw)) - for i, raw := range versionsRaw { - v, err := NewVersion(raw) - if err != nil { - t.Fatalf("err: %s", err) - } - - versions[i] = v - } - - sort.Sort(Collection(versions)) - - actual := make([]string, len(versions)) - for i, v := range versions { - actual[i] = v.String() - } - - expected := []string{ - "0.7.1", - "1.0.0", - "1.1.1", - "1.2.0", - "2.0.0", - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("bad: %#v", actual) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/go-version/version_test.go b/test/integration/licenses/github.com/hashicorp/go-version/version_test.go deleted file mode 100644 index cbbeac81fc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/go-version/version_test.go +++ /dev/null @@ -1,624 +0,0 @@ -package version - -import ( - "reflect" - "testing" -) - -func TestNewVersion(t *testing.T) { - cases := []struct { - version string - err bool - }{ - {"", true}, - {"1.2.3", false}, - {"1.0", false}, - {"1", false}, - {"1.2.beta", true}, - {"1.21.beta", true}, - {"foo", true}, - {"1.2-5", false}, - {"1.2-beta.5", false}, - {"\n1.2", true}, - {"1.2.0-x.Y.0+metadata", false}, - {"1.2.0-x.Y.0+metadata-width-hypen", false}, - {"1.2.3-rc1-with-hypen", false}, - {"1.2.3.4", false}, - {"1.2.0.4-x.Y.0+metadata", false}, - {"1.2.0.4-x.Y.0+metadata-width-hypen", false}, - {"1.2.0-X-1.2.0+metadata~dist", false}, - {"1.2.3.4-rc1-with-hypen", false}, - {"1.2.3.4", false}, - {"v1.2.3", false}, - {"foo1.2.3", true}, - {"1.7rc2", false}, - {"v1.7rc2", false}, - {"1.0-", false}, - } - - for _, tc := range cases { - _, err := NewVersion(tc.version) - if tc.err && err == nil { - t.Fatalf("expected error for version: %q", tc.version) - } else if !tc.err && err != nil { - t.Fatalf("error for version %q: %s", tc.version, err) - } - } -} - -func TestNewSemver(t *testing.T) { - cases := []struct { - version string - err bool - }{ - {"", true}, - {"1.2.3", false}, - {"1.0", false}, - {"1", false}, - {"1.2.beta", true}, - {"1.21.beta", true}, - {"foo", true}, - {"1.2-5", false}, - {"1.2-beta.5", false}, - {"\n1.2", true}, - {"1.2.0-x.Y.0+metadata", false}, - {"1.2.0-x.Y.0+metadata-width-hypen", false}, - {"1.2.3-rc1-with-hypen", false}, - {"1.2.3.4", false}, - {"1.2.0.4-x.Y.0+metadata", false}, - {"1.2.0.4-x.Y.0+metadata-width-hypen", false}, - {"1.2.0-X-1.2.0+metadata~dist", false}, - {"1.2.3.4-rc1-with-hypen", false}, - {"1.2.3.4", false}, - {"v1.2.3", false}, - {"foo1.2.3", true}, - {"1.7rc2", true}, - {"v1.7rc2", true}, - {"1.0-", true}, - } - - for _, tc := range cases { - _, err := NewSemver(tc.version) - if tc.err && err == nil { - t.Fatalf("expected error for version: %q", tc.version) - } else if !tc.err && err != nil { - t.Fatalf("error for version %q: %s", tc.version, err) - } - } -} - -func TestVersionCompare(t *testing.T) { - cases := []struct { - v1 string - v2 string - expected int - }{ - {"1.2.3", "1.4.5", -1}, - {"1.2-beta", "1.2-beta", 0}, - {"1.2", "1.1.4", 1}, - {"1.2", "1.2-beta", 1}, - {"1.2+foo", "1.2+beta", 0}, - {"v1.2", "v1.2-beta", 1}, - {"v1.2+foo", "v1.2+beta", 0}, - {"v1.2.3.4", "v1.2.3.4", 0}, - {"v1.2.0.0", "v1.2", 0}, - {"v1.2.0.0.1", "v1.2", 1}, - {"v1.2", "v1.2.0.0", 0}, - {"v1.2", "v1.2.0.0.1", -1}, - {"v1.2.0.0", "v1.2.0.0.1", -1}, - {"v1.2.3.0", "v1.2.3.4", -1}, - {"1.7rc2", "1.7rc1", 1}, - {"1.7rc2", "1.7", -1}, - {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", 1}, - } - - for _, tc := range cases { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Fatalf("err: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v1.Compare(v2) - expected := tc.expected - if actual != expected { - t.Fatalf( - "%s <=> %s\nexpected: %d\nactual: %d", - tc.v1, tc.v2, - expected, actual) - } - } -} - -func TestVersionCompare_versionAndSemver(t *testing.T) { - cases := []struct { - versionRaw string - semverRaw string - expected int - }{ - {"0.0.2", "0.0.2", 0}, - {"1.0.2alpha", "1.0.2-alpha", 0}, - {"v1.2+foo", "v1.2+beta", 0}, - {"v1.2", "v1.2+meta", 0}, - {"1.2", "1.2-beta", 1}, - {"v1.2", "v1.2-beta", 1}, - {"1.2.3", "1.4.5", -1}, - {"v1.2", "v1.2.0.0.1", -1}, - {"v1.0.3-", "v1.0.3", -1}, - } - - for _, tc := range cases { - ver, err := NewVersion(tc.versionRaw) - if err != nil { - t.Fatalf("err: %s", err) - } - - semver, err := NewSemver(tc.semverRaw) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := ver.Compare(semver) - if actual != tc.expected { - t.Fatalf( - "%s <=> %s\nexpected: %d\n actual: %d", - tc.versionRaw, tc.semverRaw, tc.expected, actual, - ) - } - } -} - -func TestVersionEqual_nil(t *testing.T) { - mustVersion := func(v string) *Version { - ver, err := NewVersion(v) - if err != nil { - t.Fatal(err) - } - return ver - } - cases := []struct { - leftVersion *Version - rightVersion *Version - expected bool - }{ - {mustVersion("1.0.0"), nil, false}, - {nil, mustVersion("1.0.0"), false}, - {nil, nil, true}, - } - - for _, tc := range cases { - given := tc.leftVersion.Equal(tc.rightVersion) - if given != tc.expected { - t.Fatalf("expected Equal to nil to be %t", tc.expected) - } - } -} - -func TestComparePreReleases(t *testing.T) { - cases := []struct { - v1 string - v2 string - expected int - }{ - {"1.2-beta.2", "1.2-beta.2", 0}, - {"1.2-beta.1", "1.2-beta.2", -1}, - {"1.2-beta.2", "1.2-beta.11", -1}, - {"3.2-alpha.1", "3.2-alpha", 1}, - {"1.2-beta.2", "1.2-beta.1", 1}, - {"1.2-beta.11", "1.2-beta.2", 1}, - {"1.2-beta", "1.2-beta.3", -1}, - {"1.2-alpha", "1.2-beta.3", -1}, - {"1.2-beta", "1.2-alpha.3", 1}, - {"3.0-alpha.3", "3.0-rc.1", -1}, - {"3.0-alpha3", "3.0-rc1", -1}, - {"3.0-alpha.1", "3.0-alpha.beta", -1}, - {"5.4-alpha", "5.4-alpha.beta", 1}, - {"v1.2-beta.2", "v1.2-beta.2", 0}, - {"v1.2-beta.1", "v1.2-beta.2", -1}, - {"v3.2-alpha.1", "v3.2-alpha", 1}, - {"v3.2-rc.1-1-g123", "v3.2-rc.2", 1}, - } - - for _, tc := range cases { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Fatalf("err: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v1.Compare(v2) - expected := tc.expected - if actual != expected { - t.Fatalf( - "%s <=> %s\nexpected: %d\nactual: %d", - tc.v1, tc.v2, - expected, actual) - } - } -} - -func TestVersionMetadata(t *testing.T) { - cases := []struct { - version string - expected string - }{ - {"1.2.3", ""}, - {"1.2-beta", ""}, - {"1.2.0-x.Y.0", ""}, - {"1.2.0-x.Y.0+metadata", "metadata"}, - {"1.2.0-metadata-1.2.0+metadata~dist", "metadata~dist"}, - } - - for _, tc := range cases { - v, err := NewVersion(tc.version) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v.Metadata() - expected := tc.expected - if actual != expected { - t.Fatalf("expected: %s\nactual: %s", expected, actual) - } - } -} - -func TestVersionPrerelease(t *testing.T) { - cases := []struct { - version string - expected string - }{ - {"1.2.3", ""}, - {"1.2-beta", "beta"}, - {"1.2.0-x.Y.0", "x.Y.0"}, - {"1.2.0-7.Y.0", "7.Y.0"}, - {"1.2.0-x.Y.0+metadata", "x.Y.0"}, - {"1.2.0-metadata-1.2.0+metadata~dist", "metadata-1.2.0"}, - {"17.03.0-ce", "ce"}, // zero-padded fields - } - - for _, tc := range cases { - v, err := NewVersion(tc.version) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v.Prerelease() - expected := tc.expected - if actual != expected { - t.Fatalf("expected: %s\nactual: %s", expected, actual) - } - } -} - -func TestVersionSegments(t *testing.T) { - cases := []struct { - version string - expected []int - }{ - {"1.2.3", []int{1, 2, 3}}, - {"1.2-beta", []int{1, 2, 0}}, - {"1-x.Y.0", []int{1, 0, 0}}, - {"1.2.0-x.Y.0+metadata", []int{1, 2, 0}}, - {"1.2.0-metadata-1.2.0+metadata~dist", []int{1, 2, 0}}, - {"17.03.0-ce", []int{17, 3, 0}}, // zero-padded fields - } - - for _, tc := range cases { - v, err := NewVersion(tc.version) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v.Segments() - expected := tc.expected - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("expected: %#v\nactual: %#v", expected, actual) - } - } -} - -func TestVersionSegments64(t *testing.T) { - cases := []struct { - version string - expected []int64 - }{ - {"1.2.3", []int64{1, 2, 3}}, - {"1.2-beta", []int64{1, 2, 0}}, - {"1-x.Y.0", []int64{1, 0, 0}}, - {"1.2.0-x.Y.0+metadata", []int64{1, 2, 0}}, - {"1.4.9223372036854775807", []int64{1, 4, 9223372036854775807}}, - } - - for _, tc := range cases { - v, err := NewVersion(tc.version) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v.Segments64() - expected := tc.expected - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("expected: %#v\nactual: %#v", expected, actual) - } - - { - expected := actual[0] - actual[0]++ - actual = v.Segments64() - if actual[0] != expected { - t.Fatalf("Segments64 is mutable") - } - } - } -} - -func TestVersionString(t *testing.T) { - cases := [][]string{ - {"1.2.3", "1.2.3"}, - {"1.2-beta", "1.2.0-beta"}, - {"1.2.0-x.Y.0", "1.2.0-x.Y.0"}, - {"1.2.0-x.Y.0+metadata", "1.2.0-x.Y.0+metadata"}, - {"1.2.0-metadata-1.2.0+metadata~dist", "1.2.0-metadata-1.2.0+metadata~dist"}, - {"17.03.0-ce", "17.3.0-ce"}, // zero-padded fields - } - - for _, tc := range cases { - v, err := NewVersion(tc[0]) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v.String() - expected := tc[1] - if actual != expected { - t.Fatalf("expected: %s\nactual: %s", expected, actual) - } - if actual := v.Original(); actual != tc[0] { - t.Fatalf("expected original: %q\nactual: %q", tc[0], actual) - } - } -} - -func TestEqual(t *testing.T) { - cases := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.4.5", false}, - {"1.2-beta", "1.2-beta", true}, - {"1.2", "1.1.4", false}, - {"1.2", "1.2-beta", false}, - {"1.2+foo", "1.2+beta", true}, - {"v1.2", "v1.2-beta", false}, - {"v1.2+foo", "v1.2+beta", true}, - {"v1.2.3.4", "v1.2.3.4", true}, - {"v1.2.0.0", "v1.2", true}, - {"v1.2.0.0.1", "v1.2", false}, - {"v1.2", "v1.2.0.0", true}, - {"v1.2", "v1.2.0.0.1", false}, - {"v1.2.0.0", "v1.2.0.0.1", false}, - {"v1.2.3.0", "v1.2.3.4", false}, - {"1.7rc2", "1.7rc1", false}, - {"1.7rc2", "1.7", false}, - {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", false}, - } - - for _, tc := range cases { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Fatalf("err: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v1.Equal(v2) - expected := tc.expected - if actual != expected { - t.Fatalf( - "%s <=> %s\nexpected: %t\nactual: %t", - tc.v1, tc.v2, - expected, actual) - } - } -} - -func TestGreaterThan(t *testing.T) { - cases := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.4.5", false}, - {"1.2-beta", "1.2-beta", false}, - {"1.2", "1.1.4", true}, - {"1.2", "1.2-beta", true}, - {"1.2+foo", "1.2+beta", false}, - {"v1.2", "v1.2-beta", true}, - {"v1.2+foo", "v1.2+beta", false}, - {"v1.2.3.4", "v1.2.3.4", false}, - {"v1.2.0.0", "v1.2", false}, - {"v1.2.0.0.1", "v1.2", true}, - {"v1.2", "v1.2.0.0", false}, - {"v1.2", "v1.2.0.0.1", false}, - {"v1.2.0.0", "v1.2.0.0.1", false}, - {"v1.2.3.0", "v1.2.3.4", false}, - {"1.7rc2", "1.7rc1", true}, - {"1.7rc2", "1.7", false}, - {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", true}, - } - - for _, tc := range cases { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Fatalf("err: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v1.GreaterThan(v2) - expected := tc.expected - if actual != expected { - t.Fatalf( - "%s > %s\nexpected: %t\nactual: %t", - tc.v1, tc.v2, - expected, actual) - } - } -} - -func TestLessThan(t *testing.T) { - cases := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.4.5", true}, - {"1.2-beta", "1.2-beta", false}, - {"1.2", "1.1.4", false}, - {"1.2", "1.2-beta", false}, - {"1.2+foo", "1.2+beta", false}, - {"v1.2", "v1.2-beta", false}, - {"v1.2+foo", "v1.2+beta", false}, - {"v1.2.3.4", "v1.2.3.4", false}, - {"v1.2.0.0", "v1.2", false}, - {"v1.2.0.0.1", "v1.2", false}, - {"v1.2", "v1.2.0.0", false}, - {"v1.2", "v1.2.0.0.1", true}, - {"v1.2.0.0", "v1.2.0.0.1", true}, - {"v1.2.3.0", "v1.2.3.4", true}, - {"1.7rc2", "1.7rc1", false}, - {"1.7rc2", "1.7", true}, - {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", false}, - } - - for _, tc := range cases { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Fatalf("err: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v1.LessThan(v2) - expected := tc.expected - if actual != expected { - t.Fatalf( - "%s < %s\nexpected: %t\nactual: %t", - tc.v1, tc.v2, - expected, actual) - } - } -} - -func TestGreaterThanOrEqual(t *testing.T) { - cases := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.4.5", false}, - {"1.2-beta", "1.2-beta", true}, - {"1.2", "1.1.4", true}, - {"1.2", "1.2-beta", true}, - {"1.2+foo", "1.2+beta", true}, - {"v1.2", "v1.2-beta", true}, - {"v1.2+foo", "v1.2+beta", true}, - {"v1.2.3.4", "v1.2.3.4", true}, - {"v1.2.0.0", "v1.2", true}, - {"v1.2.0.0.1", "v1.2", true}, - {"v1.2", "v1.2.0.0", true}, - {"v1.2", "v1.2.0.0.1", false}, - {"v1.2.0.0", "v1.2.0.0.1", false}, - {"v1.2.3.0", "v1.2.3.4", false}, - {"1.7rc2", "1.7rc1", true}, - {"1.7rc2", "1.7", false}, - {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", true}, - } - - for _, tc := range cases { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Fatalf("err: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v1.GreaterThanOrEqual(v2) - expected := tc.expected - if actual != expected { - t.Fatalf( - "%s >= %s\nexpected: %t\nactual: %t", - tc.v1, tc.v2, - expected, actual) - } - } -} - -func TestLessThanOrEqual(t *testing.T) { - cases := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.4.5", true}, - {"1.2-beta", "1.2-beta", true}, - {"1.2", "1.1.4", false}, - {"1.2", "1.2-beta", false}, - {"1.2+foo", "1.2+beta", true}, - {"v1.2", "v1.2-beta", false}, - {"v1.2+foo", "v1.2+beta", true}, - {"v1.2.3.4", "v1.2.3.4", true}, - {"v1.2.0.0", "v1.2", true}, - {"v1.2.0.0.1", "v1.2", false}, - {"v1.2", "v1.2.0.0", true}, - {"v1.2", "v1.2.0.0.1", true}, - {"v1.2.0.0", "v1.2.0.0.1", true}, - {"v1.2.3.0", "v1.2.3.4", true}, - {"1.7rc2", "1.7rc1", false}, - {"1.7rc2", "1.7", true}, - {"1.2.0", "1.2.0-X-1.2.0+metadata~dist", false}, - } - - for _, tc := range cases { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Fatalf("err: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Fatalf("err: %s", err) - } - - actual := v1.LessThanOrEqual(v2) - expected := tc.expected - if actual != expected { - t.Fatalf( - "%s <= %s\nexpected: %t\nactual: %t", - tc.v1, tc.v2, - expected, actual) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md b/test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 2d7fc4bf6f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,21 +0,0 @@ -### HCL Template -```hcl -# Place your HCL configuration file here -``` - -### Expected behavior -What should have happened? - -### Actual behavior -What actually happened? - -### Steps to reproduce -1. -2. -3. - -### References -Are there any other GitHub issues (open or closed) that should -be linked here? For example: -- GH-1234 -- ... diff --git a/test/integration/licenses/github.com/hashicorp/hcl/.gitignore b/test/integration/licenses/github.com/hashicorp/hcl/.gitignore deleted file mode 100644 index 15586a2b54..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -y.output - -# ignore intellij files -.idea -*.iml -*.ipr -*.iws - -*.test diff --git a/test/integration/licenses/github.com/hashicorp/hcl/.travis.yml b/test/integration/licenses/github.com/hashicorp/hcl/.travis.yml deleted file mode 100644 index cb63a32161..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -sudo: false - -language: go - -go: - - 1.x - - tip - -branches: - only: - - master - -script: make test diff --git a/test/integration/licenses/github.com/hashicorp/hcl/LICENSE b/test/integration/licenses/github.com/hashicorp/hcl/LICENSE deleted file mode 100644 index c33dcc7c92..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/test/integration/licenses/github.com/hashicorp/hcl/Makefile b/test/integration/licenses/github.com/hashicorp/hcl/Makefile deleted file mode 100644 index 84fd743f5c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -TEST?=./... - -default: test - -fmt: generate - go fmt ./... - -test: generate - go get -t ./... - go test $(TEST) $(TESTARGS) - -generate: - go generate ./... - -updatedeps: - go get -u golang.org/x/tools/cmd/stringer - -.PHONY: default generate test updatedeps diff --git a/test/integration/licenses/github.com/hashicorp/hcl/README.md b/test/integration/licenses/github.com/hashicorp/hcl/README.md deleted file mode 100644 index c8223326dd..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/README.md +++ /dev/null @@ -1,125 +0,0 @@ -# HCL - -[![GoDoc](https://godoc.org/github.com/hashicorp/hcl?status.png)](https://godoc.org/github.com/hashicorp/hcl) [![Build Status](https://travis-ci.org/hashicorp/hcl.svg?branch=master)](https://travis-ci.org/hashicorp/hcl) - -HCL (HashiCorp Configuration Language) is a configuration language built -by HashiCorp. The goal of HCL is to build a structured configuration language -that is both human and machine friendly for use with command-line tools, but -specifically targeted towards DevOps tools, servers, etc. - -HCL is also fully JSON compatible. That is, JSON can be used as completely -valid input to a system expecting HCL. This helps makes systems -interoperable with other systems. - -HCL is heavily inspired by -[libucl](https://github.com/vstakhov/libucl), -nginx configuration, and others similar. - -## Why? - -A common question when viewing HCL is to ask the question: why not -JSON, YAML, etc.? - -Prior to HCL, the tools we built at [HashiCorp](http://www.hashicorp.com) -used a variety of configuration languages from full programming languages -such as Ruby to complete data structure languages such as JSON. What we -learned is that some people wanted human-friendly configuration languages -and some people wanted machine-friendly languages. - -JSON fits a nice balance in this, but is fairly verbose and most -importantly doesn't support comments. With YAML, we found that beginners -had a really hard time determining what the actual structure was, and -ended up guessing more often than not whether to use a hyphen, colon, etc. -in order to represent some configuration key. - -Full programming languages such as Ruby enable complex behavior -a configuration language shouldn't usually allow, and also forces -people to learn some set of Ruby. - -Because of this, we decided to create our own configuration language -that is JSON-compatible. Our configuration language (HCL) is designed -to be written and modified by humans. The API for HCL allows JSON -as an input so that it is also machine-friendly (machines can generate -JSON instead of trying to generate HCL). - -Our goal with HCL is not to alienate other configuration languages. -It is instead to provide HCL as a specialized language for our tools, -and JSON as the interoperability layer. - -## Syntax - -For a complete grammar, please see the parser itself. A high-level overview -of the syntax and grammar is listed here. - - * Single line comments start with `#` or `//` - - * Multi-line comments are wrapped in `/*` and `*/`. Nested block comments - are not allowed. A multi-line comment (also known as a block comment) - terminates at the first `*/` found. - - * Values are assigned with the syntax `key = value` (whitespace doesn't - matter). The value can be any primitive: a string, number, boolean, - object, or list. - - * Strings are double-quoted and can contain any UTF-8 characters. - Example: `"Hello, World"` - - * Multi-line strings start with `<- - echo %Path% - - go version - - go env - - go get -t ./... - -build_script: -- cmd: go test -v ./... diff --git a/test/integration/licenses/github.com/hashicorp/hcl/decoder.go b/test/integration/licenses/github.com/hashicorp/hcl/decoder.go deleted file mode 100644 index bed9ebbe14..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/decoder.go +++ /dev/null @@ -1,729 +0,0 @@ -package hcl - -import ( - "errors" - "fmt" - "reflect" - "sort" - "strconv" - "strings" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/parser" - "github.com/hashicorp/hcl/hcl/token" -) - -// This is the tag to use with structures to have settings for HCL -const tagName = "hcl" - -var ( - // nodeType holds a reference to the type of ast.Node - nodeType reflect.Type = findNodeType() -) - -// Unmarshal accepts a byte slice as input and writes the -// data to the value pointed to by v. -func Unmarshal(bs []byte, v interface{}) error { - root, err := parse(bs) - if err != nil { - return err - } - - return DecodeObject(v, root) -} - -// Decode reads the given input and decodes it into the structure -// given by `out`. -func Decode(out interface{}, in string) error { - obj, err := Parse(in) - if err != nil { - return err - } - - return DecodeObject(out, obj) -} - -// DecodeObject is a lower-level version of Decode. It decodes a -// raw Object into the given output. -func DecodeObject(out interface{}, n ast.Node) error { - val := reflect.ValueOf(out) - if val.Kind() != reflect.Ptr { - return errors.New("result must be a pointer") - } - - // If we have the file, we really decode the root node - if f, ok := n.(*ast.File); ok { - n = f.Node - } - - var d decoder - return d.decode("root", n, val.Elem()) -} - -type decoder struct { - stack []reflect.Kind -} - -func (d *decoder) decode(name string, node ast.Node, result reflect.Value) error { - k := result - - // If we have an interface with a valid value, we use that - // for the check. - if result.Kind() == reflect.Interface { - elem := result.Elem() - if elem.IsValid() { - k = elem - } - } - - // Push current onto stack unless it is an interface. - if k.Kind() != reflect.Interface { - d.stack = append(d.stack, k.Kind()) - - // Schedule a pop - defer func() { - d.stack = d.stack[:len(d.stack)-1] - }() - } - - switch k.Kind() { - case reflect.Bool: - return d.decodeBool(name, node, result) - case reflect.Float32, reflect.Float64: - return d.decodeFloat(name, node, result) - case reflect.Int, reflect.Int32, reflect.Int64: - return d.decodeInt(name, node, result) - case reflect.Interface: - // When we see an interface, we make our own thing - return d.decodeInterface(name, node, result) - case reflect.Map: - return d.decodeMap(name, node, result) - case reflect.Ptr: - return d.decodePtr(name, node, result) - case reflect.Slice: - return d.decodeSlice(name, node, result) - case reflect.String: - return d.decodeString(name, node, result) - case reflect.Struct: - return d.decodeStruct(name, node, result) - default: - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: unknown kind to decode into: %s", name, k.Kind()), - } - } -} - -func (d *decoder) decodeBool(name string, node ast.Node, result reflect.Value) error { - switch n := node.(type) { - case *ast.LiteralType: - if n.Token.Type == token.BOOL { - v, err := strconv.ParseBool(n.Token.Text) - if err != nil { - return err - } - - result.Set(reflect.ValueOf(v)) - return nil - } - } - - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: unknown type %T", name, node), - } -} - -func (d *decoder) decodeFloat(name string, node ast.Node, result reflect.Value) error { - switch n := node.(type) { - case *ast.LiteralType: - if n.Token.Type == token.FLOAT || n.Token.Type == token.NUMBER { - v, err := strconv.ParseFloat(n.Token.Text, 64) - if err != nil { - return err - } - - result.Set(reflect.ValueOf(v).Convert(result.Type())) - return nil - } - } - - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: unknown type %T", name, node), - } -} - -func (d *decoder) decodeInt(name string, node ast.Node, result reflect.Value) error { - switch n := node.(type) { - case *ast.LiteralType: - switch n.Token.Type { - case token.NUMBER: - v, err := strconv.ParseInt(n.Token.Text, 0, 0) - if err != nil { - return err - } - - if result.Kind() == reflect.Interface { - result.Set(reflect.ValueOf(int(v))) - } else { - result.SetInt(v) - } - return nil - case token.STRING: - v, err := strconv.ParseInt(n.Token.Value().(string), 0, 0) - if err != nil { - return err - } - - if result.Kind() == reflect.Interface { - result.Set(reflect.ValueOf(int(v))) - } else { - result.SetInt(v) - } - return nil - } - } - - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: unknown type %T", name, node), - } -} - -func (d *decoder) decodeInterface(name string, node ast.Node, result reflect.Value) error { - // When we see an ast.Node, we retain the value to enable deferred decoding. - // Very useful in situations where we want to preserve ast.Node information - // like Pos - if result.Type() == nodeType && result.CanSet() { - result.Set(reflect.ValueOf(node)) - return nil - } - - var set reflect.Value - redecode := true - - // For testing types, ObjectType should just be treated as a list. We - // set this to a temporary var because we want to pass in the real node. - testNode := node - if ot, ok := node.(*ast.ObjectType); ok { - testNode = ot.List - } - - switch n := testNode.(type) { - case *ast.ObjectList: - // If we're at the root or we're directly within a slice, then we - // decode objects into map[string]interface{}, otherwise we decode - // them into lists. - if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { - var temp map[string]interface{} - tempVal := reflect.ValueOf(temp) - result := reflect.MakeMap( - reflect.MapOf( - reflect.TypeOf(""), - tempVal.Type().Elem())) - - set = result - } else { - var temp []map[string]interface{} - tempVal := reflect.ValueOf(temp) - result := reflect.MakeSlice( - reflect.SliceOf(tempVal.Type().Elem()), 0, len(n.Items)) - set = result - } - case *ast.ObjectType: - // If we're at the root or we're directly within a slice, then we - // decode objects into map[string]interface{}, otherwise we decode - // them into lists. - if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { - var temp map[string]interface{} - tempVal := reflect.ValueOf(temp) - result := reflect.MakeMap( - reflect.MapOf( - reflect.TypeOf(""), - tempVal.Type().Elem())) - - set = result - } else { - var temp []map[string]interface{} - tempVal := reflect.ValueOf(temp) - result := reflect.MakeSlice( - reflect.SliceOf(tempVal.Type().Elem()), 0, 1) - set = result - } - case *ast.ListType: - var temp []interface{} - tempVal := reflect.ValueOf(temp) - result := reflect.MakeSlice( - reflect.SliceOf(tempVal.Type().Elem()), 0, 0) - set = result - case *ast.LiteralType: - switch n.Token.Type { - case token.BOOL: - var result bool - set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) - case token.FLOAT: - var result float64 - set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) - case token.NUMBER: - var result int - set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) - case token.STRING, token.HEREDOC: - set = reflect.Indirect(reflect.New(reflect.TypeOf(""))) - default: - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: cannot decode into interface: %T", name, node), - } - } - default: - return fmt.Errorf( - "%s: cannot decode into interface: %T", - name, node) - } - - // Set the result to what its supposed to be, then reset - // result so we don't reflect into this method anymore. - result.Set(set) - - if redecode { - // Revisit the node so that we can use the newly instantiated - // thing and populate it. - if err := d.decode(name, node, result); err != nil { - return err - } - } - - return nil -} - -func (d *decoder) decodeMap(name string, node ast.Node, result reflect.Value) error { - if item, ok := node.(*ast.ObjectItem); ok { - node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} - } - - if ot, ok := node.(*ast.ObjectType); ok { - node = ot.List - } - - n, ok := node.(*ast.ObjectList) - if !ok { - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: not an object type for map (%T)", name, node), - } - } - - // If we have an interface, then we can address the interface, - // but not the slice itself, so get the element but set the interface - set := result - if result.Kind() == reflect.Interface { - result = result.Elem() - } - - resultType := result.Type() - resultElemType := resultType.Elem() - resultKeyType := resultType.Key() - if resultKeyType.Kind() != reflect.String { - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: map must have string keys", name), - } - } - - // Make a map if it is nil - resultMap := result - if result.IsNil() { - resultMap = reflect.MakeMap( - reflect.MapOf(resultKeyType, resultElemType)) - } - - // Go through each element and decode it. - done := make(map[string]struct{}) - for _, item := range n.Items { - if item.Val == nil { - continue - } - - // github.com/hashicorp/terraform/issue/5740 - if len(item.Keys) == 0 { - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: map must have string keys", name), - } - } - - // Get the key we're dealing with, which is the first item - keyStr := item.Keys[0].Token.Value().(string) - - // If we've already processed this key, then ignore it - if _, ok := done[keyStr]; ok { - continue - } - - // Determine the value. If we have more than one key, then we - // get the objectlist of only these keys. - itemVal := item.Val - if len(item.Keys) > 1 { - itemVal = n.Filter(keyStr) - done[keyStr] = struct{}{} - } - - // Make the field name - fieldName := fmt.Sprintf("%s.%s", name, keyStr) - - // Get the key/value as reflection values - key := reflect.ValueOf(keyStr) - val := reflect.Indirect(reflect.New(resultElemType)) - - // If we have a pre-existing value in the map, use that - oldVal := resultMap.MapIndex(key) - if oldVal.IsValid() { - val.Set(oldVal) - } - - // Decode! - if err := d.decode(fieldName, itemVal, val); err != nil { - return err - } - - // Set the value on the map - resultMap.SetMapIndex(key, val) - } - - // Set the final map if we can - set.Set(resultMap) - return nil -} - -func (d *decoder) decodePtr(name string, node ast.Node, result reflect.Value) error { - // Create an element of the concrete (non pointer) type and decode - // into that. Then set the value of the pointer to this type. - resultType := result.Type() - resultElemType := resultType.Elem() - val := reflect.New(resultElemType) - if err := d.decode(name, node, reflect.Indirect(val)); err != nil { - return err - } - - result.Set(val) - return nil -} - -func (d *decoder) decodeSlice(name string, node ast.Node, result reflect.Value) error { - // If we have an interface, then we can address the interface, - // but not the slice itself, so get the element but set the interface - set := result - if result.Kind() == reflect.Interface { - result = result.Elem() - } - // Create the slice if it isn't nil - resultType := result.Type() - resultElemType := resultType.Elem() - if result.IsNil() { - resultSliceType := reflect.SliceOf(resultElemType) - result = reflect.MakeSlice( - resultSliceType, 0, 0) - } - - // Figure out the items we'll be copying into the slice - var items []ast.Node - switch n := node.(type) { - case *ast.ObjectList: - items = make([]ast.Node, len(n.Items)) - for i, item := range n.Items { - items[i] = item - } - case *ast.ObjectType: - items = []ast.Node{n} - case *ast.ListType: - items = n.List - default: - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("unknown slice type: %T", node), - } - } - - for i, item := range items { - fieldName := fmt.Sprintf("%s[%d]", name, i) - - // Decode - val := reflect.Indirect(reflect.New(resultElemType)) - - // if item is an object that was decoded from ambiguous JSON and - // flattened, make sure it's expanded if it needs to decode into a - // defined structure. - item := expandObject(item, val) - - if err := d.decode(fieldName, item, val); err != nil { - return err - } - - // Append it onto the slice - result = reflect.Append(result, val) - } - - set.Set(result) - return nil -} - -// expandObject detects if an ambiguous JSON object was flattened to a List which -// should be decoded into a struct, and expands the ast to properly deocode. -func expandObject(node ast.Node, result reflect.Value) ast.Node { - item, ok := node.(*ast.ObjectItem) - if !ok { - return node - } - - elemType := result.Type() - - // our target type must be a struct - switch elemType.Kind() { - case reflect.Ptr: - switch elemType.Elem().Kind() { - case reflect.Struct: - //OK - default: - return node - } - case reflect.Struct: - //OK - default: - return node - } - - // A list value will have a key and field name. If it had more fields, - // it wouldn't have been flattened. - if len(item.Keys) != 2 { - return node - } - - keyToken := item.Keys[0].Token - item.Keys = item.Keys[1:] - - // we need to un-flatten the ast enough to decode - newNode := &ast.ObjectItem{ - Keys: []*ast.ObjectKey{ - &ast.ObjectKey{ - Token: keyToken, - }, - }, - Val: &ast.ObjectType{ - List: &ast.ObjectList{ - Items: []*ast.ObjectItem{item}, - }, - }, - } - - return newNode -} - -func (d *decoder) decodeString(name string, node ast.Node, result reflect.Value) error { - switch n := node.(type) { - case *ast.LiteralType: - switch n.Token.Type { - case token.NUMBER: - result.Set(reflect.ValueOf(n.Token.Text).Convert(result.Type())) - return nil - case token.STRING, token.HEREDOC: - result.Set(reflect.ValueOf(n.Token.Value()).Convert(result.Type())) - return nil - } - } - - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: unknown type for string %T", name, node), - } -} - -func (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value) error { - var item *ast.ObjectItem - if it, ok := node.(*ast.ObjectItem); ok { - item = it - node = it.Val - } - - if ot, ok := node.(*ast.ObjectType); ok { - node = ot.List - } - - // Handle the special case where the object itself is a literal. Previously - // the yacc parser would always ensure top-level elements were arrays. The new - // parser does not make the same guarantees, thus we need to convert any - // top-level literal elements into a list. - if _, ok := node.(*ast.LiteralType); ok && item != nil { - node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} - } - - list, ok := node.(*ast.ObjectList) - if !ok { - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: not an object type for struct (%T)", name, node), - } - } - - // This slice will keep track of all the structs we'll be decoding. - // There can be more than one struct if there are embedded structs - // that are squashed. - structs := make([]reflect.Value, 1, 5) - structs[0] = result - - // Compile the list of all the fields that we're going to be decoding - // from all the structs. - type field struct { - field reflect.StructField - val reflect.Value - } - fields := []field{} - for len(structs) > 0 { - structVal := structs[0] - structs = structs[1:] - - structType := structVal.Type() - for i := 0; i < structType.NumField(); i++ { - fieldType := structType.Field(i) - tagParts := strings.Split(fieldType.Tag.Get(tagName), ",") - - // Ignore fields with tag name "-" - if tagParts[0] == "-" { - continue - } - - if fieldType.Anonymous { - fieldKind := fieldType.Type.Kind() - if fieldKind != reflect.Struct { - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: unsupported type to struct: %s", - fieldType.Name, fieldKind), - } - } - - // We have an embedded field. We "squash" the fields down - // if specified in the tag. - squash := false - for _, tag := range tagParts[1:] { - if tag == "squash" { - squash = true - break - } - } - - if squash { - structs = append( - structs, result.FieldByName(fieldType.Name)) - continue - } - } - - // Normal struct field, store it away - fields = append(fields, field{fieldType, structVal.Field(i)}) - } - } - - usedKeys := make(map[string]struct{}) - decodedFields := make([]string, 0, len(fields)) - decodedFieldsVal := make([]reflect.Value, 0) - unusedKeysVal := make([]reflect.Value, 0) - for _, f := range fields { - field, fieldValue := f.field, f.val - if !fieldValue.IsValid() { - // This should never happen - panic("field is not valid") - } - - // If we can't set the field, then it is unexported or something, - // and we just continue onwards. - if !fieldValue.CanSet() { - continue - } - - fieldName := field.Name - - tagValue := field.Tag.Get(tagName) - tagParts := strings.SplitN(tagValue, ",", 2) - if len(tagParts) >= 2 { - switch tagParts[1] { - case "decodedFields": - decodedFieldsVal = append(decodedFieldsVal, fieldValue) - continue - case "key": - if item == nil { - return &parser.PosError{ - Pos: node.Pos(), - Err: fmt.Errorf("%s: %s asked for 'key', impossible", - name, fieldName), - } - } - - fieldValue.SetString(item.Keys[0].Token.Value().(string)) - continue - case "unusedKeys": - unusedKeysVal = append(unusedKeysVal, fieldValue) - continue - } - } - - if tagParts[0] != "" { - fieldName = tagParts[0] - } - - // Determine the element we'll use to decode. If it is a single - // match (only object with the field), then we decode it exactly. - // If it is a prefix match, then we decode the matches. - filter := list.Filter(fieldName) - - prefixMatches := filter.Children() - matches := filter.Elem() - if len(matches.Items) == 0 && len(prefixMatches.Items) == 0 { - continue - } - - // Track the used key - usedKeys[fieldName] = struct{}{} - - // Create the field name and decode. We range over the elements - // because we actually want the value. - fieldName = fmt.Sprintf("%s.%s", name, fieldName) - if len(prefixMatches.Items) > 0 { - if err := d.decode(fieldName, prefixMatches, fieldValue); err != nil { - return err - } - } - for _, match := range matches.Items { - var decodeNode ast.Node = match.Val - if ot, ok := decodeNode.(*ast.ObjectType); ok { - decodeNode = &ast.ObjectList{Items: ot.List.Items} - } - - if err := d.decode(fieldName, decodeNode, fieldValue); err != nil { - return err - } - } - - decodedFields = append(decodedFields, field.Name) - } - - if len(decodedFieldsVal) > 0 { - // Sort it so that it is deterministic - sort.Strings(decodedFields) - - for _, v := range decodedFieldsVal { - v.Set(reflect.ValueOf(decodedFields)) - } - } - - return nil -} - -// findNodeType returns the type of ast.Node -func findNodeType() reflect.Type { - var nodeContainer struct { - Node ast.Node - } - value := reflect.ValueOf(nodeContainer).FieldByName("Node") - return value.Type() -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go b/test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go deleted file mode 100644 index 8682f470ed..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/decoder_test.go +++ /dev/null @@ -1,1203 +0,0 @@ -package hcl - -import ( - "io/ioutil" - "path/filepath" - "reflect" - "testing" - "time" - - "github.com/davecgh/go-spew/spew" - "github.com/hashicorp/hcl/hcl/ast" -) - -func TestDecode_interface(t *testing.T) { - cases := []struct { - File string - Err bool - Out interface{} - }{ - { - "basic.hcl", - false, - map[string]interface{}{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}", - }, - }, - { - "basic_squish.hcl", - false, - map[string]interface{}{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}", - "foo-bar": "baz", - }, - }, - { - "empty.hcl", - false, - map[string]interface{}{ - "resource": []map[string]interface{}{ - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{}, - }, - }, - }, - }, - }, - { - "tfvars.hcl", - false, - map[string]interface{}{ - "regularvar": "Should work", - "map.key1": "Value", - "map.key2": "Other value", - }, - }, - { - "escape.hcl", - false, - map[string]interface{}{ - "foo": "bar\"baz\\n", - "qux": "back\\slash", - "bar": "new\nline", - "qax": `slash\:colon`, - "nested": `${HH\\:mm\\:ss}`, - "nestedquotes": `${"\"stringwrappedinquotes\""}`, - }, - }, - { - "float.hcl", - false, - map[string]interface{}{ - "a": 1.02, - "b": 2, - }, - }, - { - "multiline_bad.hcl", - true, - nil, - }, - { - "multiline_literal.hcl", - true, - nil, - }, - { - "multiline_literal_with_hil.hcl", - false, - map[string]interface{}{"multiline_literal_with_hil": "${hello\n world}"}, - }, - { - "multiline_no_marker.hcl", - true, - nil, - }, - { - "multiline.hcl", - false, - map[string]interface{}{"foo": "bar\nbaz\n"}, - }, - { - "multiline_indented.hcl", - false, - map[string]interface{}{"foo": " bar\n baz\n"}, - }, - { - "multiline_no_hanging_indent.hcl", - false, - map[string]interface{}{"foo": " baz\n bar\n foo\n"}, - }, - { - "multiline_no_eof.hcl", - false, - map[string]interface{}{"foo": "bar\nbaz\n", "key": "value"}, - }, - { - "multiline.json", - false, - map[string]interface{}{"foo": "bar\nbaz"}, - }, - { - "null_strings.json", - false, - map[string]interface{}{ - "module": []map[string]interface{}{ - map[string]interface{}{ - "app": []map[string]interface{}{ - map[string]interface{}{"foo": ""}, - }, - }, - }, - }, - }, - { - "scientific.json", - false, - map[string]interface{}{ - "a": 1e-10, - "b": 1e+10, - "c": 1e10, - "d": 1.2e-10, - "e": 1.2e+10, - "f": 1.2e10, - }, - }, - { - "scientific.hcl", - false, - map[string]interface{}{ - "a": 1e-10, - "b": 1e+10, - "c": 1e10, - "d": 1.2e-10, - "e": 1.2e+10, - "f": 1.2e10, - }, - }, - { - "terraform_heroku.hcl", - false, - map[string]interface{}{ - "name": "terraform-test-app", - "config_vars": []map[string]interface{}{ - map[string]interface{}{ - "FOO": "bar", - }, - }, - }, - }, - { - "structure_multi.hcl", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "baz": []map[string]interface{}{ - map[string]interface{}{"key": 7}, - }, - }, - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{"key": 12}, - }, - }, - }, - }, - }, - { - "structure_multi.json", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "baz": []map[string]interface{}{ - map[string]interface{}{"key": 7}, - }, - }, - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{"key": 12}, - }, - }, - }, - }, - }, - { - "list_of_lists.hcl", - false, - map[string]interface{}{ - "foo": []interface{}{ - []interface{}{"foo"}, - []interface{}{"bar"}, - }, - }, - }, - { - "list_of_maps.hcl", - false, - map[string]interface{}{ - "foo": []interface{}{ - map[string]interface{}{"somekey1": "someval1"}, - map[string]interface{}{"somekey2": "someval2", "someextrakey": "someextraval"}, - }, - }, - }, - { - "assign_deep.hcl", - false, - map[string]interface{}{ - "resource": []interface{}{ - map[string]interface{}{ - "foo": []interface{}{ - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{}}}}}}}, - }, - { - "structure_list.hcl", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "key": 7, - }, - map[string]interface{}{ - "key": 12, - }, - }, - }, - }, - { - "structure_list.json", - false, - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "key": 7, - }, - map[string]interface{}{ - "key": 12, - }, - }, - }, - }, - { - "structure_list_deep.json", - false, - map[string]interface{}{ - "bar": []map[string]interface{}{ - map[string]interface{}{ - "foo": []map[string]interface{}{ - map[string]interface{}{ - "name": "terraform_example", - "ingress": []map[string]interface{}{ - map[string]interface{}{ - "from_port": 22, - }, - map[string]interface{}{ - "from_port": 80, - }, - }, - }, - }, - }, - }, - }, - }, - - { - "structure_list_empty.json", - false, - map[string]interface{}{ - "foo": []interface{}{}, - }, - }, - - { - "nested_block_comment.hcl", - false, - map[string]interface{}{ - "bar": "value", - }, - }, - - { - "unterminated_block_comment.hcl", - true, - nil, - }, - - { - "unterminated_brace.hcl", - true, - nil, - }, - - { - "nested_provider_bad.hcl", - true, - nil, - }, - - { - "object_list.json", - false, - map[string]interface{}{ - "resource": []map[string]interface{}{ - map[string]interface{}{ - "aws_instance": []map[string]interface{}{ - map[string]interface{}{ - "db": []map[string]interface{}{ - map[string]interface{}{ - "vpc": "foo", - "provisioner": []map[string]interface{}{ - map[string]interface{}{ - "file": []map[string]interface{}{ - map[string]interface{}{ - "source": "foo", - "destination": "bar", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - - // Terraform GH-8295 sanity test that basic decoding into - // interface{} works. - { - "terraform_variable_invalid.json", - false, - map[string]interface{}{ - "variable": []map[string]interface{}{ - map[string]interface{}{ - "whatever": "abc123", - }, - }, - }, - }, - - { - "interpolate.json", - false, - map[string]interface{}{ - "default": `${replace("europe-west", "-", " ")}`, - }, - }, - - { - "block_assign.hcl", - true, - nil, - }, - - { - "escape_backslash.hcl", - false, - map[string]interface{}{ - "output": []map[string]interface{}{ - map[string]interface{}{ - "one": `${replace(var.sub_domain, ".", "\\.")}`, - "two": `${replace(var.sub_domain, ".", "\\\\.")}`, - "many": `${replace(var.sub_domain, ".", "\\\\\\\\.")}`, - }, - }, - }, - }, - - { - "git_crypt.hcl", - true, - nil, - }, - - { - "object_with_bool.hcl", - false, - map[string]interface{}{ - "path": []map[string]interface{}{ - map[string]interface{}{ - "policy": "write", - "permissions": []map[string]interface{}{ - map[string]interface{}{ - "bool": []interface{}{false}, - }, - }, - }, - }, - }, - }, - } - - for _, tc := range cases { - t.Run(tc.File, func(t *testing.T) { - d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.File)) - if err != nil { - t.Fatalf("err: %s", err) - } - - var out interface{} - err = Decode(&out, string(d)) - if (err != nil) != tc.Err { - t.Fatalf("Input: %s\n\nError: %s", tc.File, err) - } - - if !reflect.DeepEqual(out, tc.Out) { - t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) - } - - var v interface{} - err = Unmarshal(d, &v) - if (err != nil) != tc.Err { - t.Fatalf("Input: %s\n\nError: %s", tc.File, err) - } - - if !reflect.DeepEqual(v, tc.Out) { - t.Fatalf("Input: %s. Actual, Expected.\n\n%#v\n\n%#v", tc.File, out, tc.Out) - } - }) - } -} - -func TestDecode_interfaceInline(t *testing.T) { - cases := []struct { - Value string - Err bool - Out interface{} - }{ - {"t t e{{}}", true, nil}, - {"t=0t d {}", true, map[string]interface{}{"t": 0}}, - {"v=0E0v d{}", true, map[string]interface{}{"v": float64(0)}}, - } - - for _, tc := range cases { - t.Logf("Testing: %q", tc.Value) - - var out interface{} - err := Decode(&out, tc.Value) - if (err != nil) != tc.Err { - t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) - } - - if !reflect.DeepEqual(out, tc.Out) { - t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) - } - - var v interface{} - err = Unmarshal([]byte(tc.Value), &v) - if (err != nil) != tc.Err { - t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) - } - - if !reflect.DeepEqual(v, tc.Out) { - t.Fatalf("Input: %q. Actual, Expected.\n\n%#v\n\n%#v", tc.Value, out, tc.Out) - } - } -} - -func TestDecode_equal(t *testing.T) { - cases := []struct { - One, Two string - }{ - { - "basic.hcl", - "basic.json", - }, - { - "float.hcl", - "float.json", - }, - /* - { - "structure.hcl", - "structure.json", - }, - */ - { - "structure.hcl", - "structure_flat.json", - }, - { - "terraform_heroku.hcl", - "terraform_heroku.json", - }, - } - - for _, tc := range cases { - p1 := filepath.Join(fixtureDir, tc.One) - p2 := filepath.Join(fixtureDir, tc.Two) - - d1, err := ioutil.ReadFile(p1) - if err != nil { - t.Fatalf("err: %s", err) - } - - d2, err := ioutil.ReadFile(p2) - if err != nil { - t.Fatalf("err: %s", err) - } - - var i1, i2 interface{} - err = Decode(&i1, string(d1)) - if err != nil { - t.Fatalf("err: %s", err) - } - - err = Decode(&i2, string(d2)) - if err != nil { - t.Fatalf("err: %s", err) - } - - if !reflect.DeepEqual(i1, i2) { - t.Fatalf( - "%s != %s\n\n%#v\n\n%#v", - tc.One, tc.Two, - i1, i2) - } - } -} - -func TestDecode_flatMap(t *testing.T) { - var val map[string]map[string]string - - err := Decode(&val, testReadFile(t, "structure_flatmap.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := map[string]map[string]string{ - "foo": map[string]string{ - "foo": "bar", - "key": "7", - }, - } - - if !reflect.DeepEqual(val, expected) { - t.Fatalf("Actual: %#v\n\nExpected: %#v", val, expected) - } -} - -func TestDecode_structure(t *testing.T) { - type Embedded interface{} - - type V struct { - Embedded `hcl:"-"` - Key int - Foo string - } - - var actual V - - err := Decode(&actual, testReadFile(t, "flat.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := V{ - Key: 7, - Foo: "bar", - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) - } -} - -func TestDecode_structurePtr(t *testing.T) { - type V struct { - Key int - Foo string - } - - var actual *V - - err := Decode(&actual, testReadFile(t, "flat.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - expected := &V{ - Key: 7, - Foo: "bar", - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Actual: %#v\n\nExpected: %#v", actual, expected) - } -} - -func TestDecode_structureArray(t *testing.T) { - // This test is extracted from a failure in Consul (consul.io), - // hence the interesting structure naming. - - type KeyPolicyType string - - type KeyPolicy struct { - Prefix string `hcl:",key"` - Policy KeyPolicyType - } - - type Policy struct { - Keys []KeyPolicy `hcl:"key,expand"` - } - - expected := Policy{ - Keys: []KeyPolicy{ - KeyPolicy{ - Prefix: "", - Policy: "read", - }, - KeyPolicy{ - Prefix: "foo/", - Policy: "write", - }, - KeyPolicy{ - Prefix: "foo/bar/", - Policy: "read", - }, - KeyPolicy{ - Prefix: "foo/bar/baz", - Policy: "deny", - }, - }, - } - - files := []string{ - "decode_policy.hcl", - "decode_policy.json", - } - - for _, f := range files { - var actual Policy - - err := Decode(&actual, testReadFile(t, f)) - if err != nil { - t.Fatalf("Input: %s\n\nerr: %s", f, err) - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) - } - } -} - -func TestDecode_sliceExpand(t *testing.T) { - type testInner struct { - Name string `hcl:",key"` - Key string - } - - type testStruct struct { - Services []testInner `hcl:"service,expand"` - } - - expected := testStruct{ - Services: []testInner{ - testInner{ - Name: "my-service-0", - Key: "value", - }, - testInner{ - Name: "my-service-1", - Key: "value", - }, - }, - } - - files := []string{ - "slice_expand.hcl", - } - - for _, f := range files { - t.Logf("Testing: %s", f) - - var actual testStruct - err := Decode(&actual, testReadFile(t, f)) - if err != nil { - t.Fatalf("Input: %s\n\nerr: %s", f, err) - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) - } - } -} - -func TestDecode_structureMap(t *testing.T) { - // This test is extracted from a failure in Terraform (terraform.io), - // hence the interesting structure naming. - - type hclVariable struct { - Default interface{} - Description string - Fields []string `hcl:",decodedFields"` - } - - type rawConfig struct { - Variable map[string]hclVariable - } - - expected := rawConfig{ - Variable: map[string]hclVariable{ - "foo": hclVariable{ - Default: "bar", - Description: "bar", - Fields: []string{"Default", "Description"}, - }, - - "amis": hclVariable{ - Default: []map[string]interface{}{ - map[string]interface{}{ - "east": "foo", - }, - }, - Fields: []string{"Default"}, - }, - }, - } - - files := []string{ - "decode_tf_variable.hcl", - "decode_tf_variable.json", - } - - for _, f := range files { - t.Logf("Testing: %s", f) - - var actual rawConfig - err := Decode(&actual, testReadFile(t, f)) - if err != nil { - t.Fatalf("Input: %s\n\nerr: %s", f, err) - } - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("Input: %s\n\nActual: %#v\n\nExpected: %#v", f, actual, expected) - } - } -} - -func TestDecode_structureMapInvalid(t *testing.T) { - // Terraform GH-8295 - - type hclVariable struct { - Default interface{} - Description string - Fields []string `hcl:",decodedFields"` - } - - type rawConfig struct { - Variable map[string]*hclVariable - } - - var actual rawConfig - err := Decode(&actual, testReadFile(t, "terraform_variable_invalid.json")) - if err == nil { - t.Fatal("expected error") - } -} - -func TestDecode_interfaceNonPointer(t *testing.T) { - var value interface{} - err := Decode(value, testReadFile(t, "basic_int_string.hcl")) - if err == nil { - t.Fatal("should error") - } -} - -func TestDecode_intString(t *testing.T) { - var value struct { - Count int - } - - err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if value.Count != 3 { - t.Fatalf("bad: %#v", value.Count) - } -} - -func TestDecode_float32(t *testing.T) { - var value struct { - A float32 `hcl:"a"` - B float32 `hcl:"b"` - } - - err := Decode(&value, testReadFile(t, "float.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if got, want := value.A, float32(1.02); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } - if got, want := value.B, float32(2); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } -} - -func TestDecode_float64(t *testing.T) { - var value struct { - A float64 `hcl:"a"` - B float64 `hcl:"b"` - } - - err := Decode(&value, testReadFile(t, "float.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if got, want := value.A, float64(1.02); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } - if got, want := value.B, float64(2); got != want { - t.Fatalf("wrong result %#v; want %#v", got, want) - } -} - -func TestDecode_intStringAliased(t *testing.T) { - var value struct { - Count time.Duration - } - - err := Decode(&value, testReadFile(t, "basic_int_string.hcl")) - if err != nil { - t.Fatalf("err: %s", err) - } - - if value.Count != time.Duration(3) { - t.Fatalf("bad: %#v", value.Count) - } -} - -func TestDecode_Node(t *testing.T) { - // given - var value struct { - Content ast.Node - Nested struct { - Content ast.Node - } - } - - content := ` -content { - hello = "world" -} -` - - // when - err := Decode(&value, content) - - // then - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - // verify ast.Node can be decoded later - var v map[string]interface{} - err = DecodeObject(&v, value.Content) - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - if v["hello"] != "world" { - t.Errorf("expected mapping to be returned") - } -} - -func TestDecode_NestedNode(t *testing.T) { - // given - var value struct { - Nested struct { - Content ast.Node - } - } - - content := ` -nested "content" { - hello = "world" -} -` - - // when - err := Decode(&value, content) - - // then - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - // verify ast.Node can be decoded later - var v map[string]interface{} - err = DecodeObject(&v, value.Nested.Content) - if err != nil { - t.Errorf("unable to decode content, %v", err) - return - } - - if v["hello"] != "world" { - t.Errorf("expected mapping to be returned") - } -} - -// https://github.com/hashicorp/hcl/issues/60 -func TestDecode_topLevelKeys(t *testing.T) { - type Template struct { - Source string - } - - templates := struct { - Templates []*Template `hcl:"template"` - }{} - - err := Decode(&templates, ` - template { - source = "blah" - } - - template { - source = "blahblah" - }`) - - if err != nil { - t.Fatal(err) - } - - if templates.Templates[0].Source != "blah" { - t.Errorf("bad source: %s", templates.Templates[0].Source) - } - - if templates.Templates[1].Source != "blahblah" { - t.Errorf("bad source: %s", templates.Templates[1].Source) - } -} - -func TestDecode_flattenedJSON(t *testing.T) { - // make sure we can also correctly extract a Name key too - type V struct { - Name string `hcl:",key"` - Description string - Default map[string]string - } - type Vars struct { - Variable []*V - } - - cases := []struct { - JSON string - Out interface{} - Expected interface{} - }{ - { // Nested object, no sibling keys - JSON: ` -{ - "var_name": { - "default": { - "key1": "a", - "key2": "b" - } - } -} - `, - Out: &[]*V{}, - Expected: &[]*V{ - &V{ - Name: "var_name", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - }, - }, - - { // Nested object with a sibling key (this worked previously) - JSON: ` -{ - "var_name": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } -} - `, - Out: &[]*V{}, - Expected: &[]*V{ - &V{ - Name: "var_name", - Description: "Described", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - }, - }, - - { // Multiple nested objects, one with a sibling key - JSON: ` -{ - "variable": { - "var_1": { - "default": { - "key1": "a", - "key2": "b" - } - }, - "var_2": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &Vars{}, - Expected: &Vars{ - Variable: []*V{ - &V{ - Name: "var_1", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - &V{ - Name: "var_2", - Description: "Described", - Default: map[string]string{"key1": "a", "key2": "b"}, - }, - }, - }, - }, - - { // Nested object to maps - JSON: ` -{ - "variable": { - "var_name": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &[]map[string]interface{}{}, - Expected: &[]map[string]interface{}{ - { - "variable": []map[string]interface{}{ - { - "var_name": []map[string]interface{}{ - { - "description": "Described", - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - - { // Nested object to maps without a sibling key should decode the same as above - JSON: ` -{ - "variable": { - "var_name": { - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &[]map[string]interface{}{}, - Expected: &[]map[string]interface{}{ - { - "variable": []map[string]interface{}{ - { - "var_name": []map[string]interface{}{ - { - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - - { // Nested objects, one with a sibling key, and one without - JSON: ` -{ - "variable": { - "var_1": { - "default": { - "key1": "a", - "key2": "b" - } - }, - "var_2": { - "description": "Described", - "default": { - "key1": "a", - "key2": "b" - } - } - } -} - `, - Out: &[]map[string]interface{}{}, - Expected: &[]map[string]interface{}{ - { - "variable": []map[string]interface{}{ - { - "var_1": []map[string]interface{}{ - { - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - { - "variable": []map[string]interface{}{ - { - "var_2": []map[string]interface{}{ - { - "description": "Described", - "default": []map[string]interface{}{ - { - "key1": "a", - "key2": "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - - for i, tc := range cases { - err := Decode(tc.Out, tc.JSON) - if err != nil { - t.Fatalf("[%d] err: %s", i, err) - } - - if !reflect.DeepEqual(tc.Out, tc.Expected) { - t.Fatalf("[%d]\ngot: %s\nexpected: %s\n", i, spew.Sdump(tc.Out), spew.Sdump(tc.Expected)) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/go.mod b/test/integration/licenses/github.com/hashicorp/hcl/go.mod deleted file mode 100644 index 4debbbe358..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/hashicorp/hcl - -require github.com/davecgh/go-spew v1.1.1 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/go.sum b/test/integration/licenses/github.com/hashicorp/hcl/go.sum deleted file mode 100644 index b5e2922e89..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl.go deleted file mode 100644 index 575a20b50b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package hcl decodes HCL into usable Go structures. -// -// hcl input can come in either pure HCL format or JSON format. -// It can be parsed into an AST, and then decoded into a structure, -// or it can be decoded directly from a string into a structure. -// -// If you choose to parse HCL into a raw AST, the benefit is that you -// can write custom visitor implementations to implement custom -// semantic checks. By default, HCL does not perform any semantic -// checks. -package hcl diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go deleted file mode 100644 index 6e5ef654bb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast.go +++ /dev/null @@ -1,219 +0,0 @@ -// Package ast declares the types used to represent syntax trees for HCL -// (HashiCorp Configuration Language) -package ast - -import ( - "fmt" - "strings" - - "github.com/hashicorp/hcl/hcl/token" -) - -// Node is an element in the abstract syntax tree. -type Node interface { - node() - Pos() token.Pos -} - -func (File) node() {} -func (ObjectList) node() {} -func (ObjectKey) node() {} -func (ObjectItem) node() {} -func (Comment) node() {} -func (CommentGroup) node() {} -func (ObjectType) node() {} -func (LiteralType) node() {} -func (ListType) node() {} - -// File represents a single HCL file -type File struct { - Node Node // usually a *ObjectList - Comments []*CommentGroup // list of all comments in the source -} - -func (f *File) Pos() token.Pos { - return f.Node.Pos() -} - -// ObjectList represents a list of ObjectItems. An HCL file itself is an -// ObjectList. -type ObjectList struct { - Items []*ObjectItem -} - -func (o *ObjectList) Add(item *ObjectItem) { - o.Items = append(o.Items, item) -} - -// Filter filters out the objects with the given key list as a prefix. -// -// The returned list of objects contain ObjectItems where the keys have -// this prefix already stripped off. This might result in objects with -// zero-length key lists if they have no children. -// -// If no matches are found, an empty ObjectList (non-nil) is returned. -func (o *ObjectList) Filter(keys ...string) *ObjectList { - var result ObjectList - for _, item := range o.Items { - // If there aren't enough keys, then ignore this - if len(item.Keys) < len(keys) { - continue - } - - match := true - for i, key := range item.Keys[:len(keys)] { - key := key.Token.Value().(string) - if key != keys[i] && !strings.EqualFold(key, keys[i]) { - match = false - break - } - } - if !match { - continue - } - - // Strip off the prefix from the children - newItem := *item - newItem.Keys = newItem.Keys[len(keys):] - result.Add(&newItem) - } - - return &result -} - -// Children returns further nested objects (key length > 0) within this -// ObjectList. This should be used with Filter to get at child items. -func (o *ObjectList) Children() *ObjectList { - var result ObjectList - for _, item := range o.Items { - if len(item.Keys) > 0 { - result.Add(item) - } - } - - return &result -} - -// Elem returns items in the list that are direct element assignments -// (key length == 0). This should be used with Filter to get at elements. -func (o *ObjectList) Elem() *ObjectList { - var result ObjectList - for _, item := range o.Items { - if len(item.Keys) == 0 { - result.Add(item) - } - } - - return &result -} - -func (o *ObjectList) Pos() token.Pos { - // always returns the uninitiliazed position - return o.Items[0].Pos() -} - -// ObjectItem represents a HCL Object Item. An item is represented with a key -// (or keys). It can be an assignment or an object (both normal and nested) -type ObjectItem struct { - // keys is only one length long if it's of type assignment. If it's a - // nested object it can be larger than one. In that case "assign" is - // invalid as there is no assignments for a nested object. - Keys []*ObjectKey - - // assign contains the position of "=", if any - Assign token.Pos - - // val is the item itself. It can be an object,list, number, bool or a - // string. If key length is larger than one, val can be only of type - // Object. - Val Node - - LeadComment *CommentGroup // associated lead comment - LineComment *CommentGroup // associated line comment -} - -func (o *ObjectItem) Pos() token.Pos { - // I'm not entirely sure what causes this, but removing this causes - // a test failure. We should investigate at some point. - if len(o.Keys) == 0 { - return token.Pos{} - } - - return o.Keys[0].Pos() -} - -// ObjectKeys are either an identifier or of type string. -type ObjectKey struct { - Token token.Token -} - -func (o *ObjectKey) Pos() token.Pos { - return o.Token.Pos -} - -// LiteralType represents a literal of basic type. Valid types are: -// token.NUMBER, token.FLOAT, token.BOOL and token.STRING -type LiteralType struct { - Token token.Token - - // comment types, only used when in a list - LeadComment *CommentGroup - LineComment *CommentGroup -} - -func (l *LiteralType) Pos() token.Pos { - return l.Token.Pos -} - -// ListStatement represents a HCL List type -type ListType struct { - Lbrack token.Pos // position of "[" - Rbrack token.Pos // position of "]" - List []Node // the elements in lexical order -} - -func (l *ListType) Pos() token.Pos { - return l.Lbrack -} - -func (l *ListType) Add(node Node) { - l.List = append(l.List, node) -} - -// ObjectType represents a HCL Object Type -type ObjectType struct { - Lbrace token.Pos // position of "{" - Rbrace token.Pos // position of "}" - List *ObjectList // the nodes in lexical order -} - -func (o *ObjectType) Pos() token.Pos { - return o.Lbrace -} - -// Comment node represents a single //, # style or /*- style commment -type Comment struct { - Start token.Pos // position of / or # - Text string -} - -func (c *Comment) Pos() token.Pos { - return c.Start -} - -// CommentGroup node represents a sequence of comments with no other tokens and -// no empty lines between. -type CommentGroup struct { - List []*Comment // len(List) > 0 -} - -func (c *CommentGroup) Pos() token.Pos { - return c.List[0].Pos() -} - -//------------------------------------------------------------------- -// GoStringer -//------------------------------------------------------------------- - -func (o *ObjectKey) GoString() string { return fmt.Sprintf("*%#v", *o) } -func (o *ObjectList) GoString() string { return fmt.Sprintf("*%#v", *o) } diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go deleted file mode 100644 index d4364a10f0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/ast_test.go +++ /dev/null @@ -1,200 +0,0 @@ -package ast - -import ( - "reflect" - "strings" - "testing" - - "github.com/hashicorp/hcl/hcl/token" -) - -func TestObjectListFilter(t *testing.T) { - var cases = []struct { - Filter []string - Input []*ObjectItem - Output []*ObjectItem - }{ - { - []string{"foo"}, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{ - Token: token.Token{Type: token.STRING, Text: `"foo"`}, - }, - }, - }, - }, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{}, - }, - }, - }, - - { - []string{"foo"}, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, - }, - }, - }, - []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - }, - }, - } - - for _, tc := range cases { - input := &ObjectList{Items: tc.Input} - expected := &ObjectList{Items: tc.Output} - if actual := input.Filter(tc.Filter...); !reflect.DeepEqual(actual, expected) { - t.Fatalf("in order: input, expected, actual\n\n%#v\n\n%#v\n\n%#v", input, expected, actual) - } - } -} - -func TestWalk(t *testing.T) { - items := []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - Val: &LiteralType{Token: token.Token{Type: token.STRING, Text: `"example"`}}, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, - }, - }, - } - - node := &ObjectList{Items: items} - - order := []string{ - "*ast.ObjectList", - "*ast.ObjectItem", - "*ast.ObjectKey", - "*ast.ObjectKey", - "*ast.LiteralType", - "*ast.ObjectItem", - "*ast.ObjectKey", - } - count := 0 - - Walk(node, func(n Node) (Node, bool) { - if n == nil { - return n, false - } - - typeName := reflect.TypeOf(n).String() - if order[count] != typeName { - t.Errorf("expected '%s' got: '%s'", order[count], typeName) - } - count++ - return n, true - }) -} - -func TestWalkEquality(t *testing.T) { - items := []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - }, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - } - - node := &ObjectList{Items: items} - - rewritten := Walk(node, func(n Node) (Node, bool) { return n, true }) - - newNode, ok := rewritten.(*ObjectList) - if !ok { - t.Fatalf("expected Objectlist, got %T", rewritten) - } - - if !reflect.DeepEqual(node, newNode) { - t.Fatal("rewritten node is not equal to the given node") - } - - if len(newNode.Items) != 2 { - t.Errorf("expected newNode length 2, got: %d", len(newNode.Items)) - } - - expected := []string{ - `"foo"`, - `"bar"`, - } - - for i, item := range newNode.Items { - if len(item.Keys) != 1 { - t.Errorf("expected keys newNode length 1, got: %d", len(item.Keys)) - } - - if item.Keys[0].Token.Text != expected[i] { - t.Errorf("expected key %s, got %s", expected[i], item.Keys[0].Token.Text) - } - - if item.Val != nil { - t.Errorf("expected item value should be nil") - } - } -} - -func TestWalkRewrite(t *testing.T) { - items := []*ObjectItem{ - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"foo"`}}, - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"bar"`}}, - }, - }, - &ObjectItem{ - Keys: []*ObjectKey{ - &ObjectKey{Token: token.Token{Type: token.STRING, Text: `"baz"`}}, - }, - }, - } - - node := &ObjectList{Items: items} - - suffix := "_example" - node = Walk(node, func(n Node) (Node, bool) { - switch i := n.(type) { - case *ObjectKey: - i.Token.Text = i.Token.Text + suffix - n = i - } - return n, true - }).(*ObjectList) - - Walk(node, func(n Node) (Node, bool) { - switch i := n.(type) { - case *ObjectKey: - if !strings.HasSuffix(i.Token.Text, suffix) { - t.Errorf("Token '%s' should have suffix: %s", i.Token.Text, suffix) - } - } - return n, true - }) - -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go deleted file mode 100644 index ba07ad42b0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/ast/walk.go +++ /dev/null @@ -1,52 +0,0 @@ -package ast - -import "fmt" - -// WalkFunc describes a function to be called for each node during a Walk. The -// returned node can be used to rewrite the AST. Walking stops the returned -// bool is false. -type WalkFunc func(Node) (Node, bool) - -// Walk traverses an AST in depth-first order: It starts by calling fn(node); -// node must not be nil. If fn returns true, Walk invokes fn recursively for -// each of the non-nil children of node, followed by a call of fn(nil). The -// returned node of fn can be used to rewrite the passed node to fn. -func Walk(node Node, fn WalkFunc) Node { - rewritten, ok := fn(node) - if !ok { - return rewritten - } - - switch n := node.(type) { - case *File: - n.Node = Walk(n.Node, fn) - case *ObjectList: - for i, item := range n.Items { - n.Items[i] = Walk(item, fn).(*ObjectItem) - } - case *ObjectKey: - // nothing to do - case *ObjectItem: - for i, k := range n.Keys { - n.Keys[i] = Walk(k, fn).(*ObjectKey) - } - - if n.Val != nil { - n.Val = Walk(n.Val, fn) - } - case *LiteralType: - // nothing to do - case *ListType: - for i, l := range n.List { - n.List[i] = Walk(l, fn) - } - case *ObjectType: - n.List = Walk(n.List, fn).(*ObjectList) - default: - // should we panic here? - fmt.Printf("unknown type: %T\n", n) - } - - fn(nil) - return rewritten -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go deleted file mode 100644 index 2380d71e3c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd.go +++ /dev/null @@ -1,162 +0,0 @@ -// Derivative work from: -// - https://golang.org/src/cmd/gofmt/gofmt.go -// - https://github.com/fatih/hclfmt - -package fmtcmd - -import ( - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strings" - - "github.com/hashicorp/hcl/hcl/printer" -) - -var ( - ErrWriteStdin = errors.New("cannot use write option with standard input") -) - -type Options struct { - List bool // list files whose formatting differs - Write bool // write result to (source) file instead of stdout - Diff bool // display diffs of formatting changes -} - -func isValidFile(f os.FileInfo, extensions []string) bool { - if !f.IsDir() && !strings.HasPrefix(f.Name(), ".") { - for _, ext := range extensions { - if strings.HasSuffix(f.Name(), "."+ext) { - return true - } - } - } - - return false -} - -// If in == nil, the source is the contents of the file with the given filename. -func processFile(filename string, in io.Reader, out io.Writer, stdin bool, opts Options) error { - if in == nil { - f, err := os.Open(filename) - if err != nil { - return err - } - defer f.Close() - in = f - } - - src, err := ioutil.ReadAll(in) - if err != nil { - return err - } - - res, err := printer.Format(src) - if err != nil { - return fmt.Errorf("In %s: %s", filename, err) - } - - if !bytes.Equal(src, res) { - // formatting has changed - if opts.List { - fmt.Fprintln(out, filename) - } - if opts.Write { - err = ioutil.WriteFile(filename, res, 0644) - if err != nil { - return err - } - } - if opts.Diff { - data, err := diff(src, res) - if err != nil { - return fmt.Errorf("computing diff: %s", err) - } - fmt.Fprintf(out, "diff a/%s b/%s\n", filename, filename) - out.Write(data) - } - } - - if !opts.List && !opts.Write && !opts.Diff { - _, err = out.Write(res) - } - - return err -} - -func walkDir(path string, extensions []string, stdout io.Writer, opts Options) error { - visitFile := func(path string, f os.FileInfo, err error) error { - if err == nil && isValidFile(f, extensions) { - err = processFile(path, nil, stdout, false, opts) - } - return err - } - - return filepath.Walk(path, visitFile) -} - -func Run( - paths, extensions []string, - stdin io.Reader, - stdout io.Writer, - opts Options, -) error { - if len(paths) == 0 { - if opts.Write { - return ErrWriteStdin - } - if err := processFile("", stdin, stdout, true, opts); err != nil { - return err - } - return nil - } - - for _, path := range paths { - switch dir, err := os.Stat(path); { - case err != nil: - return err - case dir.IsDir(): - if err := walkDir(path, extensions, stdout, opts); err != nil { - return err - } - default: - if err := processFile(path, nil, stdout, false, opts); err != nil { - return err - } - } - } - - return nil -} - -func diff(b1, b2 []byte) (data []byte, err error) { - f1, err := ioutil.TempFile("", "") - if err != nil { - return - } - defer os.Remove(f1.Name()) - defer f1.Close() - - f2, err := ioutil.TempFile("", "") - if err != nil { - return - } - defer os.Remove(f2.Name()) - defer f2.Close() - - f1.Write(b1) - f2.Write(b2) - - data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() - if len(data) > 0 { - // diff exits with a non-zero status when the files don't match. - // Ignore that failure as long as we get output. - err = nil - } - return -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go deleted file mode 100644 index 66bed581c0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/fmtcmd_test.go +++ /dev/null @@ -1,440 +0,0 @@ -// +build !windows -// TODO(jen20): These need fixing on Windows but fmt is not used right now -// and red CI is making it harder to process other bugs, so ignore until -// we get around to fixing them. - -package fmtcmd - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "reflect" - "regexp" - "sort" - "syscall" - "testing" - - "github.com/hashicorp/hcl/testhelper" -) - -var fixtureExtensions = []string{"hcl"} - -func init() { - sort.Sort(ByFilename(fixtures)) -} - -func TestIsValidFile(t *testing.T) { - const fixtureDir = "./test-fixtures" - - cases := []struct { - Path string - Expected bool - }{ - {"good.hcl", true}, - {".hidden.ignore", false}, - {"file.ignore", false}, - {"dir.ignore", false}, - } - - for _, tc := range cases { - file, err := os.Stat(filepath.Join(fixtureDir, tc.Path)) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - - if res := isValidFile(file, fixtureExtensions); res != tc.Expected { - t.Errorf("want: %t, got: %t", tc.Expected, res) - } - } -} - -func TestRunMultiplePaths(t *testing.T) { - path1, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path1) - path2, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path2) - - var expectedOut bytes.Buffer - for _, path := range []string{path1, path2} { - for _, fixture := range fixtures { - if !bytes.Equal(fixture.golden, fixture.input) { - expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") - } - } - } - - _, stdout := mockIO() - err = Run( - []string{path1, path2}, - fixtureExtensions, - nil, stdout, - Options{ - List: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) - } -} - -func TestRunSubDirectories(t *testing.T) { - pathParent, err := ioutil.TempDir("", "") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(pathParent) - - path1, err := renderFixtures(pathParent) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - path2, err := renderFixtures(pathParent) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - - paths := []string{path1, path2} - sort.Strings(paths) - - var expectedOut bytes.Buffer - for _, path := range paths { - for _, fixture := range fixtures { - if !bytes.Equal(fixture.golden, fixture.input) { - expectedOut.WriteString(filepath.Join(path, fixture.filename) + "\n") - } - } - } - - _, stdout := mockIO() - err = Run( - []string{pathParent}, - fixtureExtensions, - nil, stdout, - Options{ - List: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) - } -} - -func TestRunStdin(t *testing.T) { - var expectedOut bytes.Buffer - for i, fixture := range fixtures { - if i != 0 { - expectedOut.WriteString("\n") - } - expectedOut.Write(fixture.golden) - } - - stdin, stdout := mockIO() - for _, fixture := range fixtures { - stdin.Write(fixture.input) - } - - err := Run( - []string{}, - fixtureExtensions, - stdin, stdout, - Options{}, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if !bytes.Equal(stdout.Bytes(), expectedOut.Bytes()) { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) - } -} - -func TestRunStdinAndWrite(t *testing.T) { - var expectedOut = []byte{} - - stdin, stdout := mockIO() - stdin.WriteString("") - err := Run( - []string{}, []string{}, - stdin, stdout, - Options{ - Write: true, - }, - ) - - if err != ErrWriteStdin { - t.Errorf("error want:\n%s\ngot:\n%s", ErrWriteStdin, err) - } - if !bytes.Equal(stdout.Bytes(), expectedOut) { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut, stdout) - } -} - -func TestRunFileError(t *testing.T) { - path, err := ioutil.TempDir("", "") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - filename := filepath.Join(path, "unreadable.hcl") - - var expectedError = &os.PathError{ - Op: "open", - Path: filename, - Err: syscall.EACCES, - } - - err = ioutil.WriteFile(filename, []byte{}, 0000) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{}, - ) - - if !reflect.DeepEqual(err, expectedError) { - t.Errorf("error want: %#v, got: %#v", expectedError, err) - } -} - -func TestRunNoOptions(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - var expectedOut bytes.Buffer - for _, fixture := range fixtures { - expectedOut.Write(fixture.golden) - } - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{}, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) - } -} - -func TestRunList(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - var expectedOut bytes.Buffer - for _, fixture := range fixtures { - if !bytes.Equal(fixture.golden, fixture.input) { - expectedOut.WriteString(fmt.Sprintln(filepath.Join(path, fixture.filename))) - } - } - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{ - List: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if stdout.String() != expectedOut.String() { - t.Errorf("stdout want:\n%s\ngot:\n%s", expectedOut.String(), stdout.String()) - } -} - -func TestRunWrite(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{ - Write: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - for _, fixture := range fixtures { - res, err := ioutil.ReadFile(filepath.Join(path, fixture.filename)) - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if !bytes.Equal(res, fixture.golden) { - t.Errorf("file %q contents want:\n%s\ngot:\n%s", fixture.filename, fixture.golden, res) - } - } -} - -func TestRunDiff(t *testing.T) { - path, err := renderFixtures("") - if err != nil { - t.Errorf("unexpected error: %s", err) - } - defer os.RemoveAll(path) - - var expectedOut bytes.Buffer - for _, fixture := range fixtures { - if len(fixture.diff) > 0 { - expectedOut.WriteString( - regexp.QuoteMeta( - fmt.Sprintf("diff a/%s/%s b/%s/%s\n", path, fixture.filename, path, fixture.filename), - ), - ) - // Need to use regex to ignore datetimes in diff. - expectedOut.WriteString(`--- .+?\n`) - expectedOut.WriteString(`\+\+\+ .+?\n`) - expectedOut.WriteString(regexp.QuoteMeta(string(fixture.diff))) - } - } - - expectedOutString := testhelper.Unix2dos(expectedOut.String()) - - _, stdout := mockIO() - err = Run( - []string{path}, - fixtureExtensions, - nil, stdout, - Options{ - Diff: true, - }, - ) - - if err != nil { - t.Errorf("unexpected error: %s", err) - } - if !regexp.MustCompile(expectedOutString).Match(stdout.Bytes()) { - t.Errorf("stdout want match:\n%s\ngot:\n%q", expectedOutString, stdout) - } -} - -func mockIO() (stdin, stdout *bytes.Buffer) { - return new(bytes.Buffer), new(bytes.Buffer) -} - -type fixture struct { - filename string - input, golden, diff []byte -} - -type ByFilename []fixture - -func (s ByFilename) Len() int { return len(s) } -func (s ByFilename) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s ByFilename) Less(i, j int) bool { return len(s[i].filename) > len(s[j].filename) } - -var fixtures = []fixture{ - { - "noop.hcl", - []byte(`resource "aws_security_group" "firewall" { - count = 5 -} -`), - []byte(`resource "aws_security_group" "firewall" { - count = 5 -} -`), - []byte(``), - }, { - "align_equals.hcl", - []byte(`variable "foo" { - default = "bar" - description = "bar" -} -`), - []byte(`variable "foo" { - default = "bar" - description = "bar" -} -`), - []byte(`@@ -1,4 +1,4 @@ - variable "foo" { -- default = "bar" -+ default = "bar" - description = "bar" - } -`), - }, { - "indentation.hcl", - []byte(`provider "aws" { - access_key = "foo" - secret_key = "bar" -} -`), - []byte(`provider "aws" { - access_key = "foo" - secret_key = "bar" -} -`), - []byte(`@@ -1,4 +1,4 @@ - provider "aws" { -- access_key = "foo" -- secret_key = "bar" -+ access_key = "foo" -+ secret_key = "bar" - } -`), - }, -} - -// parent can be an empty string, in which case the system's default -// temporary directory will be used. -func renderFixtures(parent string) (path string, err error) { - path, err = ioutil.TempDir(parent, "") - if err != nil { - return "", err - } - - for _, fixture := range fixtures { - err = ioutil.WriteFile(filepath.Join(path, fixture.filename), []byte(fixture.input), 0644) - if err != nil { - os.RemoveAll(path) - return "", err - } - } - - return path, nil -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore deleted file mode 100644 index 9977a2836c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/.hidden.ignore +++ /dev/null @@ -1 +0,0 @@ -invalid diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/dir.ignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore deleted file mode 100644 index 9977a2836c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/file.ignore +++ /dev/null @@ -1 +0,0 @@ -invalid diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/fmtcmd/test-fixtures/good.hcl deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go deleted file mode 100644 index 5c99381dfb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error.go +++ /dev/null @@ -1,17 +0,0 @@ -package parser - -import ( - "fmt" - - "github.com/hashicorp/hcl/hcl/token" -) - -// PosError is a parse error that contains a position. -type PosError struct { - Pos token.Pos - Err error -} - -func (e *PosError) Error() string { - return fmt.Sprintf("At %s: %s", e.Pos, e.Err) -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go deleted file mode 100644 index 32399fec5d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/error_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package parser - -import ( - "testing" -) - -func TestPosError_impl(t *testing.T) { - var _ error = new(PosError) -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go deleted file mode 100644 index 64c83bcfb5..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser.go +++ /dev/null @@ -1,532 +0,0 @@ -// Package parser implements a parser for HCL (HashiCorp Configuration -// Language) -package parser - -import ( - "bytes" - "errors" - "fmt" - "strings" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/scanner" - "github.com/hashicorp/hcl/hcl/token" -) - -type Parser struct { - sc *scanner.Scanner - - // Last read token - tok token.Token - commaPrev token.Token - - comments []*ast.CommentGroup - leadComment *ast.CommentGroup // last lead comment - lineComment *ast.CommentGroup // last line comment - - enableTrace bool - indent int - n int // buffer size (max = 1) -} - -func newParser(src []byte) *Parser { - return &Parser{ - sc: scanner.New(src), - } -} - -// Parse returns the fully parsed source and returns the abstract syntax tree. -func Parse(src []byte) (*ast.File, error) { - // normalize all line endings - // since the scanner and output only work with "\n" line endings, we may - // end up with dangling "\r" characters in the parsed data. - src = bytes.Replace(src, []byte("\r\n"), []byte("\n"), -1) - - p := newParser(src) - return p.Parse() -} - -var errEofToken = errors.New("EOF token found") - -// Parse returns the fully parsed source and returns the abstract syntax tree. -func (p *Parser) Parse() (*ast.File, error) { - f := &ast.File{} - var err, scerr error - p.sc.Error = func(pos token.Pos, msg string) { - scerr = &PosError{Pos: pos, Err: errors.New(msg)} - } - - f.Node, err = p.objectList(false) - if scerr != nil { - return nil, scerr - } - if err != nil { - return nil, err - } - - f.Comments = p.comments - return f, nil -} - -// objectList parses a list of items within an object (generally k/v pairs). -// The parameter" obj" tells this whether to we are within an object (braces: -// '{', '}') or just at the top level. If we're within an object, we end -// at an RBRACE. -func (p *Parser) objectList(obj bool) (*ast.ObjectList, error) { - defer un(trace(p, "ParseObjectList")) - node := &ast.ObjectList{} - - for { - if obj { - tok := p.scan() - p.unscan() - if tok.Type == token.RBRACE { - break - } - } - - n, err := p.objectItem() - if err == errEofToken { - break // we are finished - } - - // we don't return a nil node, because might want to use already - // collected items. - if err != nil { - return node, err - } - - node.Add(n) - - // object lists can be optionally comma-delimited e.g. when a list of maps - // is being expressed, so a comma is allowed here - it's simply consumed - tok := p.scan() - if tok.Type != token.COMMA { - p.unscan() - } - } - return node, nil -} - -func (p *Parser) consumeComment() (comment *ast.Comment, endline int) { - endline = p.tok.Pos.Line - - // count the endline if it's multiline comment, ie starting with /* - if len(p.tok.Text) > 1 && p.tok.Text[1] == '*' { - // don't use range here - no need to decode Unicode code points - for i := 0; i < len(p.tok.Text); i++ { - if p.tok.Text[i] == '\n' { - endline++ - } - } - } - - comment = &ast.Comment{Start: p.tok.Pos, Text: p.tok.Text} - p.tok = p.sc.Scan() - return -} - -func (p *Parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) { - var list []*ast.Comment - endline = p.tok.Pos.Line - - for p.tok.Type == token.COMMENT && p.tok.Pos.Line <= endline+n { - var comment *ast.Comment - comment, endline = p.consumeComment() - list = append(list, comment) - } - - // add comment group to the comments list - comments = &ast.CommentGroup{List: list} - p.comments = append(p.comments, comments) - - return -} - -// objectItem parses a single object item -func (p *Parser) objectItem() (*ast.ObjectItem, error) { - defer un(trace(p, "ParseObjectItem")) - - keys, err := p.objectKey() - if len(keys) > 0 && err == errEofToken { - // We ignore eof token here since it is an error if we didn't - // receive a value (but we did receive a key) for the item. - err = nil - } - if len(keys) > 0 && err != nil && p.tok.Type == token.RBRACE { - // This is a strange boolean statement, but what it means is: - // We have keys with no value, and we're likely in an object - // (since RBrace ends an object). For this, we set err to nil so - // we continue and get the error below of having the wrong value - // type. - err = nil - - // Reset the token type so we don't think it completed fine. See - // objectType which uses p.tok.Type to check if we're done with - // the object. - p.tok.Type = token.EOF - } - if err != nil { - return nil, err - } - - o := &ast.ObjectItem{ - Keys: keys, - } - - if p.leadComment != nil { - o.LeadComment = p.leadComment - p.leadComment = nil - } - - switch p.tok.Type { - case token.ASSIGN: - o.Assign = p.tok.Pos - o.Val, err = p.object() - if err != nil { - return nil, err - } - case token.LBRACE: - o.Val, err = p.objectType() - if err != nil { - return nil, err - } - default: - keyStr := make([]string, 0, len(keys)) - for _, k := range keys { - keyStr = append(keyStr, k.Token.Text) - } - - return nil, &PosError{ - Pos: p.tok.Pos, - Err: fmt.Errorf( - "key '%s' expected start of object ('{') or assignment ('=')", - strings.Join(keyStr, " ")), - } - } - - // key=#comment - // val - if p.lineComment != nil { - o.LineComment, p.lineComment = p.lineComment, nil - } - - // do a look-ahead for line comment - p.scan() - if len(keys) > 0 && o.Val.Pos().Line == keys[0].Pos().Line && p.lineComment != nil { - o.LineComment = p.lineComment - p.lineComment = nil - } - p.unscan() - return o, nil -} - -// objectKey parses an object key and returns a ObjectKey AST -func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { - keyCount := 0 - keys := make([]*ast.ObjectKey, 0) - - for { - tok := p.scan() - switch tok.Type { - case token.EOF: - // It is very important to also return the keys here as well as - // the error. This is because we need to be able to tell if we - // did parse keys prior to finding the EOF, or if we just found - // a bare EOF. - return keys, errEofToken - case token.ASSIGN: - // assignment or object only, but not nested objects. this is not - // allowed: `foo bar = {}` - if keyCount > 1 { - return nil, &PosError{ - Pos: p.tok.Pos, - Err: fmt.Errorf("nested object expected: LBRACE got: %s", p.tok.Type), - } - } - - if keyCount == 0 { - return nil, &PosError{ - Pos: p.tok.Pos, - Err: errors.New("no object keys found!"), - } - } - - return keys, nil - case token.LBRACE: - var err error - - // If we have no keys, then it is a syntax error. i.e. {{}} is not - // allowed. - if len(keys) == 0 { - err = &PosError{ - Pos: p.tok.Pos, - Err: fmt.Errorf("expected: IDENT | STRING got: %s", p.tok.Type), - } - } - - // object - return keys, err - case token.IDENT, token.STRING: - keyCount++ - keys = append(keys, &ast.ObjectKey{Token: p.tok}) - case token.ILLEGAL: - return keys, &PosError{ - Pos: p.tok.Pos, - Err: fmt.Errorf("illegal character"), - } - default: - return keys, &PosError{ - Pos: p.tok.Pos, - Err: fmt.Errorf("expected: IDENT | STRING | ASSIGN | LBRACE got: %s", p.tok.Type), - } - } - } -} - -// object parses any type of object, such as number, bool, string, object or -// list. -func (p *Parser) object() (ast.Node, error) { - defer un(trace(p, "ParseType")) - tok := p.scan() - - switch tok.Type { - case token.NUMBER, token.FLOAT, token.BOOL, token.STRING, token.HEREDOC: - return p.literalType() - case token.LBRACE: - return p.objectType() - case token.LBRACK: - return p.listType() - case token.COMMENT: - // implement comment - case token.EOF: - return nil, errEofToken - } - - return nil, &PosError{ - Pos: tok.Pos, - Err: fmt.Errorf("Unknown token: %+v", tok), - } -} - -// objectType parses an object type and returns a ObjectType AST -func (p *Parser) objectType() (*ast.ObjectType, error) { - defer un(trace(p, "ParseObjectType")) - - // we assume that the currently scanned token is a LBRACE - o := &ast.ObjectType{ - Lbrace: p.tok.Pos, - } - - l, err := p.objectList(true) - - // if we hit RBRACE, we are good to go (means we parsed all Items), if it's - // not a RBRACE, it's an syntax error and we just return it. - if err != nil && p.tok.Type != token.RBRACE { - return nil, err - } - - // No error, scan and expect the ending to be a brace - if tok := p.scan(); tok.Type != token.RBRACE { - return nil, &PosError{ - Pos: tok.Pos, - Err: fmt.Errorf("object expected closing RBRACE got: %s", tok.Type), - } - } - - o.List = l - o.Rbrace = p.tok.Pos // advanced via parseObjectList - return o, nil -} - -// listType parses a list type and returns a ListType AST -func (p *Parser) listType() (*ast.ListType, error) { - defer un(trace(p, "ParseListType")) - - // we assume that the currently scanned token is a LBRACK - l := &ast.ListType{ - Lbrack: p.tok.Pos, - } - - needComma := false - for { - tok := p.scan() - if needComma { - switch tok.Type { - case token.COMMA, token.RBRACK: - default: - return nil, &PosError{ - Pos: tok.Pos, - Err: fmt.Errorf( - "error parsing list, expected comma or list end, got: %s", - tok.Type), - } - } - } - switch tok.Type { - case token.BOOL, token.NUMBER, token.FLOAT, token.STRING, token.HEREDOC: - node, err := p.literalType() - if err != nil { - return nil, err - } - - // If there is a lead comment, apply it - if p.leadComment != nil { - node.LeadComment = p.leadComment - p.leadComment = nil - } - - l.Add(node) - needComma = true - case token.COMMA: - // get next list item or we are at the end - // do a look-ahead for line comment - p.scan() - if p.lineComment != nil && len(l.List) > 0 { - lit, ok := l.List[len(l.List)-1].(*ast.LiteralType) - if ok { - lit.LineComment = p.lineComment - l.List[len(l.List)-1] = lit - p.lineComment = nil - } - } - p.unscan() - - needComma = false - continue - case token.LBRACE: - // Looks like a nested object, so parse it out - node, err := p.objectType() - if err != nil { - return nil, &PosError{ - Pos: tok.Pos, - Err: fmt.Errorf( - "error while trying to parse object within list: %s", err), - } - } - l.Add(node) - needComma = true - case token.LBRACK: - node, err := p.listType() - if err != nil { - return nil, &PosError{ - Pos: tok.Pos, - Err: fmt.Errorf( - "error while trying to parse list within list: %s", err), - } - } - l.Add(node) - case token.RBRACK: - // finished - l.Rbrack = p.tok.Pos - return l, nil - default: - return nil, &PosError{ - Pos: tok.Pos, - Err: fmt.Errorf("unexpected token while parsing list: %s", tok.Type), - } - } - } -} - -// literalType parses a literal type and returns a LiteralType AST -func (p *Parser) literalType() (*ast.LiteralType, error) { - defer un(trace(p, "ParseLiteral")) - - return &ast.LiteralType{ - Token: p.tok, - }, nil -} - -// scan returns the next token from the underlying scanner. If a token has -// been unscanned then read that instead. In the process, it collects any -// comment groups encountered, and remembers the last lead and line comments. -func (p *Parser) scan() token.Token { - // If we have a token on the buffer, then return it. - if p.n != 0 { - p.n = 0 - return p.tok - } - - // Otherwise read the next token from the scanner and Save it to the buffer - // in case we unscan later. - prev := p.tok - p.tok = p.sc.Scan() - - if p.tok.Type == token.COMMENT { - var comment *ast.CommentGroup - var endline int - - // fmt.Printf("p.tok.Pos.Line = %+v prev: %d endline %d \n", - // p.tok.Pos.Line, prev.Pos.Line, endline) - if p.tok.Pos.Line == prev.Pos.Line { - // The comment is on same line as the previous token; it - // cannot be a lead comment but may be a line comment. - comment, endline = p.consumeCommentGroup(0) - if p.tok.Pos.Line != endline { - // The next token is on a different line, thus - // the last comment group is a line comment. - p.lineComment = comment - } - } - - // consume successor comments, if any - endline = -1 - for p.tok.Type == token.COMMENT { - comment, endline = p.consumeCommentGroup(1) - } - - if endline+1 == p.tok.Pos.Line && p.tok.Type != token.RBRACE { - switch p.tok.Type { - case token.RBRACE, token.RBRACK: - // Do not count for these cases - default: - // The next token is following on the line immediately after the - // comment group, thus the last comment group is a lead comment. - p.leadComment = comment - } - } - - } - - return p.tok -} - -// unscan pushes the previously read token back onto the buffer. -func (p *Parser) unscan() { - p.n = 1 -} - -// ---------------------------------------------------------------------------- -// Parsing support - -func (p *Parser) printTrace(a ...interface{}) { - if !p.enableTrace { - return - } - - const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " - const n = len(dots) - fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) - - i := 2 * p.indent - for i > n { - fmt.Print(dots) - i -= n - } - // i <= n - fmt.Print(dots[0:i]) - fmt.Println(a...) -} - -func trace(p *Parser, msg string) *Parser { - p.printTrace(msg, "(") - p.indent++ - return p -} - -// Usage pattern: defer un(trace(p, "...")) -func un(p *Parser) { - p.indent-- - p.printTrace(")") -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go deleted file mode 100644 index 2702122076..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/parser/parser_test.go +++ /dev/null @@ -1,575 +0,0 @@ -package parser - -import ( - "fmt" - "io/ioutil" - "path/filepath" - "reflect" - "runtime" - "strings" - "testing" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/token" -) - -func TestType(t *testing.T) { - var literals = []struct { - typ token.Type - src string - }{ - {token.STRING, `foo = "foo"`}, - {token.NUMBER, `foo = 123`}, - {token.NUMBER, `foo = -29`}, - {token.FLOAT, `foo = 123.12`}, - {token.FLOAT, `foo = -123.12`}, - {token.BOOL, `foo = true`}, - {token.HEREDOC, "foo = <= 0 { - result = p.heredocIndent(result) - } - } - - return result -} - -// objectItem returns the printable HCL form of an object item. An object type -// starts with one/multiple keys and has a value. The value might be of any -// type. -func (p *printer) objectItem(o *ast.ObjectItem) []byte { - defer un(trace(p, fmt.Sprintf("ObjectItem: %s", o.Keys[0].Token.Text))) - var buf bytes.Buffer - - if o.LeadComment != nil { - for _, comment := range o.LeadComment.List { - buf.WriteString(comment.Text) - buf.WriteByte(newline) - } - } - - // If key and val are on different lines, treat line comments like lead comments. - if o.LineComment != nil && o.Val.Pos().Line != o.Keys[0].Pos().Line { - for _, comment := range o.LineComment.List { - buf.WriteString(comment.Text) - buf.WriteByte(newline) - } - } - - for i, k := range o.Keys { - buf.WriteString(k.Token.Text) - buf.WriteByte(blank) - - // reach end of key - if o.Assign.IsValid() && i == len(o.Keys)-1 && len(o.Keys) == 1 { - buf.WriteString("=") - buf.WriteByte(blank) - } - } - - buf.Write(p.output(o.Val)) - - if o.LineComment != nil && o.Val.Pos().Line == o.Keys[0].Pos().Line { - buf.WriteByte(blank) - for _, comment := range o.LineComment.List { - buf.WriteString(comment.Text) - } - } - - return buf.Bytes() -} - -// objectType returns the printable HCL form of an object type. An object type -// begins with a brace and ends with a brace. -func (p *printer) objectType(o *ast.ObjectType) []byte { - defer un(trace(p, "ObjectType")) - var buf bytes.Buffer - buf.WriteString("{") - - var index int - var nextItem token.Pos - var commented, newlinePrinted bool - for { - // Determine the location of the next actual non-comment - // item. If we're at the end, the next item is the closing brace - if index != len(o.List.Items) { - nextItem = o.List.Items[index].Pos() - } else { - nextItem = o.Rbrace - } - - // Go through the standalone comments in the file and print out - // the comments that we should be for this object item. - for _, c := range p.standaloneComments { - printed := false - var lastCommentPos token.Pos - for _, comment := range c.List { - // We only care about comments after the previous item - // we've printed so that comments are printed in the - // correct locations (between two objects for example). - // And before the next item. - if comment.Pos().After(p.prev) && comment.Pos().Before(nextItem) { - // If there are standalone comments and the initial newline has not - // been printed yet, do it now. - if !newlinePrinted { - newlinePrinted = true - buf.WriteByte(newline) - } - - // add newline if it's between other printed nodes - if index > 0 { - commented = true - buf.WriteByte(newline) - } - - // Store this position - lastCommentPos = comment.Pos() - - // output the comment itself - buf.Write(p.indent(p.heredocIndent([]byte(comment.Text)))) - - // Set printed to true to note that we printed something - printed = true - - /* - if index != len(o.List.Items) { - buf.WriteByte(newline) // do not print on the end - } - */ - } - } - - // Stuff to do if we had comments - if printed { - // Always write a newline - buf.WriteByte(newline) - - // If there is another item in the object and our comment - // didn't hug it directly, then make sure there is a blank - // line separating them. - if nextItem != o.Rbrace && nextItem.Line != lastCommentPos.Line+1 { - buf.WriteByte(newline) - } - } - } - - if index == len(o.List.Items) { - p.prev = o.Rbrace - break - } - - // At this point we are sure that it's not a totally empty block: print - // the initial newline if it hasn't been printed yet by the previous - // block about standalone comments. - if !newlinePrinted { - buf.WriteByte(newline) - newlinePrinted = true - } - - // check if we have adjacent one liner items. If yes we'll going to align - // the comments. - var aligned []*ast.ObjectItem - for _, item := range o.List.Items[index:] { - // we don't group one line lists - if len(o.List.Items) == 1 { - break - } - - // one means a oneliner with out any lead comment - // two means a oneliner with lead comment - // anything else might be something else - cur := lines(string(p.objectItem(item))) - if cur > 2 { - break - } - - curPos := item.Pos() - - nextPos := token.Pos{} - if index != len(o.List.Items)-1 { - nextPos = o.List.Items[index+1].Pos() - } - - prevPos := token.Pos{} - if index != 0 { - prevPos = o.List.Items[index-1].Pos() - } - - // fmt.Println("DEBUG ----------------") - // fmt.Printf("prev = %+v prevPos: %s\n", prev, prevPos) - // fmt.Printf("cur = %+v curPos: %s\n", cur, curPos) - // fmt.Printf("next = %+v nextPos: %s\n", next, nextPos) - - if curPos.Line+1 == nextPos.Line { - aligned = append(aligned, item) - index++ - continue - } - - if curPos.Line-1 == prevPos.Line { - aligned = append(aligned, item) - index++ - - // finish if we have a new line or comment next. This happens - // if the next item is not adjacent - if curPos.Line+1 != nextPos.Line { - break - } - continue - } - - break - } - - // put newlines if the items are between other non aligned items. - // newlines are also added if there is a standalone comment already, so - // check it too - if !commented && index != len(aligned) { - buf.WriteByte(newline) - } - - if len(aligned) >= 1 { - p.prev = aligned[len(aligned)-1].Pos() - - items := p.alignedItems(aligned) - buf.Write(p.indent(items)) - } else { - p.prev = o.List.Items[index].Pos() - - buf.Write(p.indent(p.objectItem(o.List.Items[index]))) - index++ - } - - buf.WriteByte(newline) - } - - buf.WriteString("}") - return buf.Bytes() -} - -func (p *printer) alignedItems(items []*ast.ObjectItem) []byte { - var buf bytes.Buffer - - // find the longest key and value length, needed for alignment - var longestKeyLen int // longest key length - var longestValLen int // longest value length - for _, item := range items { - key := len(item.Keys[0].Token.Text) - val := len(p.output(item.Val)) - - if key > longestKeyLen { - longestKeyLen = key - } - - if val > longestValLen { - longestValLen = val - } - } - - for i, item := range items { - if item.LeadComment != nil { - for _, comment := range item.LeadComment.List { - buf.WriteString(comment.Text) - buf.WriteByte(newline) - } - } - - for i, k := range item.Keys { - keyLen := len(k.Token.Text) - buf.WriteString(k.Token.Text) - for i := 0; i < longestKeyLen-keyLen+1; i++ { - buf.WriteByte(blank) - } - - // reach end of key - if i == len(item.Keys)-1 && len(item.Keys) == 1 { - buf.WriteString("=") - buf.WriteByte(blank) - } - } - - val := p.output(item.Val) - valLen := len(val) - buf.Write(val) - - if item.Val.Pos().Line == item.Keys[0].Pos().Line && item.LineComment != nil { - for i := 0; i < longestValLen-valLen+1; i++ { - buf.WriteByte(blank) - } - - for _, comment := range item.LineComment.List { - buf.WriteString(comment.Text) - } - } - - // do not print for the last item - if i != len(items)-1 { - buf.WriteByte(newline) - } - } - - return buf.Bytes() -} - -// list returns the printable HCL form of an list type. -func (p *printer) list(l *ast.ListType) []byte { - if p.isSingleLineList(l) { - return p.singleLineList(l) - } - - var buf bytes.Buffer - buf.WriteString("[") - buf.WriteByte(newline) - - var longestLine int - for _, item := range l.List { - // for now we assume that the list only contains literal types - if lit, ok := item.(*ast.LiteralType); ok { - lineLen := len(lit.Token.Text) - if lineLen > longestLine { - longestLine = lineLen - } - } - } - - haveEmptyLine := false - for i, item := range l.List { - // If we have a lead comment, then we want to write that first - leadComment := false - if lit, ok := item.(*ast.LiteralType); ok && lit.LeadComment != nil { - leadComment = true - - // Ensure an empty line before every element with a - // lead comment (except the first item in a list). - if !haveEmptyLine && i != 0 { - buf.WriteByte(newline) - } - - for _, comment := range lit.LeadComment.List { - buf.Write(p.indent([]byte(comment.Text))) - buf.WriteByte(newline) - } - } - - // also indent each line - val := p.output(item) - curLen := len(val) - buf.Write(p.indent(val)) - - // if this item is a heredoc, then we output the comma on - // the next line. This is the only case this happens. - comma := []byte{','} - if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { - buf.WriteByte(newline) - comma = p.indent(comma) - } - - buf.Write(comma) - - if lit, ok := item.(*ast.LiteralType); ok && lit.LineComment != nil { - // if the next item doesn't have any comments, do not align - buf.WriteByte(blank) // align one space - for i := 0; i < longestLine-curLen; i++ { - buf.WriteByte(blank) - } - - for _, comment := range lit.LineComment.List { - buf.WriteString(comment.Text) - } - } - - buf.WriteByte(newline) - - // Ensure an empty line after every element with a - // lead comment (except the first item in a list). - haveEmptyLine = leadComment && i != len(l.List)-1 - if haveEmptyLine { - buf.WriteByte(newline) - } - } - - buf.WriteString("]") - return buf.Bytes() -} - -// isSingleLineList returns true if: -// * they were previously formatted entirely on one line -// * they consist entirely of literals -// * there are either no heredoc strings or the list has exactly one element -// * there are no line comments -func (printer) isSingleLineList(l *ast.ListType) bool { - for _, item := range l.List { - if item.Pos().Line != l.Lbrack.Line { - return false - } - - lit, ok := item.(*ast.LiteralType) - if !ok { - return false - } - - if lit.Token.Type == token.HEREDOC && len(l.List) != 1 { - return false - } - - if lit.LineComment != nil { - return false - } - } - - return true -} - -// singleLineList prints a simple single line list. -// For a definition of "simple", see isSingleLineList above. -func (p *printer) singleLineList(l *ast.ListType) []byte { - buf := &bytes.Buffer{} - - buf.WriteString("[") - for i, item := range l.List { - if i != 0 { - buf.WriteString(", ") - } - - // Output the item itself - buf.Write(p.output(item)) - - // The heredoc marker needs to be at the end of line. - if lit, ok := item.(*ast.LiteralType); ok && lit.Token.Type == token.HEREDOC { - buf.WriteByte(newline) - } - } - - buf.WriteString("]") - return buf.Bytes() -} - -// indent indents the lines of the given buffer for each non-empty line -func (p *printer) indent(buf []byte) []byte { - var prefix []byte - if p.cfg.SpacesWidth != 0 { - for i := 0; i < p.cfg.SpacesWidth; i++ { - prefix = append(prefix, blank) - } - } else { - prefix = []byte{tab} - } - - var res []byte - bol := true - for _, c := range buf { - if bol && c != '\n' { - res = append(res, prefix...) - } - - res = append(res, c) - bol = c == '\n' - } - return res -} - -// unindent removes all the indentation from the tombstoned lines -func (p *printer) unindent(buf []byte) []byte { - var res []byte - for i := 0; i < len(buf); i++ { - skip := len(buf)-i <= len(unindent) - if !skip { - skip = !bytes.Equal(unindent, buf[i:i+len(unindent)]) - } - if skip { - res = append(res, buf[i]) - continue - } - - // We have a marker. we have to backtrace here and clean out - // any whitespace ahead of our tombstone up to a \n - for j := len(res) - 1; j >= 0; j-- { - if res[j] == '\n' { - break - } - - res = res[:j] - } - - // Skip the entire unindent marker - i += len(unindent) - 1 - } - - return res -} - -// heredocIndent marks all the 2nd and further lines as unindentable -func (p *printer) heredocIndent(buf []byte) []byte { - var res []byte - bol := false - for _, c := range buf { - if bol && c != '\n' { - res = append(res, unindent...) - } - res = append(res, c) - bol = c == '\n' - } - return res -} - -// isSingleLineObject tells whether the given object item is a single -// line object such as "obj {}". -// -// A single line object: -// -// * has no lead comments (hence multi-line) -// * has no assignment -// * has no values in the stanza (within {}) -// -func (p *printer) isSingleLineObject(val *ast.ObjectItem) bool { - // If there is a lead comment, can't be one line - if val.LeadComment != nil { - return false - } - - // If there is assignment, we always break by line - if val.Assign.IsValid() { - return false - } - - // If it isn't an object type, then its not a single line object - ot, ok := val.Val.(*ast.ObjectType) - if !ok { - return false - } - - // If the object has no items, it is single line! - return len(ot.List.Items) == 0 -} - -func lines(txt string) int { - endline := 1 - for i := 0; i < len(txt); i++ { - if txt[i] == '\n' { - endline++ - } - } - return endline -} - -// ---------------------------------------------------------------------------- -// Tracing support - -func (p *printer) printTrace(a ...interface{}) { - if !p.enableTrace { - return - } - - const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " - const n = len(dots) - i := 2 * p.indentTrace - for i > n { - fmt.Print(dots) - i -= n - } - // i <= n - fmt.Print(dots[0:i]) - fmt.Println(a...) -} - -func trace(p *printer, msg string) *printer { - p.printTrace(msg, "(") - p.indentTrace++ - return p -} - -// Usage pattern: defer un(trace(p, "...")) -func un(p *printer) { - p.indentTrace-- - p.printTrace(")") -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go deleted file mode 100644 index 6617ab8e7a..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer.go +++ /dev/null @@ -1,66 +0,0 @@ -// Package printer implements printing of AST nodes to HCL format. -package printer - -import ( - "bytes" - "io" - "text/tabwriter" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/parser" -) - -var DefaultConfig = Config{ - SpacesWidth: 2, -} - -// A Config node controls the output of Fprint. -type Config struct { - SpacesWidth int // if set, it will use spaces instead of tabs for alignment -} - -func (c *Config) Fprint(output io.Writer, node ast.Node) error { - p := &printer{ - cfg: *c, - comments: make([]*ast.CommentGroup, 0), - standaloneComments: make([]*ast.CommentGroup, 0), - // enableTrace: true, - } - - p.collectComments(node) - - if _, err := output.Write(p.unindent(p.output(node))); err != nil { - return err - } - - // flush tabwriter, if any - var err error - if tw, _ := output.(*tabwriter.Writer); tw != nil { - err = tw.Flush() - } - - return err -} - -// Fprint "pretty-prints" an HCL node to output -// It calls Config.Fprint with default settings. -func Fprint(output io.Writer, node ast.Node) error { - return DefaultConfig.Fprint(output, node) -} - -// Format formats src HCL and returns the result. -func Format(src []byte) ([]byte, error) { - node, err := parser.Parse(src) - if err != nil { - return nil, err - } - - var buf bytes.Buffer - if err := DefaultConfig.Fprint(&buf, node); err != nil { - return nil, err - } - - // Add trailing newline to result - buf.WriteString("\n") - return buf.Bytes(), nil -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go deleted file mode 100644 index 8ae747ab82..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/printer_test.go +++ /dev/null @@ -1,176 +0,0 @@ -package printer - -import ( - "bytes" - "errors" - "flag" - "fmt" - "io/ioutil" - "path/filepath" - "testing" - - "github.com/hashicorp/hcl/hcl/parser" -) - -var update = flag.Bool("update", false, "update golden files") - -const ( - dataDir = "testdata" -) - -type entry struct { - source, golden string -} - -// Use go test -update to create/update the respective golden files. -var data = []entry{ - {"complexhcl.input", "complexhcl.golden"}, - {"list.input", "list.golden"}, - {"list_comment.input", "list_comment.golden"}, - {"comment.input", "comment.golden"}, - {"comment_crlf.input", "comment.golden"}, - {"comment_aligned.input", "comment_aligned.golden"}, - {"comment_array.input", "comment_array.golden"}, - {"comment_end_file.input", "comment_end_file.golden"}, - {"comment_multiline_indent.input", "comment_multiline_indent.golden"}, - {"comment_multiline_no_stanza.input", "comment_multiline_no_stanza.golden"}, - {"comment_multiline_stanza.input", "comment_multiline_stanza.golden"}, - {"comment_newline.input", "comment_newline.golden"}, - {"comment_object_multi.input", "comment_object_multi.golden"}, - {"comment_standalone.input", "comment_standalone.golden"}, - {"empty_block.input", "empty_block.golden"}, - {"list_of_objects.input", "list_of_objects.golden"}, - {"multiline_string.input", "multiline_string.golden"}, - {"object_singleline.input", "object_singleline.golden"}, - {"object_with_heredoc.input", "object_with_heredoc.golden"}, -} - -func TestFiles(t *testing.T) { - for _, e := range data { - source := filepath.Join(dataDir, e.source) - golden := filepath.Join(dataDir, e.golden) - t.Run(e.source, func(t *testing.T) { - check(t, source, golden) - }) - } -} - -func check(t *testing.T, source, golden string) { - src, err := ioutil.ReadFile(source) - if err != nil { - t.Error(err) - return - } - - res, err := format(src) - if err != nil { - t.Error(err) - return - } - - // update golden files if necessary - if *update { - if err := ioutil.WriteFile(golden, res, 0644); err != nil { - t.Error(err) - } - return - } - - // get golden - gld, err := ioutil.ReadFile(golden) - if err != nil { - t.Error(err) - return - } - - // formatted source and golden must be the same - if err := diff(source, golden, res, gld); err != nil { - t.Error(err) - return - } -} - -// diff compares a and b. -func diff(aname, bname string, a, b []byte) error { - var buf bytes.Buffer // holding long error message - - // compare lengths - if len(a) != len(b) { - fmt.Fprintf(&buf, "\nlength changed: len(%s) = %d, len(%s) = %d", aname, len(a), bname, len(b)) - } - - // compare contents - line := 1 - offs := 1 - for i := 0; i < len(a) && i < len(b); i++ { - ch := a[i] - if ch != b[i] { - fmt.Fprintf(&buf, "\n%s:%d:%d: %q", aname, line, i-offs+1, lineAt(a, offs)) - fmt.Fprintf(&buf, "\n%s:%d:%d: %q", bname, line, i-offs+1, lineAt(b, offs)) - fmt.Fprintf(&buf, "\n\n") - break - } - if ch == '\n' { - line++ - offs = i + 1 - } - } - - if buf.Len() > 0 { - return errors.New(buf.String()) - } - return nil -} - -// format parses src, prints the corresponding AST, verifies the resulting -// src is syntactically correct, and returns the resulting src or an error -// if any. -func format(src []byte) ([]byte, error) { - formatted, err := Format(src) - if err != nil { - return nil, err - } - - // make sure formatted output is syntactically correct - if _, err := parser.Parse(formatted); err != nil { - return nil, fmt.Errorf("parse: %s\n%s", err, formatted) - } - - return formatted, nil -} - -// lineAt returns the line in text starting at offset offs. -func lineAt(text []byte, offs int) []byte { - i := offs - for i < len(text) && text[i] != '\n' { - i++ - } - return text[offs:i] -} - -// TestFormatParsable ensures that the output of Format() is can be parsed again. -func TestFormatValidOutput(t *testing.T) { - cases := []string{ - "#\x00", - "#\ue123t", - "x=//\n0y=<<_\n_\n", - "y=[1,//\n]", - "Y=<<4\n4/\n\n\n/4/@=4/\n\n\n/4000000004\r\r\n00004\n", - "x=<<_\n_\r\r\n_\n", - "X=<<-\n\r\r\n", - } - - for _, c := range cases { - f, err := Format([]byte(c)) - if err != nil { - // ignore these failures, not all inputs are valid HCL. - t.Logf("Format(%q) = %v", c, err) - continue - } - - if _, err := parser.Parse(f); err != nil { - t.Errorf("Format(%q) = %q; Parse(%q) = %v", c, f, f, err) - continue - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden deleted file mode 100644 index 192c26aac1..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.golden +++ /dev/null @@ -1,39 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - -// This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = ["fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1, 2] // another line here - -# Another comment -variable = { - description = "bar" # another yooo - - foo { - # Nested standalone - - bar = "fatih" - } -} - -// lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 - -// comment -multiline = "assignment" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input deleted file mode 100644 index c4b29de7fe..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment.input +++ /dev/null @@ -1,39 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - - // This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = [ "fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1,2] // another line here - - # Another comment -variable = { - description = "bar" # another yooo - foo { - # Nested standalone - - bar = "fatih" - } -} - - // lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 - -multiline = // comment -"assignment" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden deleted file mode 100644 index 6ff21504c9..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.golden +++ /dev/null @@ -1,32 +0,0 @@ -aligned { - # We have some aligned items below - foo = "fatih" # yoo1 - default = "bar" # yoo2 - bar = "bar and foo" # yoo3 - - default = { - bar = "example" - } - - #deneme arslan - fatih = ["fatih"] # yoo4 - - #fatih arslan - fatiharslan = ["arslan"] // yoo5 - - default = { - bar = "example" - } - - security_groups = [ - "foo", # kenya 1 - "${aws_security_group.firewall.foo}", # kenya 2 - ] - - security_groups2 = [ - "foo", # kenya 1 - "bar", # kenya 1.5 - "${aws_security_group.firewall.foo}", # kenya 2 - "foobar", # kenya 3 - ] -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input deleted file mode 100644 index bd43ab1adc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_aligned.input +++ /dev/null @@ -1,28 +0,0 @@ -aligned { -# We have some aligned items below - foo = "fatih" # yoo1 - default = "bar" # yoo2 - bar = "bar and foo" # yoo3 - default = { - bar = "example" - } - #deneme arslan - fatih = ["fatih"] # yoo4 - #fatih arslan - fatiharslan = ["arslan"] // yoo5 - default = { - bar = "example" - } - -security_groups = [ - "foo", # kenya 1 - "${aws_security_group.firewall.foo}", # kenya 2 -] - -security_groups2 = [ - "foo", # kenya 1 - "bar", # kenya 1.5 - "${aws_security_group.firewall.foo}", # kenya 2 - "foobar", # kenya 3 -] -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden deleted file mode 100644 index e778eafa36..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.golden +++ /dev/null @@ -1,13 +0,0 @@ -banana = [ - # I really want to comment this item in the array. - "a", - - # This as well - "b", - - "c", # And C - "d", - - # And another - "e", -] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input deleted file mode 100644 index e778eafa36..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_array.input +++ /dev/null @@ -1,13 +0,0 @@ -banana = [ - # I really want to comment this item in the array. - "a", - - # This as well - "b", - - "c", # And C - "d", - - # And another - "e", -] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input deleted file mode 100644 index 495508644b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_crlf.input +++ /dev/null @@ -1,39 +0,0 @@ -// A standalone comment is a comment which is not attached to any kind of node - - // This comes from Terraform, as a test -variable "foo" { - # Standalone comment should be still here - - default = "bar" - description = "bar" # yooo -} - -/* This is a multi line standalone -comment*/ - - -// fatih arslan -/* This is a developer test -account and a multine comment */ -developer = [ "fatih", "arslan"] // fatih arslan - -# One line here -numbers = [1,2] // another line here - - # Another comment -variable = { - description = "bar" # another yooo - foo { - # Nested standalone - - bar = "fatih" - } -} - - // lead comment -foo { - bar = "fatih" // line comment 2 -} // line comment 3 - -multiline = // comment -"assignment" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden deleted file mode 100644 index dbeae36a8b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.golden +++ /dev/null @@ -1,6 +0,0 @@ -resource "blah" "blah" {} - -// -// -// - diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input deleted file mode 100644 index 68c4c282ec..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_end_file.input +++ /dev/null @@ -1,5 +0,0 @@ -resource "blah" "blah" {} - -// -// -// diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden b/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden deleted file mode 100644 index 74c4ccd896..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/printer/testdata/comment_multiline_indent.golden +++ /dev/null @@ -1,12 +0,0 @@ -resource "provider" "resource" { - /* - SPACE_SENSITIVE_CODE = < 0 { - // common case: last character was not a '\n' - s.tokPos.Line = s.srcPos.Line - s.tokPos.Column = s.srcPos.Column - } else { - // last character was a '\n' - // (we cannot be at the beginning of the source - // since we have called next() at least once) - s.tokPos.Line = s.srcPos.Line - 1 - s.tokPos.Column = s.lastLineLen - } - - switch { - case isLetter(ch): - tok = token.IDENT - lit := s.scanIdentifier() - if lit == "true" || lit == "false" { - tok = token.BOOL - } - case isDecimal(ch): - tok = s.scanNumber(ch) - default: - switch ch { - case eof: - tok = token.EOF - case '"': - tok = token.STRING - s.scanString() - case '#', '/': - tok = token.COMMENT - s.scanComment(ch) - case '.': - tok = token.PERIOD - ch = s.peek() - if isDecimal(ch) { - tok = token.FLOAT - ch = s.scanMantissa(ch) - ch = s.scanExponent(ch) - } - case '<': - tok = token.HEREDOC - s.scanHeredoc() - case '[': - tok = token.LBRACK - case ']': - tok = token.RBRACK - case '{': - tok = token.LBRACE - case '}': - tok = token.RBRACE - case ',': - tok = token.COMMA - case '=': - tok = token.ASSIGN - case '+': - tok = token.ADD - case '-': - if isDecimal(s.peek()) { - ch := s.next() - tok = s.scanNumber(ch) - } else { - tok = token.SUB - } - default: - s.err("illegal char") - } - } - - // finish token ending - s.tokEnd = s.srcPos.Offset - - // create token literal - var tokenText string - if s.tokStart >= 0 { - tokenText = string(s.src[s.tokStart:s.tokEnd]) - } - s.tokStart = s.tokEnd // ensure idempotency of tokenText() call - - return token.Token{ - Type: tok, - Pos: s.tokPos, - Text: tokenText, - } -} - -func (s *Scanner) scanComment(ch rune) { - // single line comments - if ch == '#' || (ch == '/' && s.peek() != '*') { - if ch == '/' && s.peek() != '/' { - s.err("expected '/' for comment") - return - } - - ch = s.next() - for ch != '\n' && ch >= 0 && ch != eof { - ch = s.next() - } - if ch != eof && ch >= 0 { - s.unread() - } - return - } - - // be sure we get the character after /* This allows us to find comment's - // that are not erminated - if ch == '/' { - s.next() - ch = s.next() // read character after "/*" - } - - // look for /* - style comments - for { - if ch < 0 || ch == eof { - s.err("comment not terminated") - break - } - - ch0 := ch - ch = s.next() - if ch0 == '*' && ch == '/' { - break - } - } -} - -// scanNumber scans a HCL number definition starting with the given rune -func (s *Scanner) scanNumber(ch rune) token.Type { - if ch == '0' { - // check for hexadecimal, octal or float - ch = s.next() - if ch == 'x' || ch == 'X' { - // hexadecimal - ch = s.next() - found := false - for isHexadecimal(ch) { - ch = s.next() - found = true - } - - if !found { - s.err("illegal hexadecimal number") - } - - if ch != eof { - s.unread() - } - - return token.NUMBER - } - - // now it's either something like: 0421(octal) or 0.1231(float) - illegalOctal := false - for isDecimal(ch) { - ch = s.next() - if ch == '8' || ch == '9' { - // this is just a possibility. For example 0159 is illegal, but - // 0159.23 is valid. So we mark a possible illegal octal. If - // the next character is not a period, we'll print the error. - illegalOctal = true - } - } - - if ch == 'e' || ch == 'E' { - ch = s.scanExponent(ch) - return token.FLOAT - } - - if ch == '.' { - ch = s.scanFraction(ch) - - if ch == 'e' || ch == 'E' { - ch = s.next() - ch = s.scanExponent(ch) - } - return token.FLOAT - } - - if illegalOctal { - s.err("illegal octal number") - } - - if ch != eof { - s.unread() - } - return token.NUMBER - } - - s.scanMantissa(ch) - ch = s.next() // seek forward - if ch == 'e' || ch == 'E' { - ch = s.scanExponent(ch) - return token.FLOAT - } - - if ch == '.' { - ch = s.scanFraction(ch) - if ch == 'e' || ch == 'E' { - ch = s.next() - ch = s.scanExponent(ch) - } - return token.FLOAT - } - - if ch != eof { - s.unread() - } - return token.NUMBER -} - -// scanMantissa scans the mantissa beginning from the rune. It returns the next -// non decimal rune. It's used to determine wheter it's a fraction or exponent. -func (s *Scanner) scanMantissa(ch rune) rune { - scanned := false - for isDecimal(ch) { - ch = s.next() - scanned = true - } - - if scanned && ch != eof { - s.unread() - } - return ch -} - -// scanFraction scans the fraction after the '.' rune -func (s *Scanner) scanFraction(ch rune) rune { - if ch == '.' { - ch = s.peek() // we peek just to see if we can move forward - ch = s.scanMantissa(ch) - } - return ch -} - -// scanExponent scans the remaining parts of an exponent after the 'e' or 'E' -// rune. -func (s *Scanner) scanExponent(ch rune) rune { - if ch == 'e' || ch == 'E' { - ch = s.next() - if ch == '-' || ch == '+' { - ch = s.next() - } - ch = s.scanMantissa(ch) - } - return ch -} - -// scanHeredoc scans a heredoc string -func (s *Scanner) scanHeredoc() { - // Scan the second '<' in example: '<= len(identBytes) && identRegexp.Match(s.src[lineStart:s.srcPos.Offset-s.lastCharLen]) { - break - } - - // Not an anchor match, record the start of a new line - lineStart = s.srcPos.Offset - } - - if ch == eof { - s.err("heredoc not terminated") - return - } - } - - return -} - -// scanString scans a quoted string -func (s *Scanner) scanString() { - braces := 0 - for { - // '"' opening already consumed - // read character after quote - ch := s.next() - - if (ch == '\n' && braces == 0) || ch < 0 || ch == eof { - s.err("literal not terminated") - return - } - - if ch == '"' && braces == 0 { - break - } - - // If we're going into a ${} then we can ignore quotes for awhile - if braces == 0 && ch == '$' && s.peek() == '{' { - braces++ - s.next() - } else if braces > 0 && ch == '{' { - braces++ - } - if braces > 0 && ch == '}' { - braces-- - } - - if ch == '\\' { - s.scanEscape() - } - } - - return -} - -// scanEscape scans an escape sequence -func (s *Scanner) scanEscape() rune { - // http://en.cppreference.com/w/cpp/language/escape - ch := s.next() // read character after '/' - switch ch { - case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': - // nothing to do - case '0', '1', '2', '3', '4', '5', '6', '7': - // octal notation - ch = s.scanDigits(ch, 8, 3) - case 'x': - // hexademical notation - ch = s.scanDigits(s.next(), 16, 2) - case 'u': - // universal character name - ch = s.scanDigits(s.next(), 16, 4) - case 'U': - // universal character name - ch = s.scanDigits(s.next(), 16, 8) - default: - s.err("illegal char escape") - } - return ch -} - -// scanDigits scans a rune with the given base for n times. For example an -// octal notation \184 would yield in scanDigits(ch, 8, 3) -func (s *Scanner) scanDigits(ch rune, base, n int) rune { - start := n - for n > 0 && digitVal(ch) < base { - ch = s.next() - if ch == eof { - // If we see an EOF, we halt any more scanning of digits - // immediately. - break - } - - n-- - } - if n > 0 { - s.err("illegal char escape") - } - - if n != start && ch != eof { - // we scanned all digits, put the last non digit char back, - // only if we read anything at all - s.unread() - } - - return ch -} - -// scanIdentifier scans an identifier and returns the literal string -func (s *Scanner) scanIdentifier() string { - offs := s.srcPos.Offset - s.lastCharLen - ch := s.next() - for isLetter(ch) || isDigit(ch) || ch == '-' || ch == '.' { - ch = s.next() - } - - if ch != eof { - s.unread() // we got identifier, put back latest char - } - - return string(s.src[offs:s.srcPos.Offset]) -} - -// recentPosition returns the position of the character immediately after the -// character or token returned by the last call to Scan. -func (s *Scanner) recentPosition() (pos token.Pos) { - pos.Offset = s.srcPos.Offset - s.lastCharLen - switch { - case s.srcPos.Column > 0: - // common case: last character was not a '\n' - pos.Line = s.srcPos.Line - pos.Column = s.srcPos.Column - case s.lastLineLen > 0: - // last character was a '\n' - // (we cannot be at the beginning of the source - // since we have called next() at least once) - pos.Line = s.srcPos.Line - 1 - pos.Column = s.lastLineLen - default: - // at the beginning of the source - pos.Line = 1 - pos.Column = 1 - } - return -} - -// err prints the error of any scanning to s.Error function. If the function is -// not defined, by default it prints them to os.Stderr -func (s *Scanner) err(msg string) { - s.ErrorCount++ - pos := s.recentPosition() - - if s.Error != nil { - s.Error(pos, msg) - return - } - - fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) -} - -// isHexadecimal returns true if the given rune is a letter -func isLetter(ch rune) bool { - return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) -} - -// isDigit returns true if the given rune is a decimal digit -func isDigit(ch rune) bool { - return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) -} - -// isDecimal returns true if the given rune is a decimal number -func isDecimal(ch rune) bool { - return '0' <= ch && ch <= '9' -} - -// isHexadecimal returns true if the given rune is an hexadecimal number -func isHexadecimal(ch rune) bool { - return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' -} - -// isWhitespace returns true if the rune is a space, tab, newline or carriage return -func isWhitespace(ch rune) bool { - return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' -} - -// digitVal returns the integer value of a given octal,decimal or hexadecimal rune -func digitVal(ch rune) int { - switch { - case '0' <= ch && ch <= '9': - return int(ch - '0') - case 'a' <= ch && ch <= 'f': - return int(ch - 'a' + 10) - case 'A' <= ch && ch <= 'F': - return int(ch - 'A' + 10) - } - return 16 // larger than any legal digit val -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go deleted file mode 100644 index 58d68f5c53..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/scanner/scanner_test.go +++ /dev/null @@ -1,642 +0,0 @@ -package scanner - -import ( - "bytes" - "fmt" - "testing" - - "strings" - - "github.com/hashicorp/hcl/hcl/token" -) - -var f100 = strings.Repeat("f", 100) - -type tokenPair struct { - tok token.Type - text string -} - -var tokenLists = map[string][]tokenPair{ - "comment": []tokenPair{ - {token.COMMENT, "//"}, - {token.COMMENT, "////"}, - {token.COMMENT, "// comment"}, - {token.COMMENT, "// /* comment */"}, - {token.COMMENT, "// // comment //"}, - {token.COMMENT, "//" + f100}, - {token.COMMENT, "#"}, - {token.COMMENT, "##"}, - {token.COMMENT, "# comment"}, - {token.COMMENT, "# /* comment */"}, - {token.COMMENT, "# # comment #"}, - {token.COMMENT, "#" + f100}, - {token.COMMENT, "/**/"}, - {token.COMMENT, "/***/"}, - {token.COMMENT, "/* comment */"}, - {token.COMMENT, "/* // comment */"}, - {token.COMMENT, "/* /* comment */"}, - {token.COMMENT, "/*\n comment\n*/"}, - {token.COMMENT, "/*" + f100 + "*/"}, - }, - "operator": []tokenPair{ - {token.LBRACK, "["}, - {token.LBRACE, "{"}, - {token.COMMA, ","}, - {token.PERIOD, "."}, - {token.RBRACK, "]"}, - {token.RBRACE, "}"}, - {token.ASSIGN, "="}, - {token.ADD, "+"}, - {token.SUB, "-"}, - }, - "bool": []tokenPair{ - {token.BOOL, "true"}, - {token.BOOL, "false"}, - }, - "ident": []tokenPair{ - {token.IDENT, "a"}, - {token.IDENT, "a0"}, - {token.IDENT, "foobar"}, - {token.IDENT, "foo-bar"}, - {token.IDENT, "abc123"}, - {token.IDENT, "LGTM"}, - {token.IDENT, "_"}, - {token.IDENT, "_abc123"}, - {token.IDENT, "abc123_"}, - {token.IDENT, "_abc_123_"}, - {token.IDENT, "_äöü"}, - {token.IDENT, "_本"}, - {token.IDENT, "äöü"}, - {token.IDENT, "本"}, - {token.IDENT, "a۰۱۸"}, - {token.IDENT, "foo६४"}, - {token.IDENT, "bar9876"}, - }, - "heredoc": []tokenPair{ - {token.HEREDOC, "< 0 for %q", s.ErrorCount, src) - } -} - -func testTokenList(t *testing.T, tokenList []tokenPair) { - // create artifical source code - buf := new(bytes.Buffer) - for _, ident := range tokenList { - fmt.Fprintf(buf, "%s\n", ident.text) - } - - s := New(buf.Bytes()) - for _, ident := range tokenList { - tok := s.Scan() - if tok.Type != ident.tok { - t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) - } - - if tok.Text != ident.text { - t.Errorf("text = %q want %q", tok.String(), ident.text) - } - - } -} - -func countNewlines(s string) int { - n := 0 - for _, ch := range s { - if ch == '\n' { - n++ - } - } - return n -} - -func TestScanDigitsUnread(t *testing.T) { - cases := []string{ - "M=0\"\\00", - "M=\"\\00", - "\"\\00", - "M=[\"\\00", - "U{\"\\00", - "\"\n{}#\n\"\\00", - "M=[[\"\\00", - "U{d=0\"\\U00", - "#\n\"\\x00", - "m=[[[\"\\00", - } - - for _, c := range cases { - s := New([]byte(c)) - - for { - tok := s.Scan() - if tok.Type == token.EOF { - break - } - t.Logf("s.Scan() = %s", tok) - } - } -} - -func TestScanHeredocRegexpCompile(t *testing.T) { - cases := []string{ - "0\xe1\n<<ȸ\nhello\nworld\nȸ", - } - - for _, c := range cases { - s := New([]byte(c)) - - for { - tok := s.Scan() - if tok.Type == token.EOF { - break - } - t.Logf("s.Scan() = %s", tok) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go deleted file mode 100644 index 5f981eaa2f..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote.go +++ /dev/null @@ -1,241 +0,0 @@ -package strconv - -import ( - "errors" - "unicode/utf8" -) - -// ErrSyntax indicates that a value does not have the right syntax for the target type. -var ErrSyntax = errors.New("invalid syntax") - -// Unquote interprets s as a single-quoted, double-quoted, -// or backquoted Go string literal, returning the string value -// that s quotes. (If s is single-quoted, it would be a Go -// character literal; Unquote returns the corresponding -// one-character string.) -func Unquote(s string) (t string, err error) { - n := len(s) - if n < 2 { - return "", ErrSyntax - } - quote := s[0] - if quote != s[n-1] { - return "", ErrSyntax - } - s = s[1 : n-1] - - if quote != '"' { - return "", ErrSyntax - } - if !contains(s, '$') && !contains(s, '{') && contains(s, '\n') { - return "", ErrSyntax - } - - // Is it trivial? Avoid allocation. - if !contains(s, '\\') && !contains(s, quote) && !contains(s, '$') { - switch quote { - case '"': - return s, nil - case '\'': - r, size := utf8.DecodeRuneInString(s) - if size == len(s) && (r != utf8.RuneError || size != 1) { - return s, nil - } - } - } - - var runeTmp [utf8.UTFMax]byte - buf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations. - for len(s) > 0 { - // If we're starting a '${}' then let it through un-unquoted. - // Specifically: we don't unquote any characters within the `${}` - // section. - if s[0] == '$' && len(s) > 1 && s[1] == '{' { - buf = append(buf, '$', '{') - s = s[2:] - - // Continue reading until we find the closing brace, copying as-is - braces := 1 - for len(s) > 0 && braces > 0 { - r, size := utf8.DecodeRuneInString(s) - if r == utf8.RuneError { - return "", ErrSyntax - } - - s = s[size:] - - n := utf8.EncodeRune(runeTmp[:], r) - buf = append(buf, runeTmp[:n]...) - - switch r { - case '{': - braces++ - case '}': - braces-- - } - } - if braces != 0 { - return "", ErrSyntax - } - if len(s) == 0 { - // If there's no string left, we're done! - break - } else { - // If there's more left, we need to pop back up to the top of the loop - // in case there's another interpolation in this string. - continue - } - } - - if s[0] == '\n' { - return "", ErrSyntax - } - - c, multibyte, ss, err := unquoteChar(s, quote) - if err != nil { - return "", err - } - s = ss - if c < utf8.RuneSelf || !multibyte { - buf = append(buf, byte(c)) - } else { - n := utf8.EncodeRune(runeTmp[:], c) - buf = append(buf, runeTmp[:n]...) - } - if quote == '\'' && len(s) != 0 { - // single-quoted must be single character - return "", ErrSyntax - } - } - return string(buf), nil -} - -// contains reports whether the string contains the byte c. -func contains(s string, c byte) bool { - for i := 0; i < len(s); i++ { - if s[i] == c { - return true - } - } - return false -} - -func unhex(b byte) (v rune, ok bool) { - c := rune(b) - switch { - case '0' <= c && c <= '9': - return c - '0', true - case 'a' <= c && c <= 'f': - return c - 'a' + 10, true - case 'A' <= c && c <= 'F': - return c - 'A' + 10, true - } - return -} - -func unquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) { - // easy cases - switch c := s[0]; { - case c == quote && (quote == '\'' || quote == '"'): - err = ErrSyntax - return - case c >= utf8.RuneSelf: - r, size := utf8.DecodeRuneInString(s) - return r, true, s[size:], nil - case c != '\\': - return rune(s[0]), false, s[1:], nil - } - - // hard case: c is backslash - if len(s) <= 1 { - err = ErrSyntax - return - } - c := s[1] - s = s[2:] - - switch c { - case 'a': - value = '\a' - case 'b': - value = '\b' - case 'f': - value = '\f' - case 'n': - value = '\n' - case 'r': - value = '\r' - case 't': - value = '\t' - case 'v': - value = '\v' - case 'x', 'u', 'U': - n := 0 - switch c { - case 'x': - n = 2 - case 'u': - n = 4 - case 'U': - n = 8 - } - var v rune - if len(s) < n { - err = ErrSyntax - return - } - for j := 0; j < n; j++ { - x, ok := unhex(s[j]) - if !ok { - err = ErrSyntax - return - } - v = v<<4 | x - } - s = s[n:] - if c == 'x' { - // single-byte string, possibly not UTF-8 - value = v - break - } - if v > utf8.MaxRune { - err = ErrSyntax - return - } - value = v - multibyte = true - case '0', '1', '2', '3', '4', '5', '6', '7': - v := rune(c) - '0' - if len(s) < 2 { - err = ErrSyntax - return - } - for j := 0; j < 2; j++ { // one digit already; two more - x := rune(s[j]) - '0' - if x < 0 || x > 7 { - err = ErrSyntax - return - } - v = (v << 3) | x - } - s = s[2:] - if v > 255 { - err = ErrSyntax - return - } - value = v - case '\\': - value = '\\' - case '\'', '"': - if c != quote { - err = ErrSyntax - return - } - value = rune(c) - default: - err = ErrSyntax - return - } - tail = s - return -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go deleted file mode 100644 index 65be375d93..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/strconv/quote_test.go +++ /dev/null @@ -1,96 +0,0 @@ -package strconv - -import "testing" - -type quoteTest struct { - in string - out string - ascii string -} - -var quotetests = []quoteTest{ - {"\a\b\f\r\n\t\v", `"\a\b\f\r\n\t\v"`, `"\a\b\f\r\n\t\v"`}, - {"\\", `"\\"`, `"\\"`}, - {"abc\xffdef", `"abc\xffdef"`, `"abc\xffdef"`}, - {"\u263a", `"☺"`, `"\u263a"`}, - {"\U0010ffff", `"\U0010ffff"`, `"\U0010ffff"`}, - {"\x04", `"\x04"`, `"\x04"`}, -} - -type unQuoteTest struct { - in string - out string -} - -var unquotetests = []unQuoteTest{ - {`""`, ""}, - {`"a"`, "a"}, - {`"abc"`, "abc"}, - {`"☺"`, "☺"}, - {`"hello world"`, "hello world"}, - {`"\xFF"`, "\xFF"}, - {`"\377"`, "\377"}, - {`"\u1234"`, "\u1234"}, - {`"\U00010111"`, "\U00010111"}, - {`"\U0001011111"`, "\U0001011111"}, - {`"\a\b\f\n\r\t\v\\\""`, "\a\b\f\n\r\t\v\\\""}, - {`"'"`, "'"}, - {`"${file("foo")}"`, `${file("foo")}`}, - {`"${file("\"foo\"")}"`, `${file("\"foo\"")}`}, - {`"echo ${var.region}${element(split(",",var.zones),0)}"`, - `echo ${var.region}${element(split(",",var.zones),0)}`}, - {`"${HH\\:mm\\:ss}"`, `${HH\\:mm\\:ss}`}, - {`"${\n}"`, `${\n}`}, -} - -var misquoted = []string{ - ``, - `"`, - `"a`, - `"'`, - `b"`, - `"\"`, - `"\9"`, - `"\19"`, - `"\129"`, - `'\'`, - `'\9'`, - `'\19'`, - `'\129'`, - `'ab'`, - `"\x1!"`, - `"\U12345678"`, - `"\z"`, - "`", - "`xxx", - "`\"", - `"\'"`, - `'\"'`, - "\"\n\"", - "\"\\n\n\"", - "'\n'", - `"${"`, - `"${foo{}"`, - "\"${foo}\n\"", -} - -func TestUnquote(t *testing.T) { - for _, tt := range unquotetests { - if out, err := Unquote(tt.in); err != nil || out != tt.out { - t.Errorf("Unquote(%#q) = %q, %v want %q, nil", tt.in, out, err, tt.out) - } - } - - // run the quote tests too, backward - for _, tt := range quotetests { - if in, err := Unquote(tt.out); in != tt.in { - t.Errorf("Unquote(%#q) = %q, %v, want %q, nil", tt.out, in, err, tt.in) - } - } - - for _, s := range misquoted { - if out, err := Unquote(s); out != "" || err != ErrSyntax { - t.Errorf("Unquote(%#q) = %q, %v want %q, %v", s, out, err, "", ErrSyntax) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl deleted file mode 100644 index 78c2675823..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/array_comment.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = [ - "1", - "2", # comment -] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl deleted file mode 100644 index eb5a99a694..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/assign_colon.hcl +++ /dev/null @@ -1,6 +0,0 @@ -resource = [{ - "foo": { - "bar": {}, - "baz": [1, 2, "foo"], - } -}] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl deleted file mode 100644 index 1ff7f29fd2..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment.hcl +++ /dev/null @@ -1,15 +0,0 @@ -// Foo - -/* Bar */ - -/* -/* -Baz -*/ - -# Another - -# Multiple -# Lines - -foo = "bar" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl deleted file mode 100644 index fec56017dc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/comment_single.hcl +++ /dev/null @@ -1 +0,0 @@ -# Hello diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl deleted file mode 100644 index cccb5b06fc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex.hcl +++ /dev/null @@ -1,42 +0,0 @@ -// This comes from Terraform, as a test -variable "foo" { - default = "bar" - description = "bar" -} - -provider "aws" { - access_key = "foo" - secret_key = "bar" -} - -provider "do" { - api_key = "${var.foo}" -} - -resource "aws_security_group" "firewall" { - count = 5 -} - -resource aws_instance "web" { - ami = "${var.foo}" - security_groups = [ - "foo", - "${aws_security_group.firewall.foo}" - ] - - network_interface { - device_index = 0 - description = "Main network interface" - } -} - -resource "aws_instance" "db" { - security_groups = "${aws_security_group.firewall.*.id}" - VPC = "foo" - - depends_on = ["aws_instance.web"] -} - -output "web_ip" { - value = "${aws_instance.web.private_ip}" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl deleted file mode 100644 index 0007aaf5f7..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/complex_key.hcl +++ /dev/null @@ -1 +0,0 @@ -foo.bar = "baz" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/empty.hcl deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl deleted file mode 100644 index 059d4ce65b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo"] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl deleted file mode 100644 index 50f4218ac8..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/list_comma.hcl +++ /dev/null @@ -1 +0,0 @@ -foo = [1, 2, "foo",] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl deleted file mode 100644 index 029c54b0ce..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/multiple.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -key = 7 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl deleted file mode 100644 index e9f77cae90..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/old.hcl +++ /dev/null @@ -1,3 +0,0 @@ -default = { - "eu-west-1": "ami-b1cf19c6", -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl deleted file mode 100644 index 92592fbb3c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure.hcl +++ /dev/null @@ -1,5 +0,0 @@ -// This is a test structure for the lexer -foo bar "baz" { - key = 7 - foo = "bar" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl deleted file mode 100644 index 7229a1f012..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_basic.hcl +++ /dev/null @@ -1,5 +0,0 @@ -foo { - value = 7 - "value" = 8 - "complex::value" = 9 -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl deleted file mode 100644 index 4d156ddea9..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/structure_empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" "bar" {} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl b/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl deleted file mode 100644 index cf2747ea1a..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/test-fixtures/types.hcl +++ /dev/null @@ -1,7 +0,0 @@ -foo = "bar" -bar = 7 -baz = [1,2,3] -foo = -12 -bar = 3.14159 -foo = true -bar = false diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go deleted file mode 100644 index 59c1bb72d4..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/position.go +++ /dev/null @@ -1,46 +0,0 @@ -package token - -import "fmt" - -// Pos describes an arbitrary source position -// including the file, line, and column location. -// A Position is valid if the line number is > 0. -type Pos struct { - Filename string // filename, if any - Offset int // offset, starting at 0 - Line int // line number, starting at 1 - Column int // column number, starting at 1 (character count) -} - -// IsValid returns true if the position is valid. -func (p *Pos) IsValid() bool { return p.Line > 0 } - -// String returns a string in one of several forms: -// -// file:line:column valid position with file name -// line:column valid position without file name -// file invalid position with file name -// - invalid position without file name -func (p Pos) String() string { - s := p.Filename - if p.IsValid() { - if s != "" { - s += ":" - } - s += fmt.Sprintf("%d:%d", p.Line, p.Column) - } - if s == "" { - s = "-" - } - return s -} - -// Before reports whether the position p is before u. -func (p Pos) Before(u Pos) bool { - return u.Offset > p.Offset || u.Line > p.Line -} - -// After reports whether the position p is after u. -func (p Pos) After(u Pos) bool { - return u.Offset < p.Offset || u.Line < p.Line -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go b/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go deleted file mode 100644 index e37c0664ec..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/hcl/token/token.go +++ /dev/null @@ -1,219 +0,0 @@ -// Package token defines constants representing the lexical tokens for HCL -// (HashiCorp Configuration Language) -package token - -import ( - "fmt" - "strconv" - "strings" - - hclstrconv "github.com/hashicorp/hcl/hcl/strconv" -) - -// Token defines a single HCL token which can be obtained via the Scanner -type Token struct { - Type Type - Pos Pos - Text string - JSON bool -} - -// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) -type Type int - -const ( - // Special tokens - ILLEGAL Type = iota - EOF - COMMENT - - identifier_beg - IDENT // literals - literal_beg - NUMBER // 12345 - FLOAT // 123.45 - BOOL // true,false - STRING // "abc" - HEREDOC // < 0 { - // Pop the current item - n := len(frontier) - item := frontier[n-1] - frontier = frontier[:n-1] - - switch v := item.Val.(type) { - case *ast.ObjectType: - items, frontier = flattenObjectType(v, item, items, frontier) - case *ast.ListType: - items, frontier = flattenListType(v, item, items, frontier) - default: - items = append(items, item) - } - } - - // Reverse the list since the frontier model runs things backwards - for i := len(items)/2 - 1; i >= 0; i-- { - opp := len(items) - 1 - i - items[i], items[opp] = items[opp], items[i] - } - - // Done! Set the original items - list.Items = items - return n, true - }) -} - -func flattenListType( - ot *ast.ListType, - item *ast.ObjectItem, - items []*ast.ObjectItem, - frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { - // If the list is empty, keep the original list - if len(ot.List) == 0 { - items = append(items, item) - return items, frontier - } - - // All the elements of this object must also be objects! - for _, subitem := range ot.List { - if _, ok := subitem.(*ast.ObjectType); !ok { - items = append(items, item) - return items, frontier - } - } - - // Great! We have a match go through all the items and flatten - for _, elem := range ot.List { - // Add it to the frontier so that we can recurse - frontier = append(frontier, &ast.ObjectItem{ - Keys: item.Keys, - Assign: item.Assign, - Val: elem, - LeadComment: item.LeadComment, - LineComment: item.LineComment, - }) - } - - return items, frontier -} - -func flattenObjectType( - ot *ast.ObjectType, - item *ast.ObjectItem, - items []*ast.ObjectItem, - frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { - // If the list has no items we do not have to flatten anything - if ot.List.Items == nil { - items = append(items, item) - return items, frontier - } - - // All the elements of this object must also be objects! - for _, subitem := range ot.List.Items { - if _, ok := subitem.Val.(*ast.ObjectType); !ok { - items = append(items, item) - return items, frontier - } - } - - // Great! We have a match go through all the items and flatten - for _, subitem := range ot.List.Items { - // Copy the new key - keys := make([]*ast.ObjectKey, len(item.Keys)+len(subitem.Keys)) - copy(keys, item.Keys) - copy(keys[len(item.Keys):], subitem.Keys) - - // Add it to the frontier so that we can recurse - frontier = append(frontier, &ast.ObjectItem{ - Keys: keys, - Assign: item.Assign, - Val: subitem.Val, - LeadComment: item.LeadComment, - LineComment: item.LineComment, - }) - } - - return items, frontier -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go deleted file mode 100644 index 125a5f0729..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser.go +++ /dev/null @@ -1,313 +0,0 @@ -package parser - -import ( - "errors" - "fmt" - - "github.com/hashicorp/hcl/hcl/ast" - hcltoken "github.com/hashicorp/hcl/hcl/token" - "github.com/hashicorp/hcl/json/scanner" - "github.com/hashicorp/hcl/json/token" -) - -type Parser struct { - sc *scanner.Scanner - - // Last read token - tok token.Token - commaPrev token.Token - - enableTrace bool - indent int - n int // buffer size (max = 1) -} - -func newParser(src []byte) *Parser { - return &Parser{ - sc: scanner.New(src), - } -} - -// Parse returns the fully parsed source and returns the abstract syntax tree. -func Parse(src []byte) (*ast.File, error) { - p := newParser(src) - return p.Parse() -} - -var errEofToken = errors.New("EOF token found") - -// Parse returns the fully parsed source and returns the abstract syntax tree. -func (p *Parser) Parse() (*ast.File, error) { - f := &ast.File{} - var err, scerr error - p.sc.Error = func(pos token.Pos, msg string) { - scerr = fmt.Errorf("%s: %s", pos, msg) - } - - // The root must be an object in JSON - object, err := p.object() - if scerr != nil { - return nil, scerr - } - if err != nil { - return nil, err - } - - // We make our final node an object list so it is more HCL compatible - f.Node = object.List - - // Flatten it, which finds patterns and turns them into more HCL-like - // AST trees. - flattenObjects(f.Node) - - return f, nil -} - -func (p *Parser) objectList() (*ast.ObjectList, error) { - defer un(trace(p, "ParseObjectList")) - node := &ast.ObjectList{} - - for { - n, err := p.objectItem() - if err == errEofToken { - break // we are finished - } - - // we don't return a nil node, because might want to use already - // collected items. - if err != nil { - return node, err - } - - node.Add(n) - - // Check for a followup comma. If it isn't a comma, then we're done - if tok := p.scan(); tok.Type != token.COMMA { - break - } - } - - return node, nil -} - -// objectItem parses a single object item -func (p *Parser) objectItem() (*ast.ObjectItem, error) { - defer un(trace(p, "ParseObjectItem")) - - keys, err := p.objectKey() - if err != nil { - return nil, err - } - - o := &ast.ObjectItem{ - Keys: keys, - } - - switch p.tok.Type { - case token.COLON: - pos := p.tok.Pos - o.Assign = hcltoken.Pos{ - Filename: pos.Filename, - Offset: pos.Offset, - Line: pos.Line, - Column: pos.Column, - } - - o.Val, err = p.objectValue() - if err != nil { - return nil, err - } - } - - return o, nil -} - -// objectKey parses an object key and returns a ObjectKey AST -func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { - keyCount := 0 - keys := make([]*ast.ObjectKey, 0) - - for { - tok := p.scan() - switch tok.Type { - case token.EOF: - return nil, errEofToken - case token.STRING: - keyCount++ - keys = append(keys, &ast.ObjectKey{ - Token: p.tok.HCLToken(), - }) - case token.COLON: - // If we have a zero keycount it means that we never got - // an object key, i.e. `{ :`. This is a syntax error. - if keyCount == 0 { - return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) - } - - // Done - return keys, nil - case token.ILLEGAL: - return nil, errors.New("illegal") - default: - return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) - } - } -} - -// object parses any type of object, such as number, bool, string, object or -// list. -func (p *Parser) objectValue() (ast.Node, error) { - defer un(trace(p, "ParseObjectValue")) - tok := p.scan() - - switch tok.Type { - case token.NUMBER, token.FLOAT, token.BOOL, token.NULL, token.STRING: - return p.literalType() - case token.LBRACE: - return p.objectType() - case token.LBRACK: - return p.listType() - case token.EOF: - return nil, errEofToken - } - - return nil, fmt.Errorf("Expected object value, got unknown token: %+v", tok) -} - -// object parses any type of object, such as number, bool, string, object or -// list. -func (p *Parser) object() (*ast.ObjectType, error) { - defer un(trace(p, "ParseType")) - tok := p.scan() - - switch tok.Type { - case token.LBRACE: - return p.objectType() - case token.EOF: - return nil, errEofToken - } - - return nil, fmt.Errorf("Expected object, got unknown token: %+v", tok) -} - -// objectType parses an object type and returns a ObjectType AST -func (p *Parser) objectType() (*ast.ObjectType, error) { - defer un(trace(p, "ParseObjectType")) - - // we assume that the currently scanned token is a LBRACE - o := &ast.ObjectType{} - - l, err := p.objectList() - - // if we hit RBRACE, we are good to go (means we parsed all Items), if it's - // not a RBRACE, it's an syntax error and we just return it. - if err != nil && p.tok.Type != token.RBRACE { - return nil, err - } - - o.List = l - return o, nil -} - -// listType parses a list type and returns a ListType AST -func (p *Parser) listType() (*ast.ListType, error) { - defer un(trace(p, "ParseListType")) - - // we assume that the currently scanned token is a LBRACK - l := &ast.ListType{} - - for { - tok := p.scan() - switch tok.Type { - case token.NUMBER, token.FLOAT, token.STRING: - node, err := p.literalType() - if err != nil { - return nil, err - } - - l.Add(node) - case token.COMMA: - continue - case token.LBRACE: - node, err := p.objectType() - if err != nil { - return nil, err - } - - l.Add(node) - case token.BOOL: - // TODO(arslan) should we support? not supported by HCL yet - case token.LBRACK: - // TODO(arslan) should we support nested lists? Even though it's - // written in README of HCL, it's not a part of the grammar - // (not defined in parse.y) - case token.RBRACK: - // finished - return l, nil - default: - return nil, fmt.Errorf("unexpected token while parsing list: %s", tok.Type) - } - - } -} - -// literalType parses a literal type and returns a LiteralType AST -func (p *Parser) literalType() (*ast.LiteralType, error) { - defer un(trace(p, "ParseLiteral")) - - return &ast.LiteralType{ - Token: p.tok.HCLToken(), - }, nil -} - -// scan returns the next token from the underlying scanner. If a token has -// been unscanned then read that instead. -func (p *Parser) scan() token.Token { - // If we have a token on the buffer, then return it. - if p.n != 0 { - p.n = 0 - return p.tok - } - - p.tok = p.sc.Scan() - return p.tok -} - -// unscan pushes the previously read token back onto the buffer. -func (p *Parser) unscan() { - p.n = 1 -} - -// ---------------------------------------------------------------------------- -// Parsing support - -func (p *Parser) printTrace(a ...interface{}) { - if !p.enableTrace { - return - } - - const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " - const n = len(dots) - fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) - - i := 2 * p.indent - for i > n { - fmt.Print(dots) - i -= n - } - // i <= n - fmt.Print(dots[0:i]) - fmt.Println(a...) -} - -func trace(p *Parser, msg string) *Parser { - p.printTrace(msg, "(") - p.indent++ - return p -} - -// Usage pattern: defer un(trace(p, "...")) -func un(p *Parser) { - p.indent-- - p.printTrace(")") -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go deleted file mode 100644 index e0cebf50a8..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/parser_test.go +++ /dev/null @@ -1,384 +0,0 @@ -package parser - -import ( - "fmt" - "io/ioutil" - "path/filepath" - "reflect" - "runtime" - "testing" - - "github.com/hashicorp/hcl/hcl/ast" - "github.com/hashicorp/hcl/hcl/token" -) - -func TestType(t *testing.T) { - var literals = []struct { - typ token.Type - src string - }{ - {token.STRING, `"foo": "bar"`}, - {token.NUMBER, `"foo": 123`}, - {token.FLOAT, `"foo": 123.12`}, - {token.FLOAT, `"foo": -123.12`}, - {token.BOOL, `"foo": true`}, - {token.STRING, `"foo": null`}, - } - - for _, l := range literals { - t.Logf("Testing: %s", l.src) - - p := newParser([]byte(l.src)) - item, err := p.objectItem() - if err != nil { - t.Error(err) - } - - lit, ok := item.Val.(*ast.LiteralType) - if !ok { - t.Errorf("node should be of type LiteralType, got: %T", item.Val) - } - - if lit.Token.Type != l.typ { - t.Errorf("want: %s, got: %s", l.typ, lit.Token.Type) - } - } -} - -func TestListType(t *testing.T) { - var literals = []struct { - src string - tokens []token.Type - }{ - { - `"foo": ["123", 123]`, - []token.Type{token.STRING, token.NUMBER}, - }, - { - `"foo": [123, "123",]`, - []token.Type{token.NUMBER, token.STRING}, - }, - { - `"foo": []`, - []token.Type{}, - }, - { - `"foo": ["123", 123]`, - []token.Type{token.STRING, token.NUMBER}, - }, - { - `"foo": ["123", {}]`, - []token.Type{token.STRING, token.LBRACE}, - }, - } - - for _, l := range literals { - t.Logf("Testing: %s", l.src) - - p := newParser([]byte(l.src)) - item, err := p.objectItem() - if err != nil { - t.Error(err) - } - - list, ok := item.Val.(*ast.ListType) - if !ok { - t.Errorf("node should be of type LiteralType, got: %T", item.Val) - } - - tokens := []token.Type{} - for _, li := range list.List { - switch v := li.(type) { - case *ast.LiteralType: - tokens = append(tokens, v.Token.Type) - case *ast.ObjectType: - tokens = append(tokens, token.LBRACE) - } - } - - equals(t, l.tokens, tokens) - } -} - -func TestObjectType(t *testing.T) { - var literals = []struct { - src string - nodeType []ast.Node - itemLen int - }{ - { - `"foo": {}`, - nil, - 0, - }, - { - `"foo": { - "bar": "fatih" - }`, - []ast.Node{&ast.LiteralType{}}, - 1, - }, - { - `"foo": { - "bar": "fatih", - "baz": ["arslan"] - }`, - []ast.Node{ - &ast.LiteralType{}, - &ast.ListType{}, - }, - 2, - }, - { - `"foo": { - "bar": {} - }`, - []ast.Node{ - &ast.ObjectType{}, - }, - 1, - }, - { - `"foo": { - "bar": {}, - "foo": true - }`, - []ast.Node{ - &ast.ObjectType{}, - &ast.LiteralType{}, - }, - 2, - }, - } - - for _, l := range literals { - t.Logf("Testing:\n%s\n", l.src) - - p := newParser([]byte(l.src)) - // p.enableTrace = true - item, err := p.objectItem() - if err != nil { - t.Error(err) - } - - // we know that the ObjectKey name is foo for all cases, what matters - // is the object - obj, ok := item.Val.(*ast.ObjectType) - if !ok { - t.Errorf("node should be of type LiteralType, got: %T", item.Val) - } - - // check if the total length of items are correct - equals(t, l.itemLen, len(obj.List.Items)) - - // check if the types are correct - for i, item := range obj.List.Items { - equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) - } - } -} - -func TestFlattenObjects(t *testing.T) { - var literals = []struct { - src string - nodeType []ast.Node - itemLen int - }{ - { - `{ - "foo": [ - { - "foo": "svh", - "bar": "fatih" - } - ] - }`, - []ast.Node{ - &ast.ObjectType{}, - &ast.LiteralType{}, - &ast.LiteralType{}, - }, - 3, - }, - { - `{ - "variable": { - "foo": {} - } - }`, - []ast.Node{ - &ast.ObjectType{}, - }, - 1, - }, - { - `{ - "empty": [] - }`, - []ast.Node{ - &ast.ListType{}, - }, - 1, - }, - { - `{ - "basic": [1, 2, 3] - }`, - []ast.Node{ - &ast.ListType{}, - }, - 1, - }, - } - - for _, l := range literals { - t.Logf("Testing:\n%s\n", l.src) - - f, err := Parse([]byte(l.src)) - if err != nil { - t.Error(err) - } - - // the first object is always an ObjectList so just assert that one - // so we can use it as such - obj, ok := f.Node.(*ast.ObjectList) - if !ok { - t.Errorf("node should be *ast.ObjectList, got: %T", f.Node) - } - - // check if the types are correct - var i int - for _, item := range obj.Items { - equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) - i++ - - if obj, ok := item.Val.(*ast.ObjectType); ok { - for _, item := range obj.List.Items { - equals(t, reflect.TypeOf(l.nodeType[i]), reflect.TypeOf(item.Val)) - i++ - } - } - } - - // check if the number of items is correct - equals(t, l.itemLen, i) - - } -} - -func TestObjectKey(t *testing.T) { - keys := []struct { - exp []token.Type - src string - }{ - {[]token.Type{token.STRING}, `"foo": {}`}, - } - - for _, k := range keys { - p := newParser([]byte(k.src)) - keys, err := p.objectKey() - if err != nil { - t.Fatal(err) - } - - tokens := []token.Type{} - for _, o := range keys { - tokens = append(tokens, o.Token.Type) - } - - equals(t, k.exp, tokens) - } - - errKeys := []struct { - src string - }{ - {`foo 12 {}`}, - {`foo bar = {}`}, - {`foo []`}, - {`12 {}`}, - } - - for _, k := range errKeys { - p := newParser([]byte(k.src)) - _, err := p.objectKey() - if err == nil { - t.Errorf("case '%s' should give an error", k.src) - } - } -} - -// Official HCL tests -func TestParse(t *testing.T) { - cases := []struct { - Name string - Err bool - }{ - { - "array.json", - false, - }, - { - "basic.json", - false, - }, - { - "object.json", - false, - }, - { - "types.json", - false, - }, - { - "bad_input_128.json", - true, - }, - { - "bad_input_tf_8110.json", - true, - }, - { - "good_input_tf_8110.json", - false, - }, - } - - const fixtureDir = "./test-fixtures" - - for _, tc := range cases { - d, err := ioutil.ReadFile(filepath.Join(fixtureDir, tc.Name)) - if err != nil { - t.Fatalf("err: %s", err) - } - - _, err = Parse(d) - if (err != nil) != tc.Err { - t.Fatalf("Input: %s\n\nError: %s", tc.Name, err) - } - } -} - -func TestParse_inline(t *testing.T) { - cases := []struct { - Value string - Err bool - }{ - {"{:{", true}, - } - - for _, tc := range cases { - _, err := Parse([]byte(tc.Value)) - if (err != nil) != tc.Err { - t.Fatalf("Input: %q\n\nError: %s", tc.Value, err) - } - } -} - -// equals fails the test if exp is not equal to act. -func equals(tb testing.TB, exp, act interface{}) { - if !reflect.DeepEqual(exp, act) { - _, file, line, _ := runtime.Caller(1) - fmt.Printf("\033[31m%s:%d:\n\n\texp: %s\n\n\tgot: %s\033[39m\n\n", filepath.Base(file), line, exp, act) - tb.FailNow() - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json deleted file mode 100644 index e320f17ab2..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/array.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": [1, 2, "bar"], - "bar": "baz" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json deleted file mode 100644 index b5f850c963..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_128.json +++ /dev/null @@ -1 +0,0 @@ -{:{ diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json deleted file mode 100644 index a04385833d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/bad_input_tf_8110.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variable": { - "poc": { - "default": "${replace("europe-west", "-", " ")}" - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json deleted file mode 100644 index b54bde96c1..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/basic.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "bar" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json deleted file mode 100644 index f21aa090d5..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/good_input_tf_8110.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variable": { - "poc": { - "default": "${replace(\"europe-west\", \"-\", \" \")}" - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json deleted file mode 100644 index 72168a3ccb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": { - "bar": [1,2] - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json b/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json deleted file mode 100644 index 9a142a6ca6..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/parser/test-fixtures/types.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "foo": "bar", - "bar": 7, - "baz": [1,2,3], - "foo": -12, - "bar": 3.14159, - "foo": true, - "bar": false, - "foo": null -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go b/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go deleted file mode 100644 index fe3f0f0950..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner.go +++ /dev/null @@ -1,451 +0,0 @@ -package scanner - -import ( - "bytes" - "fmt" - "os" - "unicode" - "unicode/utf8" - - "github.com/hashicorp/hcl/json/token" -) - -// eof represents a marker rune for the end of the reader. -const eof = rune(0) - -// Scanner defines a lexical scanner -type Scanner struct { - buf *bytes.Buffer // Source buffer for advancing and scanning - src []byte // Source buffer for immutable access - - // Source Position - srcPos token.Pos // current position - prevPos token.Pos // previous position, used for peek() method - - lastCharLen int // length of last character in bytes - lastLineLen int // length of last line in characters (for correct column reporting) - - tokStart int // token text start position - tokEnd int // token text end position - - // Error is called for each error encountered. If no Error - // function is set, the error is reported to os.Stderr. - Error func(pos token.Pos, msg string) - - // ErrorCount is incremented by one for each error encountered. - ErrorCount int - - // tokPos is the start position of most recently scanned token; set by - // Scan. The Filename field is always left untouched by the Scanner. If - // an error is reported (via Error) and Position is invalid, the scanner is - // not inside a token. - tokPos token.Pos -} - -// New creates and initializes a new instance of Scanner using src as -// its source content. -func New(src []byte) *Scanner { - // even though we accept a src, we read from a io.Reader compatible type - // (*bytes.Buffer). So in the future we might easily change it to streaming - // read. - b := bytes.NewBuffer(src) - s := &Scanner{ - buf: b, - src: src, - } - - // srcPosition always starts with 1 - s.srcPos.Line = 1 - return s -} - -// next reads the next rune from the bufferred reader. Returns the rune(0) if -// an error occurs (or io.EOF is returned). -func (s *Scanner) next() rune { - ch, size, err := s.buf.ReadRune() - if err != nil { - // advance for error reporting - s.srcPos.Column++ - s.srcPos.Offset += size - s.lastCharLen = size - return eof - } - - if ch == utf8.RuneError && size == 1 { - s.srcPos.Column++ - s.srcPos.Offset += size - s.lastCharLen = size - s.err("illegal UTF-8 encoding") - return ch - } - - // remember last position - s.prevPos = s.srcPos - - s.srcPos.Column++ - s.lastCharLen = size - s.srcPos.Offset += size - - if ch == '\n' { - s.srcPos.Line++ - s.lastLineLen = s.srcPos.Column - s.srcPos.Column = 0 - } - - // debug - // fmt.Printf("ch: %q, offset:column: %d:%d\n", ch, s.srcPos.Offset, s.srcPos.Column) - return ch -} - -// unread unreads the previous read Rune and updates the source position -func (s *Scanner) unread() { - if err := s.buf.UnreadRune(); err != nil { - panic(err) // this is user fault, we should catch it - } - s.srcPos = s.prevPos // put back last position -} - -// peek returns the next rune without advancing the reader. -func (s *Scanner) peek() rune { - peek, _, err := s.buf.ReadRune() - if err != nil { - return eof - } - - s.buf.UnreadRune() - return peek -} - -// Scan scans the next token and returns the token. -func (s *Scanner) Scan() token.Token { - ch := s.next() - - // skip white space - for isWhitespace(ch) { - ch = s.next() - } - - var tok token.Type - - // token text markings - s.tokStart = s.srcPos.Offset - s.lastCharLen - - // token position, initial next() is moving the offset by one(size of rune - // actually), though we are interested with the starting point - s.tokPos.Offset = s.srcPos.Offset - s.lastCharLen - if s.srcPos.Column > 0 { - // common case: last character was not a '\n' - s.tokPos.Line = s.srcPos.Line - s.tokPos.Column = s.srcPos.Column - } else { - // last character was a '\n' - // (we cannot be at the beginning of the source - // since we have called next() at least once) - s.tokPos.Line = s.srcPos.Line - 1 - s.tokPos.Column = s.lastLineLen - } - - switch { - case isLetter(ch): - lit := s.scanIdentifier() - if lit == "true" || lit == "false" { - tok = token.BOOL - } else if lit == "null" { - tok = token.NULL - } else { - s.err("illegal char") - } - case isDecimal(ch): - tok = s.scanNumber(ch) - default: - switch ch { - case eof: - tok = token.EOF - case '"': - tok = token.STRING - s.scanString() - case '.': - tok = token.PERIOD - ch = s.peek() - if isDecimal(ch) { - tok = token.FLOAT - ch = s.scanMantissa(ch) - ch = s.scanExponent(ch) - } - case '[': - tok = token.LBRACK - case ']': - tok = token.RBRACK - case '{': - tok = token.LBRACE - case '}': - tok = token.RBRACE - case ',': - tok = token.COMMA - case ':': - tok = token.COLON - case '-': - if isDecimal(s.peek()) { - ch := s.next() - tok = s.scanNumber(ch) - } else { - s.err("illegal char") - } - default: - s.err("illegal char: " + string(ch)) - } - } - - // finish token ending - s.tokEnd = s.srcPos.Offset - - // create token literal - var tokenText string - if s.tokStart >= 0 { - tokenText = string(s.src[s.tokStart:s.tokEnd]) - } - s.tokStart = s.tokEnd // ensure idempotency of tokenText() call - - return token.Token{ - Type: tok, - Pos: s.tokPos, - Text: tokenText, - } -} - -// scanNumber scans a HCL number definition starting with the given rune -func (s *Scanner) scanNumber(ch rune) token.Type { - zero := ch == '0' - pos := s.srcPos - - s.scanMantissa(ch) - ch = s.next() // seek forward - if ch == 'e' || ch == 'E' { - ch = s.scanExponent(ch) - return token.FLOAT - } - - if ch == '.' { - ch = s.scanFraction(ch) - if ch == 'e' || ch == 'E' { - ch = s.next() - ch = s.scanExponent(ch) - } - return token.FLOAT - } - - if ch != eof { - s.unread() - } - - // If we have a larger number and this is zero, error - if zero && pos != s.srcPos { - s.err("numbers cannot start with 0") - } - - return token.NUMBER -} - -// scanMantissa scans the mantissa beginning from the rune. It returns the next -// non decimal rune. It's used to determine wheter it's a fraction or exponent. -func (s *Scanner) scanMantissa(ch rune) rune { - scanned := false - for isDecimal(ch) { - ch = s.next() - scanned = true - } - - if scanned && ch != eof { - s.unread() - } - return ch -} - -// scanFraction scans the fraction after the '.' rune -func (s *Scanner) scanFraction(ch rune) rune { - if ch == '.' { - ch = s.peek() // we peek just to see if we can move forward - ch = s.scanMantissa(ch) - } - return ch -} - -// scanExponent scans the remaining parts of an exponent after the 'e' or 'E' -// rune. -func (s *Scanner) scanExponent(ch rune) rune { - if ch == 'e' || ch == 'E' { - ch = s.next() - if ch == '-' || ch == '+' { - ch = s.next() - } - ch = s.scanMantissa(ch) - } - return ch -} - -// scanString scans a quoted string -func (s *Scanner) scanString() { - braces := 0 - for { - // '"' opening already consumed - // read character after quote - ch := s.next() - - if ch == '\n' || ch < 0 || ch == eof { - s.err("literal not terminated") - return - } - - if ch == '"' { - break - } - - // If we're going into a ${} then we can ignore quotes for awhile - if braces == 0 && ch == '$' && s.peek() == '{' { - braces++ - s.next() - } else if braces > 0 && ch == '{' { - braces++ - } - if braces > 0 && ch == '}' { - braces-- - } - - if ch == '\\' { - s.scanEscape() - } - } - - return -} - -// scanEscape scans an escape sequence -func (s *Scanner) scanEscape() rune { - // http://en.cppreference.com/w/cpp/language/escape - ch := s.next() // read character after '/' - switch ch { - case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': - // nothing to do - case '0', '1', '2', '3', '4', '5', '6', '7': - // octal notation - ch = s.scanDigits(ch, 8, 3) - case 'x': - // hexademical notation - ch = s.scanDigits(s.next(), 16, 2) - case 'u': - // universal character name - ch = s.scanDigits(s.next(), 16, 4) - case 'U': - // universal character name - ch = s.scanDigits(s.next(), 16, 8) - default: - s.err("illegal char escape") - } - return ch -} - -// scanDigits scans a rune with the given base for n times. For example an -// octal notation \184 would yield in scanDigits(ch, 8, 3) -func (s *Scanner) scanDigits(ch rune, base, n int) rune { - for n > 0 && digitVal(ch) < base { - ch = s.next() - n-- - } - if n > 0 { - s.err("illegal char escape") - } - - // we scanned all digits, put the last non digit char back - s.unread() - return ch -} - -// scanIdentifier scans an identifier and returns the literal string -func (s *Scanner) scanIdentifier() string { - offs := s.srcPos.Offset - s.lastCharLen - ch := s.next() - for isLetter(ch) || isDigit(ch) || ch == '-' { - ch = s.next() - } - - if ch != eof { - s.unread() // we got identifier, put back latest char - } - - return string(s.src[offs:s.srcPos.Offset]) -} - -// recentPosition returns the position of the character immediately after the -// character or token returned by the last call to Scan. -func (s *Scanner) recentPosition() (pos token.Pos) { - pos.Offset = s.srcPos.Offset - s.lastCharLen - switch { - case s.srcPos.Column > 0: - // common case: last character was not a '\n' - pos.Line = s.srcPos.Line - pos.Column = s.srcPos.Column - case s.lastLineLen > 0: - // last character was a '\n' - // (we cannot be at the beginning of the source - // since we have called next() at least once) - pos.Line = s.srcPos.Line - 1 - pos.Column = s.lastLineLen - default: - // at the beginning of the source - pos.Line = 1 - pos.Column = 1 - } - return -} - -// err prints the error of any scanning to s.Error function. If the function is -// not defined, by default it prints them to os.Stderr -func (s *Scanner) err(msg string) { - s.ErrorCount++ - pos := s.recentPosition() - - if s.Error != nil { - s.Error(pos, msg) - return - } - - fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) -} - -// isHexadecimal returns true if the given rune is a letter -func isLetter(ch rune) bool { - return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) -} - -// isHexadecimal returns true if the given rune is a decimal digit -func isDigit(ch rune) bool { - return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) -} - -// isHexadecimal returns true if the given rune is a decimal number -func isDecimal(ch rune) bool { - return '0' <= ch && ch <= '9' -} - -// isHexadecimal returns true if the given rune is an hexadecimal number -func isHexadecimal(ch rune) bool { - return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' -} - -// isWhitespace returns true if the rune is a space, tab, newline or carriage return -func isWhitespace(ch rune) bool { - return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' -} - -// digitVal returns the integer value of a given octal,decimal or hexadecimal rune -func digitVal(ch rune) int { - switch { - case '0' <= ch && ch <= '9': - return int(ch - '0') - case 'a' <= ch && ch <= 'f': - return int(ch - 'a' + 10) - case 'A' <= ch && ch <= 'F': - return int(ch - 'A' + 10) - } - return 16 // larger than any legal digit val -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go b/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go deleted file mode 100644 index 3033a57976..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/scanner/scanner_test.go +++ /dev/null @@ -1,362 +0,0 @@ -package scanner - -import ( - "bytes" - "fmt" - "testing" - - "github.com/hashicorp/hcl/json/token" -) - -var f100 = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - -type tokenPair struct { - tok token.Type - text string -} - -var tokenLists = map[string][]tokenPair{ - "operator": []tokenPair{ - {token.LBRACK, "["}, - {token.LBRACE, "{"}, - {token.COMMA, ","}, - {token.PERIOD, "."}, - {token.RBRACK, "]"}, - {token.RBRACE, "}"}, - }, - "bool": []tokenPair{ - {token.BOOL, "true"}, - {token.BOOL, "false"}, - }, - "string": []tokenPair{ - {token.STRING, `" "`}, - {token.STRING, `"a"`}, - {token.STRING, `"本"`}, - {token.STRING, `"${file(\"foo\")}"`}, - {token.STRING, `"\a"`}, - {token.STRING, `"\b"`}, - {token.STRING, `"\f"`}, - {token.STRING, `"\n"`}, - {token.STRING, `"\r"`}, - {token.STRING, `"\t"`}, - {token.STRING, `"\v"`}, - {token.STRING, `"\""`}, - {token.STRING, `"\000"`}, - {token.STRING, `"\777"`}, - {token.STRING, `"\x00"`}, - {token.STRING, `"\xff"`}, - {token.STRING, `"\u0000"`}, - {token.STRING, `"\ufA16"`}, - {token.STRING, `"\U00000000"`}, - {token.STRING, `"\U0000ffAB"`}, - {token.STRING, `"` + f100 + `"`}, - }, - "number": []tokenPair{ - {token.NUMBER, "0"}, - {token.NUMBER, "1"}, - {token.NUMBER, "9"}, - {token.NUMBER, "42"}, - {token.NUMBER, "1234567890"}, - {token.NUMBER, "-0"}, - {token.NUMBER, "-1"}, - {token.NUMBER, "-9"}, - {token.NUMBER, "-42"}, - {token.NUMBER, "-1234567890"}, - }, - "float": []tokenPair{ - {token.FLOAT, "0."}, - {token.FLOAT, "1."}, - {token.FLOAT, "42."}, - {token.FLOAT, "01234567890."}, - {token.FLOAT, ".0"}, - {token.FLOAT, ".1"}, - {token.FLOAT, ".42"}, - {token.FLOAT, ".0123456789"}, - {token.FLOAT, "0.0"}, - {token.FLOAT, "1.0"}, - {token.FLOAT, "42.0"}, - {token.FLOAT, "01234567890.0"}, - {token.FLOAT, "0e0"}, - {token.FLOAT, "1e0"}, - {token.FLOAT, "42e0"}, - {token.FLOAT, "01234567890e0"}, - {token.FLOAT, "0E0"}, - {token.FLOAT, "1E0"}, - {token.FLOAT, "42E0"}, - {token.FLOAT, "01234567890E0"}, - {token.FLOAT, "0e+10"}, - {token.FLOAT, "1e-10"}, - {token.FLOAT, "42e+10"}, - {token.FLOAT, "01234567890e-10"}, - {token.FLOAT, "0E+10"}, - {token.FLOAT, "1E-10"}, - {token.FLOAT, "42E+10"}, - {token.FLOAT, "01234567890E-10"}, - {token.FLOAT, "01.8e0"}, - {token.FLOAT, "1.4e0"}, - {token.FLOAT, "42.2e0"}, - {token.FLOAT, "01234567890.12e0"}, - {token.FLOAT, "0.E0"}, - {token.FLOAT, "1.12E0"}, - {token.FLOAT, "42.123E0"}, - {token.FLOAT, "01234567890.213E0"}, - {token.FLOAT, "0.2e+10"}, - {token.FLOAT, "1.2e-10"}, - {token.FLOAT, "42.54e+10"}, - {token.FLOAT, "01234567890.98e-10"}, - {token.FLOAT, "0.1E+10"}, - {token.FLOAT, "1.1E-10"}, - {token.FLOAT, "42.1E+10"}, - {token.FLOAT, "01234567890.1E-10"}, - {token.FLOAT, "-0.0"}, - {token.FLOAT, "-1.0"}, - {token.FLOAT, "-42.0"}, - {token.FLOAT, "-01234567890.0"}, - {token.FLOAT, "-0e0"}, - {token.FLOAT, "-1e0"}, - {token.FLOAT, "-42e0"}, - {token.FLOAT, "-01234567890e0"}, - {token.FLOAT, "-0E0"}, - {token.FLOAT, "-1E0"}, - {token.FLOAT, "-42E0"}, - {token.FLOAT, "-01234567890E0"}, - {token.FLOAT, "-0e+10"}, - {token.FLOAT, "-1e-10"}, - {token.FLOAT, "-42e+10"}, - {token.FLOAT, "-01234567890e-10"}, - {token.FLOAT, "-0E+10"}, - {token.FLOAT, "-1E-10"}, - {token.FLOAT, "-42E+10"}, - {token.FLOAT, "-01234567890E-10"}, - {token.FLOAT, "-01.8e0"}, - {token.FLOAT, "-1.4e0"}, - {token.FLOAT, "-42.2e0"}, - {token.FLOAT, "-01234567890.12e0"}, - {token.FLOAT, "-0.E0"}, - {token.FLOAT, "-1.12E0"}, - {token.FLOAT, "-42.123E0"}, - {token.FLOAT, "-01234567890.213E0"}, - {token.FLOAT, "-0.2e+10"}, - {token.FLOAT, "-1.2e-10"}, - {token.FLOAT, "-42.54e+10"}, - {token.FLOAT, "-01234567890.98e-10"}, - {token.FLOAT, "-0.1E+10"}, - {token.FLOAT, "-1.1E-10"}, - {token.FLOAT, "-42.1E+10"}, - {token.FLOAT, "-01234567890.1E-10"}, - }, -} - -var orderedTokenLists = []string{ - "comment", - "operator", - "bool", - "string", - "number", - "float", -} - -func TestPosition(t *testing.T) { - // create artifical source code - buf := new(bytes.Buffer) - - for _, listName := range orderedTokenLists { - for _, ident := range tokenLists[listName] { - fmt.Fprintf(buf, "\t\t\t\t%s\n", ident.text) - } - } - - s := New(buf.Bytes()) - - pos := token.Pos{"", 4, 1, 5} - s.Scan() - for _, listName := range orderedTokenLists { - - for _, k := range tokenLists[listName] { - curPos := s.tokPos - // fmt.Printf("[%q] s = %+v:%+v\n", k.text, curPos.Offset, curPos.Column) - - if curPos.Offset != pos.Offset { - t.Fatalf("offset = %d, want %d for %q", curPos.Offset, pos.Offset, k.text) - } - if curPos.Line != pos.Line { - t.Fatalf("line = %d, want %d for %q", curPos.Line, pos.Line, k.text) - } - if curPos.Column != pos.Column { - t.Fatalf("column = %d, want %d for %q", curPos.Column, pos.Column, k.text) - } - pos.Offset += 4 + len(k.text) + 1 // 4 tabs + token bytes + newline - pos.Line += countNewlines(k.text) + 1 // each token is on a new line - - s.Error = func(pos token.Pos, msg string) { - t.Errorf("error %q for %q", msg, k.text) - } - - s.Scan() - } - } - // make sure there were no token-internal errors reported by scanner - if s.ErrorCount != 0 { - t.Errorf("%d errors", s.ErrorCount) - } -} - -func TestComment(t *testing.T) { - testTokenList(t, tokenLists["comment"]) -} - -func TestOperator(t *testing.T) { - testTokenList(t, tokenLists["operator"]) -} - -func TestBool(t *testing.T) { - testTokenList(t, tokenLists["bool"]) -} - -func TestIdent(t *testing.T) { - testTokenList(t, tokenLists["ident"]) -} - -func TestString(t *testing.T) { - testTokenList(t, tokenLists["string"]) -} - -func TestNumber(t *testing.T) { - testTokenList(t, tokenLists["number"]) -} - -func TestFloat(t *testing.T) { - testTokenList(t, tokenLists["float"]) -} - -func TestRealExample(t *testing.T) { - complexReal := ` -{ - "variable": { - "foo": { - "default": "bar", - "description": "bar", - "depends_on": ["something"] - } - } -}` - - literals := []struct { - tokenType token.Type - literal string - }{ - {token.LBRACE, `{`}, - {token.STRING, `"variable"`}, - {token.COLON, `:`}, - {token.LBRACE, `{`}, - {token.STRING, `"foo"`}, - {token.COLON, `:`}, - {token.LBRACE, `{`}, - {token.STRING, `"default"`}, - {token.COLON, `:`}, - {token.STRING, `"bar"`}, - {token.COMMA, `,`}, - {token.STRING, `"description"`}, - {token.COLON, `:`}, - {token.STRING, `"bar"`}, - {token.COMMA, `,`}, - {token.STRING, `"depends_on"`}, - {token.COLON, `:`}, - {token.LBRACK, `[`}, - {token.STRING, `"something"`}, - {token.RBRACK, `]`}, - {token.RBRACE, `}`}, - {token.RBRACE, `}`}, - {token.RBRACE, `}`}, - {token.EOF, ``}, - } - - s := New([]byte(complexReal)) - for _, l := range literals { - tok := s.Scan() - if l.tokenType != tok.Type { - t.Errorf("got: %s want %s for %s\n", tok, l.tokenType, tok.String()) - } - - if l.literal != tok.Text { - t.Errorf("got: %s want %s\n", tok, l.literal) - } - } - -} - -func TestError(t *testing.T) { - testError(t, "\x80", "1:1", "illegal UTF-8 encoding", token.ILLEGAL) - testError(t, "\xff", "1:1", "illegal UTF-8 encoding", token.ILLEGAL) - - testError(t, `"ab`+"\x80", "1:4", "illegal UTF-8 encoding", token.STRING) - testError(t, `"abc`+"\xff", "1:5", "illegal UTF-8 encoding", token.STRING) - - testError(t, `01238`, "1:7", "numbers cannot start with 0", token.NUMBER) - testError(t, `01238123`, "1:10", "numbers cannot start with 0", token.NUMBER) - testError(t, `'aa'`, "1:1", "illegal char: '", token.ILLEGAL) - - testError(t, `"`, "1:2", "literal not terminated", token.STRING) - testError(t, `"abc`, "1:5", "literal not terminated", token.STRING) - testError(t, `"abc`+"\n", "1:5", "literal not terminated", token.STRING) -} - -func testError(t *testing.T, src, pos, msg string, tok token.Type) { - s := New([]byte(src)) - - errorCalled := false - s.Error = func(p token.Pos, m string) { - if !errorCalled { - if pos != p.String() { - t.Errorf("pos = %q, want %q for %q", p, pos, src) - } - - if m != msg { - t.Errorf("msg = %q, want %q for %q", m, msg, src) - } - errorCalled = true - } - } - - tk := s.Scan() - if tk.Type != tok { - t.Errorf("tok = %s, want %s for %q", tk, tok, src) - } - if !errorCalled { - t.Errorf("error handler not called for %q", src) - } - if s.ErrorCount == 0 { - t.Errorf("count = %d, want > 0 for %q", s.ErrorCount, src) - } -} - -func testTokenList(t *testing.T, tokenList []tokenPair) { - // create artifical source code - buf := new(bytes.Buffer) - for _, ident := range tokenList { - fmt.Fprintf(buf, "%s\n", ident.text) - } - - s := New(buf.Bytes()) - for _, ident := range tokenList { - tok := s.Scan() - if tok.Type != ident.tok { - t.Errorf("tok = %q want %q for %q\n", tok, ident.tok, ident.text) - } - - if tok.Text != ident.text { - t.Errorf("text = %q want %q", tok.String(), ident.text) - } - - } -} - -func countNewlines(s string) int { - n := 0 - for _, ch := range s { - if ch == '\n' { - n++ - } - } - return n -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json deleted file mode 100644 index e320f17ab2..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/array.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": [1, 2, "bar"], - "bar": "baz" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json deleted file mode 100644 index b54bde96c1..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/basic.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo": "bar" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json deleted file mode 100644 index 72168a3ccb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "foo": { - "bar": [1,2] - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json b/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json deleted file mode 100644 index 9a142a6ca6..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/test-fixtures/types.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "foo": "bar", - "bar": 7, - "baz": [1,2,3], - "foo": -12, - "bar": 3.14159, - "foo": true, - "bar": false, - "foo": null -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go b/test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go deleted file mode 100644 index 59c1bb72d4..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/token/position.go +++ /dev/null @@ -1,46 +0,0 @@ -package token - -import "fmt" - -// Pos describes an arbitrary source position -// including the file, line, and column location. -// A Position is valid if the line number is > 0. -type Pos struct { - Filename string // filename, if any - Offset int // offset, starting at 0 - Line int // line number, starting at 1 - Column int // column number, starting at 1 (character count) -} - -// IsValid returns true if the position is valid. -func (p *Pos) IsValid() bool { return p.Line > 0 } - -// String returns a string in one of several forms: -// -// file:line:column valid position with file name -// line:column valid position without file name -// file invalid position with file name -// - invalid position without file name -func (p Pos) String() string { - s := p.Filename - if p.IsValid() { - if s != "" { - s += ":" - } - s += fmt.Sprintf("%d:%d", p.Line, p.Column) - } - if s == "" { - s = "-" - } - return s -} - -// Before reports whether the position p is before u. -func (p Pos) Before(u Pos) bool { - return u.Offset > p.Offset || u.Line > p.Line -} - -// After reports whether the position p is after u. -func (p Pos) After(u Pos) bool { - return u.Offset < p.Offset || u.Line < p.Line -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go b/test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go deleted file mode 100644 index 95a0c3eee6..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/token/token.go +++ /dev/null @@ -1,118 +0,0 @@ -package token - -import ( - "fmt" - "strconv" - - hcltoken "github.com/hashicorp/hcl/hcl/token" -) - -// Token defines a single HCL token which can be obtained via the Scanner -type Token struct { - Type Type - Pos Pos - Text string -} - -// Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) -type Type int - -const ( - // Special tokens - ILLEGAL Type = iota - EOF - - identifier_beg - literal_beg - NUMBER // 12345 - FLOAT // 123.45 - BOOL // true,false - STRING // "abc" - NULL // null - literal_end - identifier_end - - operator_beg - LBRACK // [ - LBRACE // { - COMMA // , - PERIOD // . - COLON // : - - RBRACK // ] - RBRACE // } - - operator_end -) - -var tokens = [...]string{ - ILLEGAL: "ILLEGAL", - - EOF: "EOF", - - NUMBER: "NUMBER", - FLOAT: "FLOAT", - BOOL: "BOOL", - STRING: "STRING", - NULL: "NULL", - - LBRACK: "LBRACK", - LBRACE: "LBRACE", - COMMA: "COMMA", - PERIOD: "PERIOD", - COLON: "COLON", - - RBRACK: "RBRACK", - RBRACE: "RBRACE", -} - -// String returns the string corresponding to the token tok. -func (t Type) String() string { - s := "" - if 0 <= t && t < Type(len(tokens)) { - s = tokens[t] - } - if s == "" { - s = "token(" + strconv.Itoa(int(t)) + ")" - } - return s -} - -// IsIdentifier returns true for tokens corresponding to identifiers and basic -// type literals; it returns false otherwise. -func (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end } - -// IsLiteral returns true for tokens corresponding to basic type literals; it -// returns false otherwise. -func (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end } - -// IsOperator returns true for tokens corresponding to operators and -// delimiters; it returns false otherwise. -func (t Type) IsOperator() bool { return operator_beg < t && t < operator_end } - -// String returns the token's literal text. Note that this is only -// applicable for certain token types, such as token.IDENT, -// token.STRING, etc.. -func (t Token) String() string { - return fmt.Sprintf("%s %s %s", t.Pos.String(), t.Type.String(), t.Text) -} - -// HCLToken converts this token to an HCL token. -// -// The token type must be a literal type or this will panic. -func (t Token) HCLToken() hcltoken.Token { - switch t.Type { - case BOOL: - return hcltoken.Token{Type: hcltoken.BOOL, Text: t.Text} - case FLOAT: - return hcltoken.Token{Type: hcltoken.FLOAT, Text: t.Text} - case NULL: - return hcltoken.Token{Type: hcltoken.STRING, Text: ""} - case NUMBER: - return hcltoken.Token{Type: hcltoken.NUMBER, Text: t.Text} - case STRING: - return hcltoken.Token{Type: hcltoken.STRING, Text: t.Text, JSON: true} - default: - panic(fmt.Sprintf("unimplemented HCLToken for type: %s", t.Type)) - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go b/test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go deleted file mode 100644 index a83fdd55bb..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/json/token/token_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package token - -import ( - "testing" -) - -func TestTypeString(t *testing.T) { - var tokens = []struct { - tt Type - str string - }{ - {ILLEGAL, "ILLEGAL"}, - {EOF, "EOF"}, - {NUMBER, "NUMBER"}, - {FLOAT, "FLOAT"}, - {BOOL, "BOOL"}, - {STRING, "STRING"}, - {NULL, "NULL"}, - {LBRACK, "LBRACK"}, - {LBRACE, "LBRACE"}, - {COMMA, "COMMA"}, - {PERIOD, "PERIOD"}, - {RBRACK, "RBRACK"}, - {RBRACE, "RBRACE"}, - } - - for _, token := range tokens { - if token.tt.String() != token.str { - t.Errorf("want: %q got:%q\n", token.str, token.tt) - - } - } - -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/lex.go b/test/integration/licenses/github.com/hashicorp/hcl/lex.go deleted file mode 100644 index d9993c2928..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/lex.go +++ /dev/null @@ -1,38 +0,0 @@ -package hcl - -import ( - "unicode" - "unicode/utf8" -) - -type lexModeValue byte - -const ( - lexModeUnknown lexModeValue = iota - lexModeHcl - lexModeJson -) - -// lexMode returns whether we're going to be parsing in JSON -// mode or HCL mode. -func lexMode(v []byte) lexModeValue { - var ( - r rune - w int - offset int - ) - - for { - r, w = utf8.DecodeRune(v[offset:]) - offset += w - if unicode.IsSpace(r) { - continue - } - if r == '{' { - return lexModeJson - } - break - } - - return lexModeHcl -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/lex_test.go b/test/integration/licenses/github.com/hashicorp/hcl/lex_test.go deleted file mode 100644 index 8062764446..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/lex_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package hcl - -import ( - "testing" -) - -func TestLexMode(t *testing.T) { - cases := []struct { - Input string - Mode lexModeValue - }{ - { - "", - lexModeHcl, - }, - { - "foo", - lexModeHcl, - }, - { - "{}", - lexModeJson, - }, - { - " {}", - lexModeJson, - }, - } - - for i, tc := range cases { - actual := lexMode([]byte(tc.Input)) - - if actual != tc.Mode { - t.Fatalf("%d: %#v", i, actual) - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/parse.go b/test/integration/licenses/github.com/hashicorp/hcl/parse.go deleted file mode 100644 index 1fca53c4ce..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/parse.go +++ /dev/null @@ -1,39 +0,0 @@ -package hcl - -import ( - "fmt" - - "github.com/hashicorp/hcl/hcl/ast" - hclParser "github.com/hashicorp/hcl/hcl/parser" - jsonParser "github.com/hashicorp/hcl/json/parser" -) - -// ParseBytes accepts as input byte slice and returns ast tree. -// -// Input can be either JSON or HCL -func ParseBytes(in []byte) (*ast.File, error) { - return parse(in) -} - -// ParseString accepts input as a string and returns ast tree. -func ParseString(input string) (*ast.File, error) { - return parse([]byte(input)) -} - -func parse(in []byte) (*ast.File, error) { - switch lexMode(in) { - case lexModeHcl: - return hclParser.Parse(in) - case lexModeJson: - return jsonParser.Parse(in) - } - - return nil, fmt.Errorf("unknown config format") -} - -// Parse parses the given input and returns the root object. -// -// The input format can be either HCL or JSON. -func Parse(input string) (*ast.File, error) { - return parse([]byte(input)) -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl deleted file mode 100644 index dd3151cb7d..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/assign_deep.hcl +++ /dev/null @@ -1,5 +0,0 @@ -resource = [{ - foo = [{ - bar = {} - }] -}] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl deleted file mode 100644 index 9499944872..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -bar = "${file("bing/bong.txt")}" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json deleted file mode 100644 index 7bdddc84b0..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "foo": "bar", - "bar": "${file(\"bing/bong.txt\")}" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl deleted file mode 100644 index 4e415da20e..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_int_string.hcl +++ /dev/null @@ -1 +0,0 @@ -count = "3" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl deleted file mode 100644 index 363697b496..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/basic_squish.hcl +++ /dev/null @@ -1,3 +0,0 @@ -foo="bar" -bar="${file("bing/bong.txt")}" -foo-bar="baz" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl deleted file mode 100644 index ee8b06fe3c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/block_assign.hcl +++ /dev/null @@ -1,2 +0,0 @@ -environment = "aws" { -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl deleted file mode 100644 index 5b185cc918..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.hcl +++ /dev/null @@ -1,15 +0,0 @@ -key "" { - policy = "read" -} - -key "foo/" { - policy = "write" -} - -key "foo/bar/" { - policy = "read" -} - -key "foo/bar/baz" { - policy = "deny" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json deleted file mode 100644 index 151864ee89..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_policy.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "key": { - "": { - "policy": "read" - }, - - "foo/": { - "policy": "write" - }, - - "foo/bar/": { - "policy": "read" - }, - - "foo/bar/baz": { - "policy": "deny" - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl deleted file mode 100644 index 52dcaa1bc3..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.hcl +++ /dev/null @@ -1,10 +0,0 @@ -variable "foo" { - default = "bar" - description = "bar" -} - -variable "amis" { - default = { - east = "foo" - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json deleted file mode 100644 index 49f921ed0b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/decode_tf_variable.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "variable": { - "foo": { - "default": "bar", - "description": "bar" - }, - - "amis": { - "default": { - "east": "foo" - } - } - } -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl deleted file mode 100644 index 5be1b23154..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/empty.hcl +++ /dev/null @@ -1 +0,0 @@ -resource "foo" {} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl deleted file mode 100644 index f818b15e02..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape.hcl +++ /dev/null @@ -1,6 +0,0 @@ -foo = "bar\"baz\\n" -bar = "new\nline" -qux = "back\\slash" -qax = "slash\\:colon" -nested = "${HH\\:mm\\:ss}" -nestedquotes = "${"\"stringwrappedinquotes\""}" diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl deleted file mode 100644 index bc337fb7cc..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/escape_backslash.hcl +++ /dev/null @@ -1,5 +0,0 @@ -output { - one = "${replace(var.sub_domain, ".", "\\.")}" - two = "${replace(var.sub_domain, ".", "\\\\.")}" - many = "${replace(var.sub_domain, ".", "\\\\\\\\.")}" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl deleted file mode 100644 index 9bca551f89..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/flat.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = "bar" -Key = 7 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl deleted file mode 100644 index edf355e38a..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.hcl +++ /dev/null @@ -1,2 +0,0 @@ -a = 1.02 -b = 2 diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json deleted file mode 100644 index 580868043c..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/float.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "a": 1.02, - "b": 2 -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/git_crypt.hcl deleted file mode 100644 index f691948e1b4238d680e670973bbae039c809e5ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10 RcmZQ@_Y83kiVO(h0ssw90)YSk diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json deleted file mode 100644 index cad0151985..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/interpolate.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "default": "${replace(\"europe-west\", \"-\", \" \")}" -} diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl deleted file mode 100644 index 8af3458499..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_lists.hcl +++ /dev/null @@ -1,2 +0,0 @@ -foo = [["foo"], ["bar"]] - diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl deleted file mode 100644 index 985a33baee..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/list_of_maps.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = [ - {somekey1 = "someval1"}, - {somekey2 = "someval2", someextrakey = "someextraval"}, -] diff --git a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl b/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl deleted file mode 100644 index f883bd707b..0000000000 --- a/test/integration/licenses/github.com/hashicorp/hcl/test-fixtures/multiline.hcl +++ /dev/null @@ -1,4 +0,0 @@ -foo = < - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/test/integration/licenses/github.com/juju/clock/Makefile b/test/integration/licenses/github.com/juju/clock/Makefile deleted file mode 100644 index 900ccf7573..0000000000 --- a/test/integration/licenses/github.com/juju/clock/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -PROJECT := github.com/juju/clock - -.PHONY: check-licence check-go check - -check: check-licence check-go - go test $(PROJECT)/... - -check-licence: - @(fgrep -rl "Licensed under the LGPLv3" --exclude *.s .;\ - fgrep -rl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" --exclude *.s .;\ - find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ - xargs -I {} echo FAIL: licence missed: {} - -check-go: - $(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g"))) - @(if [ x$(GOFMT) != x"" ]; then \ - echo go fmt is sad: $(GOFMT); \ - exit 1; \ - fi ) - @(go vet -all -composites=false -copylocks=false .) diff --git a/test/integration/licenses/github.com/juju/clock/README.md b/test/integration/licenses/github.com/juju/clock/README.md deleted file mode 100644 index a5ac464d31..0000000000 --- a/test/integration/licenses/github.com/juju/clock/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# clock - -An interface definition for a fully defined clock. - -An WallClock implementation of that interface using the time package. - -A testing clock. diff --git a/test/integration/licenses/github.com/juju/clock/clock.go b/test/integration/licenses/github.com/juju/clock/clock.go deleted file mode 100644 index 59a511d053..0000000000 --- a/test/integration/licenses/github.com/juju/clock/clock.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package clock - -import "time" - -// Clock provides an interface for dealing with clocks. -type Clock interface { - // Now returns the current clock time. - Now() time.Time - - // After waits for the duration to elapse and then sends the - // current time on the returned channel. - After(time.Duration) <-chan time.Time - - // AfterFunc waits for the duration to elapse and then calls f in its own goroutine. - // It returns a Timer that can be used to cancel the call using its Stop method. - AfterFunc(d time.Duration, f func()) Timer - - // NewTimer creates a new Timer that will send the current time - // on its channel after at least duration d. - NewTimer(d time.Duration) Timer -} - -// Alarm returns a channel that will have the time sent on it at some point -// after the supplied time occurs. -// -// This is short for c.After(t.Sub(c.Now())). -func Alarm(c Clock, t time.Time) <-chan time.Time { - return c.After(t.Sub(c.Now())) -} - -// The Timer type represents a single event. -// A Timer must be created with AfterFunc. -// This interface follows time.Timer's methods but provides easier mocking. -type Timer interface { - // When the Timer expires, the current time will be sent on the - // channel returned from Chan, unless the Timer was created by - // AfterFunc. - Chan() <-chan time.Time - - // Reset changes the timer to expire after duration d. - // It returns true if the timer had been active, false if - // the timer had expired or been stopped. - Reset(time.Duration) bool - - // Stop prevents the Timer from firing. It returns true if - // the call stops the timer, false if the timer has already expired or been stopped. - // Stop does not close the channel, to prevent a read - // from the channel succeeding incorrectly. - Stop() bool -} diff --git a/test/integration/licenses/github.com/juju/clock/go.mod b/test/integration/licenses/github.com/juju/clock/go.mod deleted file mode 100644 index eebad3ac8c..0000000000 --- a/test/integration/licenses/github.com/juju/clock/go.mod +++ /dev/null @@ -1,23 +0,0 @@ -module github.com/juju/clock - -go 1.18 - -require ( - github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 - github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 - github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c -) - -require ( - github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 // indirect - github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 // indirect - github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect - github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a // indirect - github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 // indirect - github.com/kr/pretty v0.2.1 // indirect - github.com/kr/text v0.2.0 // indirect - golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect - golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect -) diff --git a/test/integration/licenses/github.com/juju/clock/go.sum b/test/integration/licenses/github.com/juju/clock/go.sum deleted file mode 100644 index 3541c1ac0a..0000000000 --- a/test/integration/licenses/github.com/juju/clock/go.sum +++ /dev/null @@ -1,87 +0,0 @@ -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= -github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 h1:4R626WTwa7pRYQFiIRLVPepMhm05eZMEx+wIurRnMLc= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= -github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 h1:EJHbsNpQyupmMeWTq7inn+5L/WZ7JfzCVPJ+DP9McCQ= -github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9/go.mod h1:TRm7EVGA3mQOqSVcBySRY7a9Y1/gyVhh/WTCnc5sD4U= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= -github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= -github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 h1:NO5tuyw++EGLnz56Q8KMyDZRwJwWO8jQnj285J3FOmY= -github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= -github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= -github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= -github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 h1:XEDzpuZb8Ma7vLja3+5hzUqVTvAqm5Y+ygvnDs5iTMM= -github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494/go.mod h1:rUquetT0ALL48LHZhyRGvjjBH8xZaZ8dFClulKK5wK4= -github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= -github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a h1:5ZWDCeCF0RaITrZGemzmDFIhjR/MVSvBUqgSyaeTMbE= -github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= -github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 h1:wtEPbidt1VyHlb8RSztU6ySQj29FLsOQiI9XiJhXDM4= -github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23/go.mod h1:Ljlbryh9sYaUSGXucslAEDf0A2XUSGvDbHJgW8ps6nc= -github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= -github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= -github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= -golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -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/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= -gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= -gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= -gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -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= -launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= -launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= diff --git a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go deleted file mode 100644 index 6941ed4557..0000000000 --- a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package monotonic - -import ( - "time" - _ "unsafe" -) - -//go:noescape -//go:linkname nanotime runtime.nanotime -func nanotime() int64 - -// Now returns the current time in nanoseconds from a monotonic clock. -// -// The result is guaranteed to not jump due to NTP or other changes to -// system time, which may jump forward or backwards. Instead, in response to -// such changes, the clock frequency is adjusted slowly. -func Now() time.Duration { - return time.Duration(nanotime()) -} diff --git a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s deleted file mode 100644 index 6f9f4945f1..0000000000 --- a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic.s +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright 2017 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -// Deliberately empty - see https://github.com/golang/go/issues/15006 diff --git a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go b/test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go deleted file mode 100644 index b57fe4298b..0000000000 --- a/test/integration/licenses/github.com/juju/clock/monotonic/monotonic_test.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package monotonic_test - -import ( - "testing" - "time" - - gc "gopkg.in/check.v1" - - "github.com/juju/clock/monotonic" -) - -func TestPackage(t *testing.T) { - gc.TestingT(t) -} - -type MonotonicSuite struct { -} - -var _ = gc.Suite(&MonotonicSuite{}) - -func (s *MonotonicSuite) TestNow(c *gc.C) { - var prev time.Duration - for i := 0; i < 1000; i++ { - val := monotonic.Now() - if val < prev { - c.Fatal("now is less than previous value") - } - prev = val - } -} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/clock.go b/test/integration/licenses/github.com/juju/clock/testclock/clock.go deleted file mode 100644 index dfa95aa258..0000000000 --- a/test/integration/licenses/github.com/juju/clock/testclock/clock.go +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright 2015-2018 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package testclock - -import ( - "fmt" - "runtime/debug" - "sort" - "sync" - "time" - - "github.com/juju/clock" - "github.com/juju/errors" - "github.com/juju/loggo" -) - -// timer implements a mock clock.Timer for testing purposes. -type timer struct { - deadline time.Time - clock *Clock - c chan time.Time - // trigger is called when the timer expires. It is - // called with the clock mutex held and will not block. - trigger func() - stack []byte -} - -// Reset is part of the clock.Timer interface. -func (t *timer) Reset(d time.Duration) bool { - return t.clock.reset(t, d) -} - -// Stop is part of the clock.Timer interface. -func (t *timer) Stop() bool { - return t.clock.stop(t) -} - -// Chan is part of the clock.Timer interface. -func (t *timer) Chan() <-chan time.Time { - return t.c -} - -// Clock implements a mock clock.Clock for testing purposes. -type Clock struct { - mu sync.Mutex - now time.Time - waiting []*timer // timers waiting to fire, sorted by deadline. - notifyAlarms chan struct{} -} - -var _ AdvanceableClock = (*Clock)(nil) - -// NewClock returns a new clock set to the supplied time. If your SUT needs to -// call After, AfterFunc, NewTimer or Timer.Reset more than 10000 times: (1) -// you have probably written a bad test; and (2) you'll need to read from the -// Alarms chan to keep the buffer clear. -func NewClock(now time.Time) *Clock { - return &Clock{ - now: now, - notifyAlarms: make(chan struct{}, 10000), - } -} - -// Now is part of the clock.Clock interface. -func (clock *Clock) Now() time.Time { - clock.mu.Lock() - defer clock.mu.Unlock() - return clock.now -} - -// After is part of the clock.Clock interface. -func (clock *Clock) After(d time.Duration) <-chan time.Time { - return clock.NewTimer(d).Chan() -} - -func (clock *Clock) NewTimer(d time.Duration) clock.Timer { - c := make(chan time.Time, 1) - return clock.addAlarm(d, c, func() { - c <- clock.now - }) -} - -// AfterFunc is part of the clock.Clock interface. -func (clock *Clock) AfterFunc(d time.Duration, f func()) clock.Timer { - return clock.addAlarm(d, nil, func() { - go f() - }) -} - -func (clock *Clock) addAlarm(d time.Duration, c chan time.Time, trigger func()) *timer { - defer clock.notifyAlarm() - clock.mu.Lock() - defer clock.mu.Unlock() - t := &timer{ - c: c, - deadline: clock.now.Add(d), - clock: clock, - trigger: trigger, - stack: debug.Stack(), - } - clock.addTimer(t) - clock.triggerAll() - return t -} - -// Advance advances the result of Now by the supplied duration, and sends -// the "current" time on all alarms which are no longer "in the future". -func (clock *Clock) Advance(d time.Duration) { - clock.mu.Lock() - defer clock.mu.Unlock() - clock.now = clock.now.Add(d) - if len(clock.waiting) == 0 { - loggo.GetLogger("juju.clock").Debugf("advancing a clock that has nothing waiting: cf. https://github.com/juju/juju/wiki/Intermittent-failures") - } - clock.triggerAll() -} - -// WaitAdvance functions the same as Advance, but only if there is n timers in -// clock.waiting. This came about while fixing lp:1607044 intermittent -// failures. It turns out that testing.Clock.Advance might advance the time -// and trigger notifications before triggers are set. So we wait a limited time -// 'w' for 'n' timers to show up in clock.waiting, and if they do we advance -// 'd'. -func (clock *Clock) WaitAdvance(d, w time.Duration, n int) error { - pause := w / 10 - if pause > 10*time.Millisecond { - pause = 10 * time.Millisecond - } - finalTimeout := time.After(w) - next := time.After(0) - for { - select { - case <-finalTimeout: - if clock.hasNWaiters(n) { - clock.Advance(d) - return nil - } - clock.mu.Lock() - got := len(clock.waiting) - var stacks string - for _, t := range clock.waiting { - stacks += fmt.Sprintf("timer deadline: %v\n%s", t.deadline, string(t.stack)) - } - clock.mu.Unlock() - return errors.Errorf( - "got %d timers added after waiting %s: wanted %d, stacks:\n%s", - got, w.String(), n, stacks) - case <-next: - if clock.hasNWaiters(n) { - clock.Advance(d) - return nil - } - next = time.After(pause) - } - } -} - -// hasNWaiters checks if the clock currently has 'n' timers waiting to fire. -func (clock *Clock) hasNWaiters(n int) bool { - clock.mu.Lock() - hasWaiters := len(clock.waiting) == n - clock.mu.Unlock() - return hasWaiters -} - -// Alarms returns a channel on which you can read one value for every call to -// After and AfterFunc; and for every successful Timer.Reset backed by this -// Clock. It might not be elegant but it's necessary when testing time logic -// that runs on a goroutine other than that of the test. -func (clock *Clock) Alarms() <-chan struct{} { - return clock.notifyAlarms -} - -// triggerAll triggers any alarms that are currently due and removes them -// from clock.waiting. -func (clock *Clock) triggerAll() { - triggered := 0 - for _, t := range clock.waiting { - if clock.now.Before(t.deadline) { - break - } - t.trigger() - triggered++ - } - clock.waiting = clock.waiting[triggered:] -} - -// reset is the underlying implementation of clock.Timer.Reset, which may be -// called by any Timer backed by this Clock. -func (clock *Clock) reset(t *timer, d time.Duration) bool { - defer clock.notifyAlarm() - clock.mu.Lock() - defer clock.mu.Unlock() - - found := false - for _, wt := range clock.waiting { - if wt == t { - found = true - } - } - if !found { - clock.waiting = append(clock.waiting, t) - } - t.deadline = clock.now.Add(d) - sort.Sort(byDeadline(clock.waiting)) - if d <= 0 { - // If duration is <= 0, that means we should be triggering the - // Timer right away, as "now" has already occured. - clock.triggerAll() - } - return found -} - -// stop is the underlying implementation of clock.Timer.Reset, which may be -// called by any Timer backed by this Clock. -func (clock *Clock) stop(t *timer) bool { - clock.mu.Lock() - defer clock.mu.Unlock() - - for i, wt := range clock.waiting { - if wt == t { - clock.waiting = removeFromSlice(clock.waiting, i) - return true - } - } - return false -} - -// addTimer adds an alarm at time t. -func (clock *Clock) addTimer(t *timer) { - clock.waiting = append(clock.waiting, t) - sort.Sort(byDeadline(clock.waiting)) -} - -// notifyAlarm sends a value on the channel exposed by Alarms(). -func (clock *Clock) notifyAlarm() { - select { - case clock.notifyAlarms <- struct{}{}: - default: - panic("alarm notification buffer full") - } -} - -// byDeadline is used to sort alarms by time. -type byDeadline []*timer - -func (a byDeadline) Len() int { return len(a) } -func (a byDeadline) Less(i, j int) bool { return a[i].deadline.Before(a[j].deadline) } -func (a byDeadline) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// removeFromSlice removes item at the specified index from the slice. -func removeFromSlice(sl []*timer, index int) []*timer { - return append(sl[:index], sl[index+1:]...) -} - -// AutoAdvancingClock wraps a clock.Clock, calling the Advance -// function whenever After or AfterFunc are called. -type AutoAdvancingClock struct { - clock.Clock - Advance func(time.Duration) -} - -func (c *AutoAdvancingClock) After(d time.Duration) <-chan time.Time { - ch := c.Clock.After(d) - c.Advance(d) - return ch -} - -func (c *AutoAdvancingClock) AfterFunc(d time.Duration, f func()) clock.Timer { - t := c.Clock.AfterFunc(d, f) - c.Advance(d) - return t -} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/clock_test.go b/test/integration/licenses/github.com/juju/clock/testclock/clock_test.go deleted file mode 100644 index df453b8655..0000000000 --- a/test/integration/licenses/github.com/juju/clock/testclock/clock_test.go +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package testclock_test - -import ( - "sync" - "time" - - "github.com/juju/loggo" - "github.com/juju/testing" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/clock/testclock" -) - -type clockSuite struct { - testing.LoggingSuite -} - -var _ = gc.Suite(&clockSuite{}) - -func (*clockSuite) TestNow(c *gc.C) { - t0 := time.Now() - cl := testclock.NewClock(t0) - c.Assert(cl.Now(), gc.Equals, t0) -} - -func (*clockSuite) TestAdvanceLogs(c *gc.C) { - loggo.GetLogger("juju.clock").SetLogLevel(loggo.DEBUG) - t0 := time.Now() - cl := testclock.NewClock(t0) - - // Shouldn't log anything. - t := cl.After(time.Second) - cl.Advance(time.Minute) - <-t - c.Check(c.GetTestLog(), jc.DeepEquals, "") - - // Should log since nothing's waiting. - cl.Advance(time.Hour) - c.Check(c.GetTestLog(), jc.Contains, "advancing a clock that has nothing waiting: cf. https://github.com/juju/juju/wiki/Intermittent-failures") -} - -func (*clockSuite) TestWaitAdvance(c *gc.C) { - t0 := time.Now() - cl := testclock.NewClock(t0) - - // It is legal to just say 'nothing is waiting' - err := cl.WaitAdvance(0, 0, 0) - c.Check(err, jc.ErrorIsNil) - - // Test that no timers errors out. - err = cl.WaitAdvance(time.Millisecond, 10*time.Millisecond, 1) - c.Check(err, gc.ErrorMatches, "got 0 timers added after waiting 10ms: wanted 1, stacks:\n") - - // Test that a timer doesn't error. - _ = cl.After(time.Nanosecond) - err = cl.WaitAdvance(time.Millisecond, 10*time.Millisecond, 1) - c.Check(err, jc.ErrorIsNil) -} - -func (*clockSuite) TestAdvanceWithAfter(c *gc.C) { - t0 := time.Now() - cl := testclock.NewClock(t0) - ch := cl.After(time.Second) - select { - case <-ch: - c.Fatalf("received unexpected event") - case <-time.After(shortWait): - } - - cl.Advance(time.Second - 1) - - select { - case <-ch: - c.Fatalf("received unexpected event") - case <-time.After(shortWait): - } - - cl.Advance(1) - - select { - case <-ch: - case <-time.After(longWait): - c.Fatalf("expected event to be triggered") - } - - cl.Advance(time.Second) - select { - case <-ch: - c.Fatalf("received unexpected event") - case <-time.After(shortWait): - } - - // Test that we can do it again - ch = cl.After(time.Second) - cl.Advance(2 * time.Second) - select { - case <-ch: - case <-time.After(longWait): - c.Fatalf("expected event to be triggered") - } - c.Assert(cl.Now().UTC(), gc.Equals, t0.Add(4*time.Second).UTC()) -} - -func (*clockSuite) TestAdvanceWithAfterFunc(c *gc.C) { - // Most of the details have been checked in TestAdvanceWithAfter, - // so just check that AfterFunc is wired up correctly. - t0 := time.Now() - cl := testclock.NewClock(t0) - fired := make(chan struct{}) - cl.AfterFunc(time.Second, func() { - close(fired) - }) - cl.Advance(2 * time.Second) - select { - case <-fired: - case <-time.After(longWait): - c.Fatalf("expected event to be triggered") - } -} - -func (*clockSuite) TestAfterFuncStop(c *gc.C) { - t0 := time.Now() - cl := testclock.NewClock(t0) - fired := make(chan struct{}) - timer := cl.AfterFunc(time.Second, func() { - close(fired) - }) - cl.Advance(50 * time.Millisecond) - timer.Stop() - select { - case <-fired: - c.Fatalf("received unexpected event") - case <-time.After(shortWait): - } -} - -func (*clockSuite) TestNewTimerReset(c *gc.C) { - t0 := time.Now() - cl := testclock.NewClock(t0) - timer := cl.NewTimer(time.Second) - cl.Advance(time.Second) - select { - case t := <-timer.Chan(): - c.Assert(t.UTC(), gc.Equals, t0.Add(time.Second).UTC()) - case <-time.After(longWait): - c.Fatalf("expected event to be triggered") - } - - timer.Reset(50 * time.Millisecond) - cl.Advance(100 * time.Millisecond) - select { - case t := <-timer.Chan(): - c.Assert(t.UTC(), gc.Equals, t0.Add(time.Second+100*time.Millisecond).UTC()) - case <-time.After(longWait): - c.Fatalf("expected event to be triggered") - } -} - -func (*clockSuite) TestNewTimerAsyncReset(c *gc.C) { - t0 := time.Now() - clock := testclock.NewClock(t0) - timer := clock.NewTimer(time.Hour) - stop := make(chan struct{}) - stopped := make(chan struct{}) - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - select { - case <-stop: - case t := <-timer.Chan(): - c.Errorf("timer accidentally ticked at: %v", t) - case <-time.After(longWait): - c.Errorf("test took too long") - } - close(stopped) - }() - // Just our goroutine, but we don't go so far as to trigger the wakeup. - clock.WaitAdvance(1*time.Minute, 10*time.Millisecond, 1) - // Reset shouldn't trigger a wakeup, just move when it thinks it will wake up. - timer.Reset(time.Hour) - clock.WaitAdvance(1*time.Minute, 10*time.Millisecond, 1) - timer.Reset(time.Minute) - clock.WaitAdvance(30*time.Second, 10*time.Millisecond, 1) - // Now tell the goroutine to stop and start another one that *does* want to - // wake up - close(stop) - select { - case <-stopped: - case <-time.After(longWait): - c.Errorf("goroutine failed to stop") - } - wg.Add(1) - go func() { - defer wg.Done() - select { - case t := <-timer.Chan(): - c.Logf("timer successfully ticked: %v", t) - case <-time.After(longWait): - c.Errorf("timer took too long") - } - }() - // And advance the clock long enough to cause it to notice - clock.WaitAdvance(30*time.Second, 10*time.Millisecond, 1) - wg.Wait() -} - -func (*clockSuite) TestNewTimerResetCausesWakeup(c *gc.C) { - t0 := time.Now() - clock := testclock.NewClock(t0) - timer1 := clock.NewTimer(time.Hour) - timer2 := clock.NewTimer(time.Hour) - timer3 := clock.NewTimer(time.Hour) - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - select { - case t := <-timer1.Chan(): - c.Check(t0, gc.Equals, t) - case <-time.After(longWait): - c.Errorf("timer1 took too long to wake up") - } - }() - wg.Add(1) - go func() { - defer wg.Done() - select { - case <-timer2.Chan(): - c.Errorf("timer2 should not wake up") - case <-time.After(shortWait): - c.Logf("timer2 succesfully slept for 50ms") - } - }() - wg.Add(1) - go func() { - defer wg.Done() - select { - case t := <-timer3.Chan(): - // Even though the reset was negative, it triggers at 'now' - c.Check(t0, gc.Equals, t) - case <-time.After(longWait): - c.Errorf("timer3 took too long to wake up") - } - }() - // Reseting the timer to a time <= 0 should cause it to wake up on its - // own, without needing an Advance or WaitAdvance to be done - timer1.Reset(0) - timer3.Reset(-1 * time.Second) - wg.Wait() -} - -func (*clockSuite) TestMultipleWaiters(c *gc.C) { - var wg sync.WaitGroup - t0 := time.Date(2000, 01, 01, 01, 0, 0, 0, time.UTC) - cl := testclock.NewClock(t0) - - total := 0 - start := func(f func()) { - total++ - wg.Add(1) - go func() { - defer wg.Done() - f() - }() - } - start(func() { - <-cl.After(50 * time.Millisecond) - }) - start(func() { - ch := make(chan struct{}) - cl.AfterFunc(100*time.Millisecond, func() { - close(ch) - }) - <-ch - }) - start(func() { - timer := cl.NewTimer(150 * time.Millisecond) - <-timer.Chan() - timer.Reset(50 * time.Millisecond) - <-timer.Chan() - }) - - done := make(chan struct{}) - go func() { - wg.Wait() - close(done) - }() - - // Wait for all the alarms to be waited on. - for i := 0; i < total; i++ { - select { - case <-cl.Alarms(): - case <-time.After(longWait): - c.Fatalf("expected a notification on the alarms channel") - } - } - select { - case <-cl.Alarms(): - c.Fatalf("unexpected extra notification on alarms channel") - case <-time.After(shortWait): - } - - cl.Advance(150 * time.Millisecond) - - // Wait for the extra notification after reset. - select { - case <-cl.Alarms(): - case <-time.After(longWait): - c.Fatalf("expected a notification on the alarms channel") - } - - cl.Advance(50 * time.Millisecond) - - select { - case <-done: - case <-time.After(longWait): - c.Fatalf("expected all waits to complete") - } - -} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/dilated.go b/test/integration/licenses/github.com/juju/clock/testclock/dilated.go deleted file mode 100644 index 4333b11f77..0000000000 --- a/test/integration/licenses/github.com/juju/clock/testclock/dilated.go +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2022 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package testclock - -import ( - "sync" - "sync/atomic" - "time" - - "github.com/juju/clock" -) - -// NewDilatedWallClock returns a clock that can be sped up or slowed down. -// realSecondDuration is the real duration of a second. -func NewDilatedWallClock(realSecondDuration time.Duration) AdvanceableClock { - dc := &dilationClock{ - epoch: time.Now(), - realSecondDuration: realSecondDuration, - offsetChanged: make(chan any), - } - dc.offsetChangedCond = sync.NewCond(dc.offsetChangedMutex.RLocker()) - return dc -} - -type dilationClock struct { - epoch time.Time - realSecondDuration time.Duration - - // offsetAtomic is the current dilated offset to allow for time jumps/advances. - offsetAtomic int64 - // offsetChanged is a channel that is closed when timers need to be signaled - // that there is a offset change coming. - offsetChanged chan any - // offsetChangedMutex is a mutex protecting the offsetChanged and is used by - // the offsetChangedCond. - offsetChangedMutex sync.RWMutex - // offsetChangedCond is used to signal timers that they may try to pull the new - // offset. - offsetChangedCond *sync.Cond -} - -// Now is part of the Clock interface. -func (dc *dilationClock) Now() time.Time { - dt, _ := dc.nowWithOffset() - return dt -} - -func (dc *dilationClock) nowWithOffset() (time.Time, time.Duration) { - offset := time.Duration(atomic.LoadInt64(&dc.offsetAtomic)) - realNow := time.Now() - dt := dilateTime(dc.epoch, realNow, dc.realSecondDuration, offset) - return dt, offset -} - -// After implements Clock.After -func (dc *dilationClock) After(d time.Duration) <-chan time.Time { - t := newDilatedWallTimer(dc, d, nil) - return t.c -} - -// AfterFunc implements Clock.AfterFunc -func (dc *dilationClock) AfterFunc(d time.Duration, f func()) clock.Timer { - return newDilatedWallTimer(dc, d, f) -} - -// NewTimer implements Clock.NewTimer -func (dc *dilationClock) NewTimer(d time.Duration) clock.Timer { - return newDilatedWallTimer(dc, d, nil) -} - -// Advance implements AdvanceableClock.Advance -func (dc *dilationClock) Advance(d time.Duration) { - close(dc.offsetChanged) - dc.offsetChangedMutex.Lock() - dc.offsetChanged = make(chan any) - atomic.AddInt64(&dc.offsetAtomic, int64(d)) - dc.offsetChangedCond.Broadcast() - dc.offsetChangedMutex.Unlock() -} - -// dilatedWallTimer implements the Timer interface. -type dilatedWallTimer struct { - timer *time.Timer - dc *dilationClock - c chan time.Time - target time.Time - offset time.Duration - after func() - done chan any - resetChan chan resetReq - resetMutex sync.Mutex - stopChan chan chan bool -} - -type resetReq struct { - d time.Duration - r chan bool -} - -func newDilatedWallTimer(dc *dilationClock, d time.Duration, after func()) *dilatedWallTimer { - t := &dilatedWallTimer{ - dc: dc, - c: make(chan time.Time), - resetChan: make(chan resetReq), - stopChan: make(chan chan bool), - } - t.start(d, after) - return t -} - -func (t *dilatedWallTimer) start(d time.Duration, after func()) { - t.dc.offsetChangedMutex.RLock() - dialatedNow, offset := t.dc.nowWithOffset() - realDuration := time.Duration(float64(d) * t.dc.realSecondDuration.Seconds()) - t.target = dialatedNow.Add(d) - t.timer = time.NewTimer(realDuration) - t.offset = offset - t.after = after - t.done = make(chan any) - go t.run() -} - -func (t *dilatedWallTimer) run() { - defer t.dc.offsetChangedMutex.RUnlock() - defer close(t.done) - var sendChan chan time.Time - var sendTime time.Time - for { - select { - case reset := <-t.resetChan: - realNow := time.Now() - dialatedNow := dilateTime(t.dc.epoch, realNow, t.dc.realSecondDuration, t.offset) - realDuration := time.Duration(float64(reset.d) * t.dc.realSecondDuration.Seconds()) - t.target = dialatedNow.Add(reset.d) - sendChan = nil - sendTime = time.Time{} - reset.r <- t.timer.Reset(realDuration) - case stop := <-t.stopChan: - stop <- t.timer.Stop() - return - case tt := <-t.timer.C: - if t.after != nil { - t.after() - return - } - if sendChan != nil { - panic("reset should have been called") - } - sendChan = t.c - sendTime = tt - case sendChan <- sendTime: - sendChan = nil - sendTime = time.Time{} - return - case <-t.dc.offsetChanged: - t.dc.offsetChangedCond.Wait() - newOffset := time.Duration(atomic.LoadInt64(&t.dc.offsetAtomic)) - if newOffset == t.offset { - continue - } - t.offset = newOffset - stopped := t.timer.Stop() - if !stopped { - continue - } - realNow := time.Now() - dialatedNow := dilateTime(t.dc.epoch, realNow, t.dc.realSecondDuration, t.offset) - dialatedDuration := t.target.Sub(dialatedNow) - if dialatedDuration <= 0 { - sendChan = t.c - sendTime = dialatedNow - continue - } - realDuration := time.Duration(float64(dialatedDuration) * t.dc.realSecondDuration.Seconds()) - t.timer.Reset(realDuration) - } - } -} - -// Chan implements Timer.Chan -func (t *dilatedWallTimer) Chan() <-chan time.Time { - return t.c -} - -// Chan implements Timer.Reset -func (t *dilatedWallTimer) Reset(d time.Duration) bool { - t.resetMutex.Lock() - defer t.resetMutex.Unlock() - reset := resetReq{ - d: d, - r: make(chan bool), - } - select { - case <-t.done: - t.start(d, nil) - return true - case t.resetChan <- reset: - return <-reset.r - } -} - -// Chan implements Timer.Stop -func (t *dilatedWallTimer) Stop() bool { - stop := make(chan bool) - select { - case <-t.done: - return false - case t.stopChan <- stop: - return <-stop - } -} - -func dilateTime(epoch, realNow time.Time, - realSecondDuration, dilatedOffset time.Duration) time.Time { - delta := realNow.Sub(epoch) - if delta < 0 { - delta = time.Duration(0) - } - return epoch.Add(dilatedOffset).Add(time.Duration(float64(delta) / realSecondDuration.Seconds())) -} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go b/test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go deleted file mode 100644 index 3d41472091..0000000000 --- a/test/integration/licenses/github.com/juju/clock/testclock/dilated_test.go +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright 2022 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package testclock_test - -import ( - "runtime" - "sync" - "time" - - "github.com/juju/testing" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/clock/testclock" -) - -const ( - halfSecond = 500 * time.Millisecond - doubleSecond = 2 * time.Second -) - -type dilatedClockSuite struct { - testing.LoggingSuite -} - -var _ = gc.Suite(&dilatedClockSuite{}) - -func (*dilatedClockSuite) TestSlowedAfter(c *gc.C) { - t0 := time.Now() - cl := testclock.NewDilatedWallClock(doubleSecond) - t1 := <-cl.After(time.Second) - c.Assert(t1.Sub(t0).Seconds(), jc.GreaterThan, 1.9) -} - -func (*dilatedClockSuite) TestFastAfter(c *gc.C) { - t0 := time.Now() - cl := testclock.NewDilatedWallClock(halfSecond) - t1 := <-cl.After(time.Second) - c.Assert(t1.Sub(t0).Milliseconds(), jc.LessThan, 600) -} - -func (*dilatedClockSuite) TestSlowedAfterFunc(c *gc.C) { - t0 := time.Now() - cl := testclock.NewDilatedWallClock(doubleSecond) - mut := sync.Mutex{} - mut.Lock() - cl.AfterFunc(time.Second, func() { - defer mut.Unlock() - c.Check(time.Since(t0).Seconds(), jc.GreaterThan, 1.9) - }) - mut.Lock() -} - -func (*dilatedClockSuite) TestFastAfterFunc(c *gc.C) { - t0 := time.Now() - cl := testclock.NewDilatedWallClock(halfSecond) - mut := sync.Mutex{} - mut.Lock() - cl.AfterFunc(time.Second, func() { - defer mut.Unlock() - c.Check(time.Since(t0).Milliseconds(), jc.LessThan, 600) - }) - mut.Lock() -} - -func (*dilatedClockSuite) TestSlowedNow(c *gc.C) { - t0 := time.Now() - cl := testclock.NewDilatedWallClock(doubleSecond) - <-time.After(time.Second) - t2 := cl.Now() - c.Assert(t2.Sub(t0).Milliseconds(), jc.GreaterThan, 400) - c.Assert(t2.Sub(t0).Milliseconds(), jc.LessThan, 600) - <-time.After(time.Second) - t3 := cl.Now() - c.Assert(t3.Sub(t0).Milliseconds(), jc.GreaterThan, 900) - c.Assert(t3.Sub(t0).Milliseconds(), jc.LessThan, 1100) -} - -func (*dilatedClockSuite) TestFastNow(c *gc.C) { - t0 := time.Now() - cl := testclock.NewDilatedWallClock(halfSecond) - <-time.After(time.Second) - t2 := cl.Now() - c.Assert(t2.Sub(t0).Milliseconds(), jc.GreaterThan, 1900) - c.Assert(t2.Sub(t0).Milliseconds(), jc.LessThan, 2100) - <-time.After(time.Second) - t3 := cl.Now() - c.Assert(t3.Sub(t0).Milliseconds(), jc.GreaterThan, 3900) - c.Assert(t3.Sub(t0).Milliseconds(), jc.LessThan, 4100) -} - -func (*dilatedClockSuite) TestAdvance(c *gc.C) { - t0 := time.Now() - cl := testclock.NewDilatedWallClock(halfSecond) - first := cl.After(time.Second) - cl.Advance(halfSecond) - <-time.After(250 * time.Millisecond) - select { - case t := <-first: - c.Assert(t.Sub(t0).Milliseconds(), jc.GreaterThan, 249) - case <-time.After(shortWait): - c.Fatal("timer failed to trigger early") - } -} - -func (*dilatedClockSuite) TestAdvanceMulti(c *gc.C) { - cl := testclock.NewDilatedWallClock(halfSecond) - first := cl.After(time.Second) - second := cl.After(2 * time.Second) - third := cl.After(1 * time.Hour) - - done := time.After(longWait) - fourth := cl.After(12*time.Hour + longWait*2 + time.Second) - - cl.Advance(12 * time.Hour) - - n := 0 -out: - for { - select { - case <-first: - n++ - case <-second: - n++ - case <-third: - n++ - case <-fourth: - c.Fatal("timer that fired that should not have") - case <-done: - break out - } - } - c.Assert(n, gc.Equals, 3) -} - -func (*dilatedClockSuite) TestStop(c *gc.C) { - numGo := runtime.NumGoroutine() - cl := testclock.NewDilatedWallClock(halfSecond) - a := cl.NewTimer(time.Second) - time.Sleep(shortWait) - ok := a.Stop() - c.Assert(ok, jc.IsTrue) - ok = a.Stop() - c.Assert(ok, jc.IsFalse) - select { - case <-a.Chan(): - c.Fatal("stopped clock fired") - case <-time.After(time.Second): - } - for i := 0; i < 3; i++ { - if runtime.NumGoroutine() == numGo { - break - } - time.Sleep(shortWait) - } - c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) -} - -func (*dilatedClockSuite) TestReset(c *gc.C) { - numGo := runtime.NumGoroutine() - cl := testclock.NewDilatedWallClock(halfSecond) - a := cl.NewTimer(time.Second) - time.Sleep(250 * time.Millisecond) - ok := a.Reset(time.Second) - c.Assert(ok, jc.IsTrue) - <-time.After(halfSecond) - select { - case <-a.Chan(): - case <-time.After(shortWait): - c.Fatal("timer did not fire") - } - for i := 0; i < 3; i++ { - if runtime.NumGoroutine() == numGo { - break - } - time.Sleep(shortWait) - } - c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) -} - -func (*dilatedClockSuite) TestStopReset(c *gc.C) { - numGo := runtime.NumGoroutine() - cl := testclock.NewDilatedWallClock(halfSecond) - a := cl.NewTimer(time.Second) - time.Sleep(250 * time.Millisecond) - ok := a.Stop() - c.Assert(ok, jc.IsTrue) - ok = a.Reset(time.Second) - c.Assert(ok, jc.IsTrue) - <-time.After(halfSecond) - select { - case <-a.Chan(): - case <-time.After(shortWait): - c.Fatal("timer did not fire") - } - for i := 0; i < 3; i++ { - if runtime.NumGoroutine() == numGo { - break - } - time.Sleep(shortWait) - } - c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) -} - -func (*dilatedClockSuite) TestAdvanceAlreadyFired(c *gc.C) { - numGo := runtime.NumGoroutine() - cl := testclock.NewDilatedWallClock(time.Second) - t := cl.NewTimer(time.Millisecond) - time.Sleep(shortWait) - cl.Advance(time.Second) - select { - case <-t.Chan(): - case <-time.After(shortWait): - c.Fatal("timer did not fire") - } - for i := 0; i < 3; i++ { - if runtime.NumGoroutine() == numGo { - break - } - time.Sleep(shortWait) - } - c.Assert(runtime.NumGoroutine(), gc.Equals, numGo, gc.Commentf("clock goroutine still running")) -} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/interfaces.go b/test/integration/licenses/github.com/juju/clock/testclock/interfaces.go deleted file mode 100644 index df329b6d49..0000000000 --- a/test/integration/licenses/github.com/juju/clock/testclock/interfaces.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package testclock - -import ( - "time" - - "github.com/juju/clock" -) - -// AdvanceableClock is a clock that can be advanced to trigger timers/trigger timers earlier -// than they would otherwise. -type AdvanceableClock interface { - clock.Clock - Advance(time.Duration) -} diff --git a/test/integration/licenses/github.com/juju/clock/testclock/package_test.go b/test/integration/licenses/github.com/juju/clock/testclock/package_test.go deleted file mode 100644 index 1ca04afd96..0000000000 --- a/test/integration/licenses/github.com/juju/clock/testclock/package_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package testclock_test - -import ( - gotesting "testing" - "time" - - gc "gopkg.in/check.v1" -) - -func TestAll(t *gotesting.T) { - gc.TestingT(t) -} - -const ( - shortWait = 50 * time.Millisecond - longWait = time.Second -) diff --git a/test/integration/licenses/github.com/juju/clock/wall.go b/test/integration/licenses/github.com/juju/clock/wall.go deleted file mode 100644 index 9bfc351855..0000000000 --- a/test/integration/licenses/github.com/juju/clock/wall.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2015 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package clock - -import ( - "time" -) - -// WallClock exposes wall-clock time via the Clock interface. -var WallClock wallClock - -// ensure that WallClock does actually implement the Clock interface. -var _ Clock = WallClock - -// WallClock exposes wall-clock time as returned by time.Now. -type wallClock struct{} - -// Now is part of the Clock interface. -func (wallClock) Now() time.Time { - return time.Now() -} - -// After implements Clock.After. -func (wallClock) After(d time.Duration) <-chan time.Time { - return time.After(d) -} - -// AfterFunc implements Clock.AfterFunc. -func (wallClock) AfterFunc(d time.Duration, f func()) Timer { - return wallTimer{time.AfterFunc(d, f)} -} - -// NewTimer implements Clock.NewTimer. -func (wallClock) NewTimer(d time.Duration) Timer { - return wallTimer{time.NewTimer(d)} -} - -// wallTimer implements the Timer interface. -type wallTimer struct { - *time.Timer -} - -// Chan implements Timer.Chan. -func (t wallTimer) Chan() <-chan time.Time { - return t.C -} diff --git a/test/integration/licenses/github.com/juju/errors/.gitignore b/test/integration/licenses/github.com/juju/errors/.gitignore deleted file mode 100644 index 836562412f..0000000000 --- a/test/integration/licenses/github.com/juju/errors/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test diff --git a/test/integration/licenses/github.com/juju/errors/LICENSE b/test/integration/licenses/github.com/juju/errors/LICENSE deleted file mode 100644 index ade9307b39..0000000000 --- a/test/integration/licenses/github.com/juju/errors/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -All files in this repository are licensed as follows. If you contribute -to this repository, it is assumed that you license your contribution -under the same license unless you state otherwise. - -All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/test/integration/licenses/github.com/juju/errors/Makefile b/test/integration/licenses/github.com/juju/errors/Makefile deleted file mode 100644 index a5bc81e66b..0000000000 --- a/test/integration/licenses/github.com/juju/errors/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -PROJECT := github.com/juju/errors - -.PHONY: check-licence check-go check docs - -check: check-licence check-go - go test $(PROJECT)/... - -check-licence: - @(fgrep -rl "Licensed under the LGPLv3" --exclude *.s .;\ - fgrep -rl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" --exclude *.s .;\ - find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ - xargs -I {} echo FAIL: licence missed: {} - -check-go: - $(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g"))) - @(if [ x$(GOFMT) != x"" ]; then \ - echo go fmt is sad: $(GOFMT); \ - exit 1; \ - fi ) - @(go vet -all -composites=false -copylocks=false .) - -docs: - godoc2md github.com/juju/errors > README.md - sed -i '5i[\[GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors)' README.md diff --git a/test/integration/licenses/github.com/juju/errors/README.md b/test/integration/licenses/github.com/juju/errors/README.md deleted file mode 100644 index 271aa78c79..0000000000 --- a/test/integration/licenses/github.com/juju/errors/README.md +++ /dev/null @@ -1,707 +0,0 @@ - -# errors - import "github.com/juju/errors" - -[![GoDoc](https://godoc.org/github.com/juju/errors?status.svg)](https://godoc.org/github.com/juju/errors) - -The juju/errors provides an easy way to annotate errors without losing the -original error context. - -The exported `New` and `Errorf` functions are designed to replace the -`errors.New` and `fmt.Errorf` functions respectively. The same underlying -error is there, but the package also records the location at which the error -was created. - -A primary use case for this library is to add extra context any time an -error is returned from a function. - - - if err := SomeFunc(); err != nil { - return err - } - -This instead becomes: - - - if err := SomeFunc(); err != nil { - return errors.Trace(err) - } - -which just records the file and line number of the Trace call, or - - - if err := SomeFunc(); err != nil { - return errors.Annotate(err, "more context") - } - -which also adds an annotation to the error. - -When you want to check to see if an error is of a particular type, a helper -function is normally exported by the package that returned the error, like the -`os` package does. The underlying cause of the error is available using the -`Cause` function. - - - os.IsNotExist(errors.Cause(err)) - -The result of the `Error()` call on an annotated error is the annotations joined -with colons, then the result of the `Error()` method for the underlying error -that was the cause. - - - err := errors.Errorf("original") - err = errors.Annotatef(err, "context") - err = errors.Annotatef(err, "more context") - err.Error() -> "more context: context: original" - -Obviously recording the file, line and functions is not very useful if you -cannot get them back out again. - - - errors.ErrorStack(err) - -will return something like: - - - first error - github.com/juju/errors/annotation_test.go:193: - github.com/juju/errors/annotation_test.go:194: annotation - github.com/juju/errors/annotation_test.go:195: - github.com/juju/errors/annotation_test.go:196: more context - github.com/juju/errors/annotation_test.go:197: - -The first error was generated by an external system, so there was no location -associated. The second, fourth, and last lines were generated with Trace calls, -and the other two through Annotate. - -Sometimes when responding to an error you want to return a more specific error -for the situation. - - - if err := FindField(field); err != nil { - return errors.Wrap(err, errors.NotFoundf(field)) - } - -This returns an error where the complete error stack is still available, and -`errors.Cause()` will return the `NotFound` error. - - - - - - -## func AlreadyExistsf -``` go -func AlreadyExistsf(format string, args ...interface{}) error -``` -AlreadyExistsf returns an error which satisfies IsAlreadyExists(). - - -## func Annotate -``` go -func Annotate(other error, message string) error -``` -Annotate is used to add extra context to an existing error. The location of -the Annotate call is recorded with the annotations. The file, line and -function are also recorded. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Annotate(err, "failed to frombulate") - } - - -## func Annotatef -``` go -func Annotatef(other error, format string, args ...interface{}) error -``` -Annotatef is used to add extra context to an existing error. The location of -the Annotate call is recorded with the annotations. The file, line and -function are also recorded. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Annotatef(err, "failed to frombulate the %s", arg) - } - - -## func BadRequestf -``` go -func BadRequestf(format string, args ...interface{}) error -``` -BadRequestf returns an error which satisfies IsBadRequest(). - - -## func Cause -``` go -func Cause(err error) error -``` -Cause returns the cause of the given error. This will be either the -original error, or the result of a Wrap or Mask call. - -Cause is the usual way to diagnose errors that may have been wrapped by -the other errors functions. - - -## func DeferredAnnotatef -``` go -func DeferredAnnotatef(err *error, format string, args ...interface{}) -``` -DeferredAnnotatef annotates the given error (when it is not nil) with the given -format string and arguments (like fmt.Sprintf). If *err is nil, DeferredAnnotatef -does nothing. This method is used in a defer statement in order to annotate any -resulting error with the same message. - -For example: - - - defer DeferredAnnotatef(&err, "failed to frombulate the %s", arg) - - -## func Details -``` go -func Details(err error) string -``` -Details returns information about the stack of errors wrapped by err, in -the format: - - - [{filename:99: error one} {otherfile:55: cause of error one}] - -This is a terse alternative to ErrorStack as it returns a single line. - - -## func ErrorStack -``` go -func ErrorStack(err error) string -``` -ErrorStack returns a string representation of the annotated error. If the -error passed as the parameter is not an annotated error, the result is -simply the result of the Error() method on that error. - -If the error is an annotated error, a multi-line string is returned where -each line represents one entry in the annotation stack. The full filename -from the call stack is used in the output. - - - first error - github.com/juju/errors/annotation_test.go:193: - github.com/juju/errors/annotation_test.go:194: annotation - github.com/juju/errors/annotation_test.go:195: - github.com/juju/errors/annotation_test.go:196: more context - github.com/juju/errors/annotation_test.go:197: - - -## func Errorf -``` go -func Errorf(format string, args ...interface{}) error -``` -Errorf creates a new annotated error and records the location that the -error is created. This should be a drop in replacement for fmt.Errorf. - -For example: - - - return errors.Errorf("validation failed: %s", message) - - -## func Forbiddenf -``` go -func Forbiddenf(format string, args ...interface{}) error -``` -Forbiddenf returns an error which satistifes IsForbidden() - - -## func IsAlreadyExists -``` go -func IsAlreadyExists(err error) bool -``` -IsAlreadyExists reports whether the error was created with -AlreadyExistsf() or NewAlreadyExists(). - - -## func IsBadRequest -``` go -func IsBadRequest(err error) bool -``` -IsBadRequest reports whether err was created with BadRequestf() or -NewBadRequest(). - - -## func IsForbidden -``` go -func IsForbidden(err error) bool -``` -IsForbidden reports whether err was created with Forbiddenf() or -NewForbidden(). - - -## func IsMethodNotAllowed -``` go -func IsMethodNotAllowed(err error) bool -``` -IsMethodNotAllowed reports whether err was created with MethodNotAllowedf() or -NewMethodNotAllowed(). - - -## func IsNotAssigned -``` go -func IsNotAssigned(err error) bool -``` -IsNotAssigned reports whether err was created with NotAssignedf() or -NewNotAssigned(). - - -## func IsNotFound -``` go -func IsNotFound(err error) bool -``` -IsNotFound reports whether err was created with NotFoundf() or -NewNotFound(). - - -## func IsNotImplemented -``` go -func IsNotImplemented(err error) bool -``` -IsNotImplemented reports whether err was created with -NotImplementedf() or NewNotImplemented(). - - -## func IsNotProvisioned -``` go -func IsNotProvisioned(err error) bool -``` -IsNotProvisioned reports whether err was created with NotProvisionedf() or -NewNotProvisioned(). - - -## func IsNotSupported -``` go -func IsNotSupported(err error) bool -``` -IsNotSupported reports whether the error was created with -NotSupportedf() or NewNotSupported(). - - -## func IsNotValid -``` go -func IsNotValid(err error) bool -``` -IsNotValid reports whether the error was created with NotValidf() or -NewNotValid(). - - -## func IsUnauthorized -``` go -func IsUnauthorized(err error) bool -``` -IsUnauthorized reports whether err was created with Unauthorizedf() or -NewUnauthorized(). - - -## func IsUserNotFound -``` go -func IsUserNotFound(err error) bool -``` -IsUserNotFound reports whether err was created with UserNotFoundf() or -NewUserNotFound(). - - -## func Mask -``` go -func Mask(other error) error -``` -Mask hides the underlying error type, and records the location of the masking. - - -## func Maskf -``` go -func Maskf(other error, format string, args ...interface{}) error -``` -Mask masks the given error with the given format string and arguments (like -fmt.Sprintf), returning a new error that maintains the error stack, but -hides the underlying error type. The error string still contains the full -annotations. If you want to hide the annotations, call Wrap. - - -## func MethodNotAllowedf -``` go -func MethodNotAllowedf(format string, args ...interface{}) error -``` -MethodNotAllowedf returns an error which satisfies IsMethodNotAllowed(). - - -## func New -``` go -func New(message string) error -``` -New is a drop in replacement for the standard library errors module that records -the location that the error is created. - -For example: - - - return errors.New("validation failed") - - -## func NewAlreadyExists -``` go -func NewAlreadyExists(err error, msg string) error -``` -NewAlreadyExists returns an error which wraps err and satisfies -IsAlreadyExists(). - - -## func NewBadRequest -``` go -func NewBadRequest(err error, msg string) error -``` -NewBadRequest returns an error which wraps err that satisfies -IsBadRequest(). - - -## func NewForbidden -``` go -func NewForbidden(err error, msg string) error -``` -NewForbidden returns an error which wraps err that satisfies -IsForbidden(). - - -## func NewMethodNotAllowed -``` go -func NewMethodNotAllowed(err error, msg string) error -``` -NewMethodNotAllowed returns an error which wraps err that satisfies -IsMethodNotAllowed(). - - -## func NewNotAssigned -``` go -func NewNotAssigned(err error, msg string) error -``` -NewNotAssigned returns an error which wraps err that satisfies -IsNotAssigned(). - - -## func NewNotFound -``` go -func NewNotFound(err error, msg string) error -``` -NewNotFound returns an error which wraps err that satisfies -IsNotFound(). - - -## func NewNotImplemented -``` go -func NewNotImplemented(err error, msg string) error -``` -NewNotImplemented returns an error which wraps err and satisfies -IsNotImplemented(). - - -## func NewNotProvisioned -``` go -func NewNotProvisioned(err error, msg string) error -``` -NewNotProvisioned returns an error which wraps err that satisfies -IsNotProvisioned(). - - -## func NewNotSupported -``` go -func NewNotSupported(err error, msg string) error -``` -NewNotSupported returns an error which wraps err and satisfies -IsNotSupported(). - - -## func NewNotValid -``` go -func NewNotValid(err error, msg string) error -``` -NewNotValid returns an error which wraps err and satisfies IsNotValid(). - - -## func NewUnauthorized -``` go -func NewUnauthorized(err error, msg string) error -``` -NewUnauthorized returns an error which wraps err and satisfies -IsUnauthorized(). - - -## func NewUserNotFound -``` go -func NewUserNotFound(err error, msg string) error -``` -NewUserNotFound returns an error which wraps err and satisfies -IsUserNotFound(). - - -## func NotAssignedf -``` go -func NotAssignedf(format string, args ...interface{}) error -``` -NotAssignedf returns an error which satisfies IsNotAssigned(). - - -## func NotFoundf -``` go -func NotFoundf(format string, args ...interface{}) error -``` -NotFoundf returns an error which satisfies IsNotFound(). - - -## func NotImplementedf -``` go -func NotImplementedf(format string, args ...interface{}) error -``` -NotImplementedf returns an error which satisfies IsNotImplemented(). - - -## func NotProvisionedf -``` go -func NotProvisionedf(format string, args ...interface{}) error -``` -NotProvisionedf returns an error which satisfies IsNotProvisioned(). - - -## func NotSupportedf -``` go -func NotSupportedf(format string, args ...interface{}) error -``` -NotSupportedf returns an error which satisfies IsNotSupported(). - - -## func NotValidf -``` go -func NotValidf(format string, args ...interface{}) error -``` -NotValidf returns an error which satisfies IsNotValid(). - - -## func Trace -``` go -func Trace(other error) error -``` -Trace adds the location of the Trace call to the stack. The Cause of the -resulting error is the same as the error parameter. If the other error is -nil, the result will be nil. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Trace(err) - } - - -## func Unauthorizedf -``` go -func Unauthorizedf(format string, args ...interface{}) error -``` -Unauthorizedf returns an error which satisfies IsUnauthorized(). - - -## func UserNotFoundf -``` go -func UserNotFoundf(format string, args ...interface{}) error -``` -UserNotFoundf returns an error which satisfies IsUserNotFound(). - - -## func Wrap -``` go -func Wrap(other, newDescriptive error) error -``` -Wrap changes the Cause of the error. The location of the Wrap call is also -stored in the error stack. - -For example: - - - if err := SomeFunc(); err != nil { - newErr := &packageError{"more context", private_value} - return errors.Wrap(err, newErr) - } - - -## func Wrapf -``` go -func Wrapf(other, newDescriptive error, format string, args ...interface{}) error -``` -Wrapf changes the Cause of the error, and adds an annotation. The location -of the Wrap call is also stored in the error stack. - -For example: - - - if err := SomeFunc(); err != nil { - return errors.Wrapf(err, simpleErrorType, "invalid value %q", value) - } - - - -## type Err -``` go -type Err struct { - // contains filtered or unexported fields -} -``` -Err holds a description of an error along with information about -where the error was created. - -It may be embedded in custom error types to add extra information that -this errors package can understand. - - - - - - - - - -### func NewErr -``` go -func NewErr(format string, args ...interface{}) Err -``` -NewErr is used to return an Err for the purpose of embedding in other -structures. The location is not specified, and needs to be set with a call -to SetLocation. - -For example: - - - type FooError struct { - errors.Err - code int - } - - func NewFooError(code int) error { - err := &FooError{errors.NewErr("foo"), code} - err.SetLocation(1) - return err - } - - -### func NewErrWithCause -``` go -func NewErrWithCause(other error, format string, args ...interface{}) Err -``` -NewErrWithCause is used to return an Err with cause by other error for the purpose of embedding in other -structures. The location is not specified, and needs to be set with a call -to SetLocation. - -For example: - - - type FooError struct { - errors.Err - code int - } - - func (e *FooError) Annotate(format string, args ...interface{}) error { - err := &FooError{errors.NewErrWithCause(e.Err, format, args...), e.code} - err.SetLocation(1) - return err - }) - - - - -### func (\*Err) Cause -``` go -func (e *Err) Cause() error -``` -The Cause of an error is the most recent error in the error stack that -meets one of these criteria: the original error that was raised; the new -error that was passed into the Wrap function; the most recently masked -error; or nil if the error itself is considered the Cause. Normally this -method is not invoked directly, but instead through the Cause stand alone -function. - - - -### func (\*Err) Error -``` go -func (e *Err) Error() string -``` -Error implements error.Error. - - - -### func (\*Err) Format -``` go -func (e *Err) Format(s fmt.State, verb rune) -``` -Format implements fmt.Formatter -When printing errors with %+v it also prints the stack trace. -%#v unsurprisingly will print the real underlying type. - - - -### func (\*Err) Location -``` go -func (e *Err) Location() (filename string, line int) -``` -Location is the file and line of where the error was most recently -created or annotated. - - - -### func (\*Err) Message -``` go -func (e *Err) Message() string -``` -Message returns the message stored with the most recent location. This is -the empty string if the most recent call was Trace, or the message stored -with Annotate or Mask. - - - -### func (\*Err) SetLocation -``` go -func (e *Err) SetLocation(callDepth int) -``` -SetLocation records the source location of the error at callDepth stack -frames above the call. - - - -### func (\*Err) StackTrace -``` go -func (e *Err) StackTrace() []string -``` -StackTrace returns one string for each location recorded in the stack of -errors. The first value is the originating error, with a line for each -other annotation or tracing of the error. - - - -### func (\*Err) Underlying -``` go -func (e *Err) Underlying() error -``` -Underlying returns the previous error in the error stack, if any. A client -should not ever really call this method. It is used to build the error -stack and should not be introspected by client calls. Or more -specifically, clients should not depend on anything but the `Cause` of an -error. - - - - - - - - - -- - - -Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) diff --git a/test/integration/licenses/github.com/juju/errors/dependencies.tsv b/test/integration/licenses/github.com/juju/errors/dependencies.tsv deleted file mode 100644 index e324344944..0000000000 --- a/test/integration/licenses/github.com/juju/errors/dependencies.tsv +++ /dev/null @@ -1,5 +0,0 @@ -github.com/juju/loggo git 8232ab8918d91c72af1a9fb94d3edbe31d88b790 2017-06-05T01:46:07Z -github.com/juju/testing git 72703b1e95eb8ce4737fd8a3d8496c6b0be280a6 2018-05-17T13:41:05Z -gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z -gopkg.in/mgo.v2 git f2b6f6c918c452ad107eec89615f074e3bd80e33 2016-08-18T01:52:18Z -gopkg.in/yaml.v2 git 1be3d31502d6eabc0dd7ce5b0daab022e14a5538 2017-07-12T05:45:46Z diff --git a/test/integration/licenses/github.com/juju/errors/doc.go b/test/integration/licenses/github.com/juju/errors/doc.go deleted file mode 100644 index d4403662aa..0000000000 --- a/test/integration/licenses/github.com/juju/errors/doc.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2013, 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -/* -Package errors provides an easy way to annotate errors without losing the -original error context. - -The exported `New` and `Errorf` functions are designed to replace the -`errors.New` and `fmt.Errorf` functions respectively. The same underlying -error is there, but the package also records the location at which the error -was created. - -A primary use case for this library is to add extra context any time an -error is returned from a function. - - if err := SomeFunc(); err != nil { - return err - } - -This instead becomes: - - if err := SomeFunc(); err != nil { - return errors.Trace(err) - } - -which just records the file and line number of the Trace call, or - - if err := SomeFunc(); err != nil { - return errors.Annotate(err, "more context") - } - -which also adds an annotation to the error. - -When you want to check to see if an error is of a particular type, a helper -function is normally exported by the package that returned the error, like the -`os` package does. The underlying cause of the error is available using the -`Cause` function. - - os.IsNotExist(errors.Cause(err)) - -The result of the `Error()` call on an annotated error is the annotations joined -with colons, then the result of the `Error()` method for the underlying error -that was the cause. - - err := errors.Errorf("original") - err = errors.Annotatef(err, "context") - err = errors.Annotatef(err, "more context") - err.Error() -> "more context: context: original" - -Obviously recording the file, line and functions is not very useful if you -cannot get them back out again. - - errors.ErrorStack(err) - -will return something like: - - first error - github.com/juju/errors/annotation_test.go:193: - github.com/juju/errors/annotation_test.go:194: annotation - github.com/juju/errors/annotation_test.go:195: - github.com/juju/errors/annotation_test.go:196: more context - github.com/juju/errors/annotation_test.go:197: - -The first error was generated by an external system, so there was no location -associated. The second, fourth, and last lines were generated with Trace calls, -and the other two through Annotate. - -Sometimes when responding to an error you want to return a more specific error -for the situation. - - if err := FindField(field); err != nil { - return errors.Wrap(err, errors.NotFoundf(field)) - } - -This returns an error where the complete error stack is still available, and -`errors.Cause()` will return the `NotFound` error. - -*/ -package errors diff --git a/test/integration/licenses/github.com/juju/errors/error.go b/test/integration/licenses/github.com/juju/errors/error.go deleted file mode 100644 index 2796b9f29b..0000000000 --- a/test/integration/licenses/github.com/juju/errors/error.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors - -import ( - "fmt" - "reflect" - "runtime" -) - -// Err holds a description of an error along with information about -// where the error was created. -// -// It may be embedded in custom error types to add extra information that -// this errors package can understand. -type Err struct { - // message holds an annotation of the error. - message string - - // cause holds the cause of the error as returned - // by the Cause method. - cause error - - // previous holds the previous error in the error stack, if any. - previous error - - // file and line hold the source code location where the error was - // created. - file string - line int -} - -// NewErr is used to return an Err for the purpose of embedding in other -// structures. The location is not specified, and needs to be set with a call -// to SetLocation. -// -// For example: -// type FooError struct { -// errors.Err -// code int -// } -// -// func NewFooError(code int) error { -// err := &FooError{errors.NewErr("foo"), code} -// err.SetLocation(1) -// return err -// } -func NewErr(format string, args ...interface{}) Err { - return Err{ - message: fmt.Sprintf(format, args...), - } -} - -// NewErrWithCause is used to return an Err with cause by other error for the purpose of embedding in other -// structures. The location is not specified, and needs to be set with a call -// to SetLocation. -// -// For example: -// type FooError struct { -// errors.Err -// code int -// } -// -// func (e *FooError) Annotate(format string, args ...interface{}) error { -// err := &FooError{errors.NewErrWithCause(e.Err, format, args...), e.code} -// err.SetLocation(1) -// return err -// }) -func NewErrWithCause(other error, format string, args ...interface{}) Err { - return Err{ - message: fmt.Sprintf(format, args...), - cause: Cause(other), - previous: other, - } -} - -// Location is the file and line of where the error was most recently -// created or annotated. -func (e *Err) Location() (filename string, line int) { - return e.file, e.line -} - -// Underlying returns the previous error in the error stack, if any. A client -// should not ever really call this method. It is used to build the error -// stack and should not be introspected by client calls. Or more -// specifically, clients should not depend on anything but the `Cause` of an -// error. -func (e *Err) Underlying() error { - return e.previous -} - -// Cause returns the most recent error in the error stack that -// meets one of these criteria: the original error that was raised; the new -// error that was passed into the Wrap function; the most recently masked -// error; or nil if the error itself is considered the Cause. Normally this -// method is not invoked directly, but instead through the Cause stand alone -// function. -func (e *Err) Cause() error { - return e.cause -} - -// Message returns the message stored with the most recent location. This is -// the empty string if the most recent call was Trace, or the message stored -// with Annotate or Mask. -func (e *Err) Message() string { - return e.message -} - -// Error implements error.Error. -func (e *Err) Error() string { - // We want to walk up the stack of errors showing the annotations - // as long as the cause is the same. - err := e.previous - if !sameError(Cause(err), e.cause) && e.cause != nil { - err = e.cause - } - switch { - case err == nil: - return e.message - case e.message == "": - return err.Error() - } - return fmt.Sprintf("%s: %v", e.message, err) -} - -// Format implements fmt.Formatter -// When printing errors with %+v it also prints the stack trace. -// %#v unsurprisingly will print the real underlying type. -func (e *Err) Format(s fmt.State, verb rune) { - switch verb { - case 'v': - switch { - case s.Flag('+'): - fmt.Fprintf(s, "%s", ErrorStack(e)) - return - case s.Flag('#'): - // avoid infinite recursion by wrapping e into a type - // that doesn't implement Formatter. - fmt.Fprintf(s, "%#v", (*unformatter)(e)) - return - } - fallthrough - case 's': - fmt.Fprintf(s, "%s", e.Error()) - case 'q': - fmt.Fprintf(s, "%q", e.Error()) - default: - fmt.Fprintf(s, "%%!%c(%T=%s)", verb, e, e.Error()) - } -} - -// helper for Format -type unformatter Err - -func (unformatter) Format() { /* break the fmt.Formatter interface */ } - -// SetLocation records the source location of the error at callDepth stack -// frames above the call. -func (e *Err) SetLocation(callDepth int) { - _, file, line, _ := runtime.Caller(callDepth + 1) - e.file = trimSourcePath(file) - e.line = line -} - -// StackTrace returns one string for each location recorded in the stack of -// errors. The first value is the originating error, with a line for each -// other annotation or tracing of the error. -func (e *Err) StackTrace() []string { - return errorStack(e) -} - -// Ideally we'd have a way to check identity, but deep equals will do. -func sameError(e1, e2 error) bool { - return reflect.DeepEqual(e1, e2) -} diff --git a/test/integration/licenses/github.com/juju/errors/error_test.go b/test/integration/licenses/github.com/juju/errors/error_test.go deleted file mode 100644 index ba9b71878e..0000000000 --- a/test/integration/licenses/github.com/juju/errors/error_test.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors_test - -import ( - "fmt" - "runtime" - - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/errors" -) - -type errorsSuite struct{} - -var _ = gc.Suite(&errorsSuite{}) - -var someErr = errors.New("some error") //err varSomeErr - -func (*errorsSuite) TestErrorString(c *gc.C) { - for i, test := range []struct { - message string - generator func() error - expected string - }{ - { - message: "uncomparable errors", - generator: func() error { - err := errors.Annotatef(newNonComparableError("uncomparable"), "annotation") - return errors.Annotatef(err, "another") - }, - expected: "another: annotation: uncomparable", - }, { - message: "Errorf", - generator: func() error { - return errors.Errorf("first error") - }, - expected: "first error", - }, { - message: "annotated error", - generator: func() error { - err := errors.Errorf("first error") - return errors.Annotatef(err, "annotation") - }, - expected: "annotation: first error", - }, { - message: "test annotation format", - generator: func() error { - err := errors.Errorf("first %s", "error") - return errors.Annotatef(err, "%s", "annotation") - }, - expected: "annotation: first error", - }, { - message: "wrapped error", - generator: func() error { - err := newError("first error") - return errors.Wrap(err, newError("detailed error")) - }, - expected: "detailed error", - }, { - message: "wrapped annotated error", - generator: func() error { - err := errors.Errorf("first error") - err = errors.Annotatef(err, "annotated") - return errors.Wrap(err, fmt.Errorf("detailed error")) - }, - expected: "detailed error", - }, { - message: "annotated wrapped error", - generator: func() error { - err := errors.Errorf("first error") - err = errors.Wrap(err, fmt.Errorf("detailed error")) - return errors.Annotatef(err, "annotated") - }, - expected: "annotated: detailed error", - }, { - message: "traced, and annotated", - generator: func() error { - err := errors.New("first error") - err = errors.Trace(err) - err = errors.Annotate(err, "some context") - err = errors.Trace(err) - err = errors.Annotate(err, "more context") - return errors.Trace(err) - }, - expected: "more context: some context: first error", - }, { - message: "traced, and annotated, masked and annotated", - generator: func() error { - err := errors.New("first error") - err = errors.Trace(err) - err = errors.Annotate(err, "some context") - err = errors.Maskf(err, "masked") - err = errors.Annotate(err, "more context") - return errors.Trace(err) - }, - expected: "more context: masked: some context: first error", - }, - } { - c.Logf("%v: %s", i, test.message) - err := test.generator() - ok := c.Check(err.Error(), gc.Equals, test.expected) - if !ok { - c.Logf("%#v", test.generator()) - } - } -} - -type embed struct { - errors.Err -} - -func newEmbed(format string, args ...interface{}) *embed { - err := &embed{errors.NewErr(format, args...)} - err.SetLocation(1) - return err -} - -func (*errorsSuite) TestNewErr(c *gc.C) { - if runtime.Compiler == "gccgo" { - c.Skip("gccgo can't determine the location") - } - err := newEmbed("testing %d", 42) //err embedErr - c.Assert(err.Error(), gc.Equals, "testing 42") - c.Assert(errors.Cause(err), gc.Equals, err) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["embedErr"].String()) -} - -func newEmbedWithCause(other error, format string, args ...interface{}) *embed { - err := &embed{errors.NewErrWithCause(other, format, args...)} - err.SetLocation(1) - return err -} - -func (*errorsSuite) TestNewErrWithCause(c *gc.C) { - if runtime.Compiler == "gccgo" { - c.Skip("gccgo can't determine the location") - } - causeErr := fmt.Errorf("external error") - err := newEmbedWithCause(causeErr, "testing %d", 43) //err embedCause - c.Assert(err.Error(), gc.Equals, "testing 43: external error") - c.Assert(errors.Cause(err), gc.Equals, causeErr) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["embedCause"].String()) -} - -var _ error = (*embed)(nil) - -// This is an uncomparable error type, as it is a struct that supports the -// error interface (as opposed to a pointer type). -type error_ struct { - info string - slice []string -} - -// Create a non-comparable error -func newNonComparableError(message string) error { - return error_{info: message} -} - -func (e error_) Error() string { - return e.info -} - -func newError(message string) error { - return testError{message} -} - -// The testError is a value type error for ease of seeing results -// when the test fails. -type testError struct { - message string -} - -func (e testError) Error() string { - return e.message -} diff --git a/test/integration/licenses/github.com/juju/errors/errortypes.go b/test/integration/licenses/github.com/juju/errors/errortypes.go deleted file mode 100644 index 8647c7ae39..0000000000 --- a/test/integration/licenses/github.com/juju/errors/errortypes.go +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors - -import ( - "fmt" -) - -// wrap is a helper to construct an *wrapper. -func wrap(err error, format, suffix string, args ...interface{}) Err { - newErr := Err{ - message: fmt.Sprintf(format+suffix, args...), - previous: err, - } - newErr.SetLocation(2) - return newErr -} - -// timeout represents an error on timeout. -type timeout struct { - Err -} - -// Timeoutf returns an error which satisfies IsTimeout(). -func Timeoutf(format string, args ...interface{}) error { - return &timeout{wrap(nil, format, " timeout", args...)} -} - -// NewTimeout returns an error which wraps err that satisfies -// IsTimeout(). -func NewTimeout(err error, msg string) error { - return &timeout{wrap(err, msg, "")} -} - -// IsTimeout reports whether err was created with Timeoutf() or -// NewTimeout(). -func IsTimeout(err error) bool { - err = Cause(err) - _, ok := err.(*timeout) - return ok -} - -// notFound represents an error when something has not been found. -type notFound struct { - Err -} - -// NotFoundf returns an error which satisfies IsNotFound(). -func NotFoundf(format string, args ...interface{}) error { - return ¬Found{wrap(nil, format, " not found", args...)} -} - -// NewNotFound returns an error which wraps err that satisfies -// IsNotFound(). -func NewNotFound(err error, msg string) error { - return ¬Found{wrap(err, msg, "")} -} - -// IsNotFound reports whether err was created with NotFoundf() or -// NewNotFound(). -func IsNotFound(err error) bool { - err = Cause(err) - _, ok := err.(*notFound) - return ok -} - -// userNotFound represents an error when an inexistent user is looked up. -type userNotFound struct { - Err -} - -// UserNotFoundf returns an error which satisfies IsUserNotFound(). -func UserNotFoundf(format string, args ...interface{}) error { - return &userNotFound{wrap(nil, format, " user not found", args...)} -} - -// NewUserNotFound returns an error which wraps err and satisfies -// IsUserNotFound(). -func NewUserNotFound(err error, msg string) error { - return &userNotFound{wrap(err, msg, "")} -} - -// IsUserNotFound reports whether err was created with UserNotFoundf() or -// NewUserNotFound(). -func IsUserNotFound(err error) bool { - err = Cause(err) - _, ok := err.(*userNotFound) - return ok -} - -// unauthorized represents an error when an operation is unauthorized. -type unauthorized struct { - Err -} - -// Unauthorizedf returns an error which satisfies IsUnauthorized(). -func Unauthorizedf(format string, args ...interface{}) error { - return &unauthorized{wrap(nil, format, "", args...)} -} - -// NewUnauthorized returns an error which wraps err and satisfies -// IsUnauthorized(). -func NewUnauthorized(err error, msg string) error { - return &unauthorized{wrap(err, msg, "")} -} - -// IsUnauthorized reports whether err was created with Unauthorizedf() or -// NewUnauthorized(). -func IsUnauthorized(err error) bool { - err = Cause(err) - _, ok := err.(*unauthorized) - return ok -} - -// notImplemented represents an error when something is not -// implemented. -type notImplemented struct { - Err -} - -// NotImplementedf returns an error which satisfies IsNotImplemented(). -func NotImplementedf(format string, args ...interface{}) error { - return ¬Implemented{wrap(nil, format, " not implemented", args...)} -} - -// NewNotImplemented returns an error which wraps err and satisfies -// IsNotImplemented(). -func NewNotImplemented(err error, msg string) error { - return ¬Implemented{wrap(err, msg, "")} -} - -// IsNotImplemented reports whether err was created with -// NotImplementedf() or NewNotImplemented(). -func IsNotImplemented(err error) bool { - err = Cause(err) - _, ok := err.(*notImplemented) - return ok -} - -// alreadyExists represents and error when something already exists. -type alreadyExists struct { - Err -} - -// AlreadyExistsf returns an error which satisfies IsAlreadyExists(). -func AlreadyExistsf(format string, args ...interface{}) error { - return &alreadyExists{wrap(nil, format, " already exists", args...)} -} - -// NewAlreadyExists returns an error which wraps err and satisfies -// IsAlreadyExists(). -func NewAlreadyExists(err error, msg string) error { - return &alreadyExists{wrap(err, msg, "")} -} - -// IsAlreadyExists reports whether the error was created with -// AlreadyExistsf() or NewAlreadyExists(). -func IsAlreadyExists(err error) bool { - err = Cause(err) - _, ok := err.(*alreadyExists) - return ok -} - -// notSupported represents an error when something is not supported. -type notSupported struct { - Err -} - -// NotSupportedf returns an error which satisfies IsNotSupported(). -func NotSupportedf(format string, args ...interface{}) error { - return ¬Supported{wrap(nil, format, " not supported", args...)} -} - -// NewNotSupported returns an error which wraps err and satisfies -// IsNotSupported(). -func NewNotSupported(err error, msg string) error { - return ¬Supported{wrap(err, msg, "")} -} - -// IsNotSupported reports whether the error was created with -// NotSupportedf() or NewNotSupported(). -func IsNotSupported(err error) bool { - err = Cause(err) - _, ok := err.(*notSupported) - return ok -} - -// notValid represents an error when something is not valid. -type notValid struct { - Err -} - -// NotValidf returns an error which satisfies IsNotValid(). -func NotValidf(format string, args ...interface{}) error { - return ¬Valid{wrap(nil, format, " not valid", args...)} -} - -// NewNotValid returns an error which wraps err and satisfies IsNotValid(). -func NewNotValid(err error, msg string) error { - return ¬Valid{wrap(err, msg, "")} -} - -// IsNotValid reports whether the error was created with NotValidf() or -// NewNotValid(). -func IsNotValid(err error) bool { - err = Cause(err) - _, ok := err.(*notValid) - return ok -} - -// notProvisioned represents an error when something is not yet provisioned. -type notProvisioned struct { - Err -} - -// NotProvisionedf returns an error which satisfies IsNotProvisioned(). -func NotProvisionedf(format string, args ...interface{}) error { - return ¬Provisioned{wrap(nil, format, " not provisioned", args...)} -} - -// NewNotProvisioned returns an error which wraps err that satisfies -// IsNotProvisioned(). -func NewNotProvisioned(err error, msg string) error { - return ¬Provisioned{wrap(err, msg, "")} -} - -// IsNotProvisioned reports whether err was created with NotProvisionedf() or -// NewNotProvisioned(). -func IsNotProvisioned(err error) bool { - err = Cause(err) - _, ok := err.(*notProvisioned) - return ok -} - -// notAssigned represents an error when something is not yet assigned to -// something else. -type notAssigned struct { - Err -} - -// NotAssignedf returns an error which satisfies IsNotAssigned(). -func NotAssignedf(format string, args ...interface{}) error { - return ¬Assigned{wrap(nil, format, " not assigned", args...)} -} - -// NewNotAssigned returns an error which wraps err that satisfies -// IsNotAssigned(). -func NewNotAssigned(err error, msg string) error { - return ¬Assigned{wrap(err, msg, "")} -} - -// IsNotAssigned reports whether err was created with NotAssignedf() or -// NewNotAssigned(). -func IsNotAssigned(err error) bool { - err = Cause(err) - _, ok := err.(*notAssigned) - return ok -} - -// badRequest represents an error when a request has bad parameters. -type badRequest struct { - Err -} - -// BadRequestf returns an error which satisfies IsBadRequest(). -func BadRequestf(format string, args ...interface{}) error { - return &badRequest{wrap(nil, format, "", args...)} -} - -// NewBadRequest returns an error which wraps err that satisfies -// IsBadRequest(). -func NewBadRequest(err error, msg string) error { - return &badRequest{wrap(err, msg, "")} -} - -// IsBadRequest reports whether err was created with BadRequestf() or -// NewBadRequest(). -func IsBadRequest(err error) bool { - err = Cause(err) - _, ok := err.(*badRequest) - return ok -} - -// methodNotAllowed represents an error when an HTTP request -// is made with an inappropriate method. -type methodNotAllowed struct { - Err -} - -// MethodNotAllowedf returns an error which satisfies IsMethodNotAllowed(). -func MethodNotAllowedf(format string, args ...interface{}) error { - return &methodNotAllowed{wrap(nil, format, "", args...)} -} - -// NewMethodNotAllowed returns an error which wraps err that satisfies -// IsMethodNotAllowed(). -func NewMethodNotAllowed(err error, msg string) error { - return &methodNotAllowed{wrap(err, msg, "")} -} - -// IsMethodNotAllowed reports whether err was created with MethodNotAllowedf() or -// NewMethodNotAllowed(). -func IsMethodNotAllowed(err error) bool { - err = Cause(err) - _, ok := err.(*methodNotAllowed) - return ok -} - -// forbidden represents an error when a request cannot be completed because of -// missing privileges -type forbidden struct { - Err -} - -// Forbiddenf returns an error which satistifes IsForbidden() -func Forbiddenf(format string, args ...interface{}) error { - return &forbidden{wrap(nil, format, "", args...)} -} - -// NewForbidden returns an error which wraps err that satisfies -// IsForbidden(). -func NewForbidden(err error, msg string) error { - return &forbidden{wrap(err, msg, "")} -} - -// IsForbidden reports whether err was created with Forbiddenf() or -// NewForbidden(). -func IsForbidden(err error) bool { - err = Cause(err) - _, ok := err.(*forbidden) - return ok -} - -// quotaLimitExceeded is emitted when an action failed due to a quota limit check. -type quotaLimitExceeded struct { - Err -} - -// QuotaLimitExceededf returns an error which satisfies IsQuotaLimitExceeded. -func QuotaLimitExceededf(format string, args ...interface{}) error { - return "aLimitExceeded{wrap(nil, format, "", args...)} -} - -// NewQuotaLimitExceeded returns an error which wraps err and satisfies -// IsQuotaLimitExceeded. -func NewQuotaLimitExceeded(err error, msg string) error { - return "aLimitExceeded{wrap(err, msg, "")} -} - -// IsQuotaLimitExceeded returns true if the given error represents a -// QuotaLimitExceeded error. -func IsQuotaLimitExceeded(err error) bool { - err = Cause(err) - _, ok := err.(*quotaLimitExceeded) - return ok -} - -// notYetAvailable is the error returned when a resource is not yet available -// but it might be in the future. -type notYetAvailable struct { - Err -} - -// IsNotYetAvailable reports err was created with NotYetAvailableF or -// NewNotYetAvailable. -func IsNotYetAvailable(err error) bool { - err = Cause(err) - _, ok := err.(*notYetAvailable) - return ok -} - -// NotYetAvailablef returns an error which satisfies IsNotYetAvailable. -func NotYetAvailablef(format string, args ...interface{}) error { - return ¬YetAvailable{wrap(nil, format, "", args...)} -} - -// NewNotYetAvailable returns an error which wraps err and satisfies -// IsNotYetAvailable. -func NewNotYetAvailable(err error, msg string) error { - return ¬YetAvailable{wrap(err, msg, "")} -} diff --git a/test/integration/licenses/github.com/juju/errors/errortypes_test.go b/test/integration/licenses/github.com/juju/errors/errortypes_test.go deleted file mode 100644 index 4a652a8f96..0000000000 --- a/test/integration/licenses/github.com/juju/errors/errortypes_test.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2013, 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors_test - -import ( - stderrors "errors" - "fmt" - "reflect" - "runtime" - - "github.com/juju/errors" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" -) - -// errorInfo holds information about a single error type: a satisfier -// function, wrapping and variable arguments constructors and message -// suffix. -type errorInfo struct { - satisfier func(error) bool - argsConstructor func(string, ...interface{}) error - wrapConstructor func(error, string) error - suffix string -} - -// allErrors holds information for all defined errors. When adding new -// errors, add them here as well to include them in tests. -var allErrors = []*errorInfo{ - {errors.IsTimeout, errors.Timeoutf, errors.NewTimeout, " timeout"}, - {errors.IsNotFound, errors.NotFoundf, errors.NewNotFound, " not found"}, - {errors.IsUserNotFound, errors.UserNotFoundf, errors.NewUserNotFound, " user not found"}, - {errors.IsUnauthorized, errors.Unauthorizedf, errors.NewUnauthorized, ""}, - {errors.IsNotImplemented, errors.NotImplementedf, errors.NewNotImplemented, " not implemented"}, - {errors.IsAlreadyExists, errors.AlreadyExistsf, errors.NewAlreadyExists, " already exists"}, - {errors.IsNotSupported, errors.NotSupportedf, errors.NewNotSupported, " not supported"}, - {errors.IsNotValid, errors.NotValidf, errors.NewNotValid, " not valid"}, - {errors.IsNotProvisioned, errors.NotProvisionedf, errors.NewNotProvisioned, " not provisioned"}, - {errors.IsNotAssigned, errors.NotAssignedf, errors.NewNotAssigned, " not assigned"}, - {errors.IsMethodNotAllowed, errors.MethodNotAllowedf, errors.NewMethodNotAllowed, ""}, - {errors.IsBadRequest, errors.BadRequestf, errors.NewBadRequest, ""}, - {errors.IsForbidden, errors.Forbiddenf, errors.NewForbidden, ""}, - {errors.IsQuotaLimitExceeded, errors.QuotaLimitExceededf, errors.NewQuotaLimitExceeded, ""}, - {errors.IsNotYetAvailable, errors.NotYetAvailablef, errors.NewNotYetAvailable, ""}, -} - -type errorTypeSuite struct{} - -var _ = gc.Suite(&errorTypeSuite{}) - -func (t *errorInfo) satisfierName() string { - value := reflect.ValueOf(t.satisfier) - f := runtime.FuncForPC(value.Pointer()) - return f.Name() -} - -func (t *errorInfo) equal(t0 *errorInfo) bool { - if t0 == nil { - return false - } - return t.satisfierName() == t0.satisfierName() -} - -type errorTest struct { - err error - message string - errInfo *errorInfo -} - -func deferredAnnotatef(err error, format string, args ...interface{}) error { - errors.DeferredAnnotatef(&err, format, args...) - return err -} - -func mustSatisfy(c *gc.C, err error, errInfo *errorInfo) { - if errInfo != nil { - msg := fmt.Sprintf("%#v must satisfy %v", err, errInfo.satisfierName()) - c.Check(err, jc.Satisfies, errInfo.satisfier, gc.Commentf(msg)) - } -} - -func mustNotSatisfy(c *gc.C, err error, errInfo *errorInfo) { - if errInfo != nil { - msg := fmt.Sprintf("%#v must not satisfy %v", err, errInfo.satisfierName()) - c.Check(err, gc.Not(jc.Satisfies), errInfo.satisfier, gc.Commentf(msg)) - } -} - -func checkErrorMatches(c *gc.C, err error, message string, errInfo *errorInfo) { - if message == "" { - c.Check(err, gc.IsNil) - c.Check(errInfo, gc.IsNil) - } else { - c.Check(err, gc.ErrorMatches, message) - } -} - -func runErrorTests(c *gc.C, errorTests []errorTest, checkMustSatisfy bool) { - for i, t := range errorTests { - c.Logf("test %d: %T: %v", i, t.err, t.err) - checkErrorMatches(c, t.err, t.message, t.errInfo) - if checkMustSatisfy { - mustSatisfy(c, t.err, t.errInfo) - } - - // Check all other satisfiers to make sure none match. - for _, otherErrInfo := range allErrors { - if checkMustSatisfy && otherErrInfo.equal(t.errInfo) { - continue - } - mustNotSatisfy(c, t.err, otherErrInfo) - } - } -} - -func (*errorTypeSuite) TestDeferredAnnotatef(c *gc.C) { - // Ensure DeferredAnnotatef annotates the errors. - errorTests := []errorTest{} - for _, errInfo := range allErrors { - errorTests = append(errorTests, []errorTest{{ - deferredAnnotatef(nil, "comment"), - "", - nil, - }, { - deferredAnnotatef(stderrors.New("blast"), "comment"), - "comment: blast", - nil, - }, { - deferredAnnotatef(errInfo.argsConstructor("foo %d", 42), "comment %d", 69), - "comment 69: foo 42" + errInfo.suffix, - errInfo, - }, { - deferredAnnotatef(errInfo.argsConstructor(""), "comment"), - "comment: " + errInfo.suffix, - errInfo, - }, { - deferredAnnotatef(errInfo.wrapConstructor(stderrors.New("pow!"), "woo"), "comment"), - "comment: woo: pow!", - errInfo, - }}...) - } - - runErrorTests(c, errorTests, true) -} - -func (*errorTypeSuite) TestAllErrors(c *gc.C) { - errorTests := []errorTest{} - for _, errInfo := range allErrors { - errorTests = append(errorTests, []errorTest{{ - nil, - "", - nil, - }, { - errInfo.argsConstructor("foo %d", 42), - "foo 42" + errInfo.suffix, - errInfo, - }, { - errInfo.argsConstructor(""), - errInfo.suffix, - errInfo, - }, { - errInfo.wrapConstructor(stderrors.New("pow!"), "prefix"), - "prefix: pow!", - errInfo, - }, { - errInfo.wrapConstructor(stderrors.New("pow!"), ""), - "pow!", - errInfo, - }, { - errInfo.wrapConstructor(nil, "prefix"), - "prefix", - errInfo, - }}...) - } - - runErrorTests(c, errorTests, true) -} diff --git a/test/integration/licenses/github.com/juju/errors/example_test.go b/test/integration/licenses/github.com/juju/errors/example_test.go deleted file mode 100644 index 2a79cf4898..0000000000 --- a/test/integration/licenses/github.com/juju/errors/example_test.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013, 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors_test - -import ( - "fmt" - - "github.com/juju/errors" -) - -func ExampleTrace() { - var err1 error = fmt.Errorf("something wicked this way comes") - var err2 error = nil - - // Tracing a non nil error will return an error - fmt.Println(errors.Trace(err1)) - // Tracing nil will return nil - fmt.Println(errors.Trace(err2)) - - // Output: something wicked this way comes - // -} diff --git a/test/integration/licenses/github.com/juju/errors/export_test.go b/test/integration/licenses/github.com/juju/errors/export_test.go deleted file mode 100644 index 8e6bb7c0ba..0000000000 --- a/test/integration/licenses/github.com/juju/errors/export_test.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013, 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors - -// Since variables are declared before the init block, in order to get the goPath -// we need to return it rather than just reference it. -func TrimDefault() string { - return trimDefault -} - -var TrimSourcePath = trimSourcePath diff --git a/test/integration/licenses/github.com/juju/errors/functions.go b/test/integration/licenses/github.com/juju/errors/functions.go deleted file mode 100644 index 1bf7c9e257..0000000000 --- a/test/integration/licenses/github.com/juju/errors/functions.go +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors - -import ( - "fmt" - "strings" -) - -// New is a drop in replacement for the standard library errors module that records -// the location that the error is created. -// -// For example: -// return errors.New("validation failed") -// -func New(message string) error { - err := &Err{message: message} - err.SetLocation(1) - return err -} - -// Errorf creates a new annotated error and records the location that the -// error is created. This should be a drop in replacement for fmt.Errorf. -// -// For example: -// return errors.Errorf("validation failed: %s", message) -// -func Errorf(format string, args ...interface{}) error { - err := &Err{message: fmt.Sprintf(format, args...)} - err.SetLocation(1) - return err -} - -// Trace adds the location of the Trace call to the stack. The Cause of the -// resulting error is the same as the error parameter. If the other error is -// nil, the result will be nil. -// -// For example: -// if err := SomeFunc(); err != nil { -// return errors.Trace(err) -// } -// -func Trace(other error) error { - if other == nil { - return nil - } - err := &Err{previous: other, cause: Cause(other)} - err.SetLocation(1) - return err -} - -// Annotate is used to add extra context to an existing error. The location of -// the Annotate call is recorded with the annotations. The file, line and -// function are also recorded. -// -// For example: -// if err := SomeFunc(); err != nil { -// return errors.Annotate(err, "failed to frombulate") -// } -// -func Annotate(other error, message string) error { - if other == nil { - return nil - } - err := &Err{ - previous: other, - cause: Cause(other), - message: message, - } - err.SetLocation(1) - return err -} - -// Annotatef is used to add extra context to an existing error. The location of -// the Annotate call is recorded with the annotations. The file, line and -// function are also recorded. -// -// For example: -// if err := SomeFunc(); err != nil { -// return errors.Annotatef(err, "failed to frombulate the %s", arg) -// } -// -func Annotatef(other error, format string, args ...interface{}) error { - if other == nil { - return nil - } - err := &Err{ - previous: other, - cause: Cause(other), - message: fmt.Sprintf(format, args...), - } - err.SetLocation(1) - return err -} - -// DeferredAnnotatef annotates the given error (when it is not nil) with the given -// format string and arguments (like fmt.Sprintf). If *err is nil, DeferredAnnotatef -// does nothing. This method is used in a defer statement in order to annotate any -// resulting error with the same message. -// -// For example: -// -// defer DeferredAnnotatef(&err, "failed to frombulate the %s", arg) -// -func DeferredAnnotatef(err *error, format string, args ...interface{}) { - if *err == nil { - return - } - newErr := &Err{ - message: fmt.Sprintf(format, args...), - cause: Cause(*err), - previous: *err, - } - newErr.SetLocation(1) - *err = newErr -} - -// Wrap changes the Cause of the error. The location of the Wrap call is also -// stored in the error stack. -// -// For example: -// if err := SomeFunc(); err != nil { -// newErr := &packageError{"more context", private_value} -// return errors.Wrap(err, newErr) -// } -// -func Wrap(other, newDescriptive error) error { - err := &Err{ - previous: other, - cause: newDescriptive, - } - err.SetLocation(1) - return err -} - -// Wrapf changes the Cause of the error, and adds an annotation. The location -// of the Wrap call is also stored in the error stack. -// -// For example: -// if err := SomeFunc(); err != nil { -// return errors.Wrapf(err, simpleErrorType, "invalid value %q", value) -// } -// -func Wrapf(other, newDescriptive error, format string, args ...interface{}) error { - err := &Err{ - message: fmt.Sprintf(format, args...), - previous: other, - cause: newDescriptive, - } - err.SetLocation(1) - return err -} - -// Maskf masks the given error with the given format string and arguments (like -// fmt.Sprintf), returning a new error that maintains the error stack, but -// hides the underlying error type. The error string still contains the full -// annotations. If you want to hide the annotations, call Wrap. -func Maskf(other error, format string, args ...interface{}) error { - if other == nil { - return nil - } - err := &Err{ - message: fmt.Sprintf(format, args...), - previous: other, - } - err.SetLocation(1) - return err -} - -// Mask hides the underlying error type, and records the location of the masking. -func Mask(other error) error { - if other == nil { - return nil - } - err := &Err{ - previous: other, - } - err.SetLocation(1) - return err -} - -// Cause returns the cause of the given error. This will be either the -// original error, or the result of a Wrap or Mask call. -// -// Cause is the usual way to diagnose errors that may have been wrapped by -// the other errors functions. -func Cause(err error) error { - var diag error - if err, ok := err.(causer); ok { - diag = err.Cause() - } - if diag != nil { - return diag - } - return err -} - -type causer interface { - Cause() error -} - -type wrapper interface { - // Message returns the top level error message, - // not including the message from the Previous - // error. - Message() string - - // Underlying returns the Previous error, or nil - // if there is none. - Underlying() error -} - -type locationer interface { - Location() (string, int) -} - -var ( - _ wrapper = (*Err)(nil) - _ locationer = (*Err)(nil) - _ causer = (*Err)(nil) -) - -// Details returns information about the stack of errors wrapped by err, in -// the format: -// -// [{filename:99: error one} {otherfile:55: cause of error one}] -// -// This is a terse alternative to ErrorStack as it returns a single line. -func Details(err error) string { - if err == nil { - return "[]" - } - var s []byte - s = append(s, '[') - for { - s = append(s, '{') - if err, ok := err.(locationer); ok { - file, line := err.Location() - if file != "" { - s = append(s, fmt.Sprintf("%s:%d", file, line)...) - s = append(s, ": "...) - } - } - if cerr, ok := err.(wrapper); ok { - s = append(s, cerr.Message()...) - err = cerr.Underlying() - } else { - s = append(s, err.Error()...) - err = nil - } - s = append(s, '}') - if err == nil { - break - } - s = append(s, ' ') - } - s = append(s, ']') - return string(s) -} - -// ErrorStack returns a string representation of the annotated error. If the -// error passed as the parameter is not an annotated error, the result is -// simply the result of the Error() method on that error. -// -// If the error is an annotated error, a multi-line string is returned where -// each line represents one entry in the annotation stack. The full filename -// from the call stack is used in the output. -// -// first error -// github.com/juju/errors/annotation_test.go:193: -// github.com/juju/errors/annotation_test.go:194: annotation -// github.com/juju/errors/annotation_test.go:195: -// github.com/juju/errors/annotation_test.go:196: more context -// github.com/juju/errors/annotation_test.go:197: -func ErrorStack(err error) string { - return strings.Join(errorStack(err), "\n") -} - -func errorStack(err error) []string { - if err == nil { - return nil - } - - // We want the first error first - var lines []string - for { - var buff []byte - if err, ok := err.(locationer); ok { - file, line := err.Location() - // Strip off the leading GOPATH/src path elements. - file = trimSourcePath(file) - if file != "" { - buff = append(buff, fmt.Sprintf("%s:%d", file, line)...) - buff = append(buff, ": "...) - } - } - if cerr, ok := err.(wrapper); ok { - message := cerr.Message() - buff = append(buff, message...) - // If there is a cause for this error, and it is different to the cause - // of the underlying error, then output the error string in the stack trace. - var cause error - if err1, ok := err.(causer); ok { - cause = err1.Cause() - } - err = cerr.Underlying() - if cause != nil && !sameError(Cause(err), cause) { - if message != "" { - buff = append(buff, ": "...) - } - buff = append(buff, cause.Error()...) - } - } else { - buff = append(buff, err.Error()...) - err = nil - } - lines = append(lines, string(buff)) - if err == nil { - break - } - } - // reverse the lines to get the original error, which was at the end of - // the list, back to the start. - var result []string - for i := len(lines); i > 0; i-- { - result = append(result, lines[i-1]) - } - return result -} diff --git a/test/integration/licenses/github.com/juju/errors/functions_test.go b/test/integration/licenses/github.com/juju/errors/functions_test.go deleted file mode 100644 index de43e43923..0000000000 --- a/test/integration/licenses/github.com/juju/errors/functions_test.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors_test - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - "strings" - - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/errors" -) - -type functionSuite struct { -} - -var _ = gc.Suite(&functionSuite{}) - -func (*functionSuite) TestNew(c *gc.C) { - err := errors.New("testing") //err newTest - c.Assert(err.Error(), gc.Equals, "testing") - c.Assert(errors.Cause(err), gc.Equals, err) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["newTest"].String()) -} - -func (*functionSuite) TestErrorf(c *gc.C) { - err := errors.Errorf("testing %d", 42) //err errorfTest - c.Assert(err.Error(), gc.Equals, "testing 42") - c.Assert(errors.Cause(err), gc.Equals, err) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["errorfTest"].String()) -} - -func (*functionSuite) TestTrace(c *gc.C) { - first := errors.New("first") - err := errors.Trace(first) //err traceTest - c.Assert(err.Error(), gc.Equals, "first") - c.Assert(errors.Cause(err), gc.Equals, first) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["traceTest"].String()) - - c.Assert(errors.Trace(nil), gc.IsNil) -} - -func (*functionSuite) TestAnnotate(c *gc.C) { - first := errors.New("first") - err := errors.Annotate(first, "annotation") //err annotateTest - c.Assert(err.Error(), gc.Equals, "annotation: first") - c.Assert(errors.Cause(err), gc.Equals, first) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["annotateTest"].String()) - - c.Assert(errors.Annotate(nil, "annotate"), gc.IsNil) -} - -func (*functionSuite) TestAnnotatef(c *gc.C) { - first := errors.New("first") - err := errors.Annotatef(first, "annotation %d", 2) //err annotatefTest - c.Assert(err.Error(), gc.Equals, "annotation 2: first") - c.Assert(errors.Cause(err), gc.Equals, first) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["annotatefTest"].String()) - - c.Assert(errors.Annotatef(nil, "annotate"), gc.IsNil) -} - -func (*functionSuite) TestDeferredAnnotatef(c *gc.C) { - // NOTE: this test fails with gccgo - if runtime.Compiler == "gccgo" { - c.Skip("gccgo can't determine the location") - } - first := errors.New("first") - test := func() (err error) { - defer errors.DeferredAnnotatef(&err, "deferred %s", "annotate") - return first //err deferredAnnotate - } - err := test() - c.Assert(err.Error(), gc.Equals, "deferred annotate: first") - c.Assert(errors.Cause(err), gc.Equals, first) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["deferredAnnotate"].String()) - - err = nil - errors.DeferredAnnotatef(&err, "deferred %s", "annotate") - c.Assert(err, gc.IsNil) -} - -func (*functionSuite) TestWrap(c *gc.C) { - first := errors.New("first") //err wrapFirst - detailed := errors.New("detailed") - err := errors.Wrap(first, detailed) //err wrapTest - c.Assert(err.Error(), gc.Equals, "detailed") - c.Assert(errors.Cause(err), gc.Equals, detailed) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapFirst"].String()) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapTest"].String()) -} - -func (*functionSuite) TestWrapOfNil(c *gc.C) { - detailed := errors.New("detailed") - err := errors.Wrap(nil, detailed) //err nilWrapTest - c.Assert(err.Error(), gc.Equals, "detailed") - c.Assert(errors.Cause(err), gc.Equals, detailed) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["nilWrapTest"].String()) -} - -func (*functionSuite) TestWrapf(c *gc.C) { - first := errors.New("first") //err wrapfFirst - detailed := errors.New("detailed") - err := errors.Wrapf(first, detailed, "value %d", 42) //err wrapfTest - c.Assert(err.Error(), gc.Equals, "value 42: detailed") - c.Assert(errors.Cause(err), gc.Equals, detailed) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapfFirst"].String()) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["wrapfTest"].String()) -} - -func (*functionSuite) TestWrapfOfNil(c *gc.C) { - detailed := errors.New("detailed") - err := errors.Wrapf(nil, detailed, "value %d", 42) //err nilWrapfTest - c.Assert(err.Error(), gc.Equals, "value 42: detailed") - c.Assert(errors.Cause(err), gc.Equals, detailed) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["nilWrapfTest"].String()) -} - -func (*functionSuite) TestMask(c *gc.C) { - first := errors.New("first") - err := errors.Mask(first) //err maskTest - c.Assert(err.Error(), gc.Equals, "first") - c.Assert(errors.Cause(err), gc.Equals, err) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["maskTest"].String()) - - c.Assert(errors.Mask(nil), gc.IsNil) -} - -func (*functionSuite) TestMaskf(c *gc.C) { - first := errors.New("first") - err := errors.Maskf(first, "masked %d", 42) //err maskfTest - c.Assert(err.Error(), gc.Equals, "masked 42: first") - c.Assert(errors.Cause(err), gc.Equals, err) - c.Assert(errors.Details(err), jc.Contains, tagToLocation["maskfTest"].String()) - - c.Assert(errors.Maskf(nil, "mask"), gc.IsNil) -} - -func (*functionSuite) TestCause(c *gc.C) { - c.Assert(errors.Cause(nil), gc.IsNil) - c.Assert(errors.Cause(someErr), gc.Equals, someErr) - - fmtErr := fmt.Errorf("simple") - c.Assert(errors.Cause(fmtErr), gc.Equals, fmtErr) - - err := errors.Wrap(someErr, fmtErr) - c.Assert(errors.Cause(err), gc.Equals, fmtErr) - - err = errors.Annotate(err, "annotated") - c.Assert(errors.Cause(err), gc.Equals, fmtErr) - - err = errors.Maskf(err, "maksed") - c.Assert(errors.Cause(err), gc.Equals, err) - - // Look for a file that we know isn't there. - dir := c.MkDir() - _, err = os.Stat(filepath.Join(dir, "not-there")) - c.Assert(os.IsNotExist(err), jc.IsTrue) - - err = errors.Annotatef(err, "wrap it") - // Now the error itself isn't a 'IsNotExist'. - c.Assert(os.IsNotExist(err), jc.IsFalse) - // However if we use the Check method, it is. - c.Assert(os.IsNotExist(errors.Cause(err)), jc.IsTrue) -} - -func (s *functionSuite) TestDetails(c *gc.C) { - if runtime.Compiler == "gccgo" { - c.Skip("gccgo can't determine the location") - } - c.Assert(errors.Details(nil), gc.Equals, "[]") - - otherErr := fmt.Errorf("other") - checkDetails(c, otherErr, "[{other}]") - - err0 := newEmbed("foo") //err TestStack#0 - checkDetails(c, err0, "[{$TestStack#0$: foo}]") - - err1 := errors.Annotate(err0, "bar") //err TestStack#1 - checkDetails(c, err1, "[{$TestStack#1$: bar} {$TestStack#0$: foo}]") - - err2 := errors.Trace(err1) //err TestStack#2 - checkDetails(c, err2, "[{$TestStack#2$: } {$TestStack#1$: bar} {$TestStack#0$: foo}]") -} - -type tracer interface { - StackTrace() []string -} - -func (*functionSuite) TestErrorStack(c *gc.C) { - for i, test := range []struct { - message string - generator func() error - expected string - tracer bool - }{{ - message: "nil", - generator: func() error { - return nil - }, - }, { - message: "raw error", - generator: func() error { - return fmt.Errorf("raw") - }, - expected: "raw", - }, { - message: "single error stack", - generator: func() error { - return errors.New("first error") //err single - }, - expected: "$single$: first error", - tracer: true, - }, { - message: "annotated error", - generator: func() error { - err := errors.New("first error") //err annotated-0 - return errors.Annotate(err, "annotation") //err annotated-1 - }, - expected: "" + - "$annotated-0$: first error\n" + - "$annotated-1$: annotation", - tracer: true, - }, { - message: "wrapped error", - generator: func() error { - err := errors.New("first error") //err wrapped-0 - return errors.Wrap(err, newError("detailed error")) //err wrapped-1 - }, - expected: "" + - "$wrapped-0$: first error\n" + - "$wrapped-1$: detailed error", - tracer: true, - }, { - message: "annotated wrapped error", - generator: func() error { - err := errors.Errorf("first error") //err ann-wrap-0 - err = errors.Wrap(err, fmt.Errorf("detailed error")) //err ann-wrap-1 - return errors.Annotatef(err, "annotated") //err ann-wrap-2 - }, - expected: "" + - "$ann-wrap-0$: first error\n" + - "$ann-wrap-1$: detailed error\n" + - "$ann-wrap-2$: annotated", - tracer: true, - }, { - message: "traced, and annotated", - generator: func() error { - err := errors.New("first error") //err stack-0 - err = errors.Trace(err) //err stack-1 - err = errors.Annotate(err, "some context") //err stack-2 - err = errors.Trace(err) //err stack-3 - err = errors.Annotate(err, "more context") //err stack-4 - return errors.Trace(err) //err stack-5 - }, - expected: "" + - "$stack-0$: first error\n" + - "$stack-1$: \n" + - "$stack-2$: some context\n" + - "$stack-3$: \n" + - "$stack-4$: more context\n" + - "$stack-5$: ", - tracer: true, - }, { - message: "uncomparable, wrapped with a value error", - generator: func() error { - err := newNonComparableError("first error") //err mixed-0 - err = errors.Trace(err) //err mixed-1 - err = errors.Wrap(err, newError("value error")) //err mixed-2 - err = errors.Maskf(err, "masked") //err mixed-3 - err = errors.Annotate(err, "more context") //err mixed-4 - return errors.Trace(err) //err mixed-5 - }, - expected: "" + - "first error\n" + - "$mixed-1$: \n" + - "$mixed-2$: value error\n" + - "$mixed-3$: masked\n" + - "$mixed-4$: more context\n" + - "$mixed-5$: ", - tracer: true, - }} { - c.Logf("%v: %s", i, test.message) - err := test.generator() - expected := replaceLocations(test.expected) - stack := errors.ErrorStack(err) - ok := c.Check(stack, gc.Equals, expected) - if !ok { - c.Logf("%#v", err) - } - tracer, ok := err.(tracer) - c.Check(ok, gc.Equals, test.tracer) - if ok { - stackTrace := tracer.StackTrace() - c.Check(stackTrace, gc.DeepEquals, strings.Split(stack, "\n")) - } - } -} - -func (*functionSuite) TestFormat(c *gc.C) { - err := errors.New("TestFormat") //err testformat - err = errors.Mask(err) //err testformat-wrap - for i, test := range []struct { - format string - expect string - }{{ - format: "%s", - expect: "TestFormat", - }, { - format: "%v", - expect: "TestFormat", - }, { - format: "%q", - expect: `"TestFormat"`, - }, { - format: "%A", - expect: `%!A(*errors.Err=TestFormat)`, - }, { - format: "%+v", - expect: "" + - "$testformat$: TestFormat\n" + - "$testformat-wrap$: ", - }} { - c.Logf("test %d: %q", i, test.format) - s := fmt.Sprintf(test.format, err) - expect := replaceLocations(test.expect) - c.Check(s, gc.Equals, expect) - } -} diff --git a/test/integration/licenses/github.com/juju/errors/go.mod b/test/integration/licenses/github.com/juju/errors/go.mod deleted file mode 100644 index 6079e4d656..0000000000 --- a/test/integration/licenses/github.com/juju/errors/go.mod +++ /dev/null @@ -1,16 +0,0 @@ -module github.com/juju/errors - -go 1.17 - -require ( - github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c -) - -require ( - github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e // indirect - github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 // indirect - github.com/kr/pretty v0.2.1 // indirect - github.com/kr/text v0.2.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect -) diff --git a/test/integration/licenses/github.com/juju/errors/go.sum b/test/integration/licenses/github.com/juju/errors/go.sum deleted file mode 100644 index 0a8b662813..0000000000 --- a/test/integration/licenses/github.com/juju/errors/go.sum +++ /dev/null @@ -1,76 +0,0 @@ -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= -github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= -github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= -github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= -github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e h1:FdDd7bdI6cjq5vaoYlK1mfQYfF9sF2VZw8VEZMsl5t8= -github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= -github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= -github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= -github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6 h1:ulhR1Mns3DtuGP+dmHV92CBqgsNT7FsE3sFOePwHFVI= -github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6/go.mod h1:QgWc2UdIPJ8t3rnvv95tFNOsQDfpXYEZDbP281o3b2c= -github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= -github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= -github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= -github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= -github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= -golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= -gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= -gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= -gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -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= -launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= -launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= diff --git a/test/integration/licenses/github.com/juju/errors/package_test.go b/test/integration/licenses/github.com/juju/errors/package_test.go deleted file mode 100644 index 5bbb8f04ef..0000000000 --- a/test/integration/licenses/github.com/juju/errors/package_test.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2013, 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors_test - -import ( - "fmt" - "io/ioutil" - "strings" - "testing" - - gc "gopkg.in/check.v1" - - "github.com/juju/errors" -) - -func Test(t *testing.T) { - gc.TestingT(t) -} - -func checkDetails(c *gc.C, err error, details string) { - c.Assert(err, gc.NotNil) - expectedDetails := replaceLocations(details) - c.Assert(errors.Details(err), gc.Equals, expectedDetails) -} - -func checkErr(c *gc.C, err, cause error, msg string, details string) { - c.Assert(err, gc.NotNil) - c.Assert(err.Error(), gc.Equals, msg) - c.Assert(errors.Cause(err), gc.Equals, cause) - expectedDetails := replaceLocations(details) - c.Assert(errors.Details(err), gc.Equals, expectedDetails) -} - -func replaceLocations(line string) string { - result := "" - for { - i := strings.Index(line, "$") - if i == -1 { - break - } - result += line[0:i] - line = line[i+1:] - i = strings.Index(line, "$") - if i == -1 { - panic("no second $") - } - result += location(line[0:i]).String() - line = line[i+1:] - } - result += line - return result -} - -func location(tag string) Location { - loc, ok := tagToLocation[tag] - if !ok { - panic(fmt.Sprintf("tag %q not found", tag)) - } - return loc -} - -type Location struct { - file string - line int -} - -func (loc Location) String() string { - return fmt.Sprintf("%s:%d", loc.file, loc.line) -} - -var tagToLocation = make(map[string]Location) - -func setLocationsForErrorTags(filename string) { - data, err := ioutil.ReadFile(filename) - if err != nil { - panic(err) - } - filename = "github.com/juju/errors/" + filename - lines := strings.Split(string(data), "\n") - for i, line := range lines { - if j := strings.Index(line, "//err "); j >= 0 { - tag := line[j+len("//err "):] - if _, found := tagToLocation[tag]; found { - panic(fmt.Sprintf("tag %q already processed previously", tag)) - } - tagToLocation[tag] = Location{file: filename, line: i + 1} - } - } -} - -func init() { - setLocationsForErrorTags("error_test.go") - setLocationsForErrorTags("functions_test.go") -} diff --git a/test/integration/licenses/github.com/juju/errors/path.go b/test/integration/licenses/github.com/juju/errors/path.go deleted file mode 100644 index 48968d9054..0000000000 --- a/test/integration/licenses/github.com/juju/errors/path.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2013, 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors - -import ( - "go/build" - "os" - "path/filepath" - "strings" - "sync/atomic" -) - -var trimValue atomic.Value -var trimDefault = filepath.Join(build.Default.GOPATH, "src") + string(os.PathSeparator) - -func trimSourcePath(filename string) string { - prefix := trimDefault - if v := trimValue.Load(); v != nil { - prefix = v.(string) - } - return strings.TrimPrefix(filename, prefix) -} - -func SetSourceTrimPrefix(s string) string { - previous := trimDefault - if v := trimValue.Load(); v != nil { - previous = v.(string) - } - trimValue.Store(s) - return previous -} diff --git a/test/integration/licenses/github.com/juju/errors/path_test.go b/test/integration/licenses/github.com/juju/errors/path_test.go deleted file mode 100644 index 334ddb6e67..0000000000 --- a/test/integration/licenses/github.com/juju/errors/path_test.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013, 2014 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package errors_test - -import ( - "path/filepath" - - gc "gopkg.in/check.v1" - - "github.com/juju/errors" -) - -type pathSuite struct{} - -var _ = gc.Suite(&pathSuite{}) - -func (*pathSuite) TestTrimDefaultSet(c *gc.C) { - c.Assert(errors.TrimDefault(), gc.Not(gc.Equals), "") -} - -func (*pathSuite) TestTrimSourcePath(c *gc.C) { - relativeImport := "github.com/foo/bar/rel.go" - filename := filepath.Join(errors.TrimDefault(), relativeImport) - c.Assert(errors.TrimSourcePath(filename), gc.Equals, relativeImport) - - absoluteImport := "/usr/share/foo/bar/abs.go" - c.Assert(errors.TrimSourcePath(absoluteImport), gc.Equals, absoluteImport) -} - -func (*pathSuite) TestSetSourceTrimPrefix(c *gc.C) { - testPrefix := "/usr/share/" - savePrefix := errors.SetSourceTrimPrefix(testPrefix) - defer errors.SetSourceTrimPrefix(savePrefix) - relative := "github.com/foo/bar/rel.go" - filename := filepath.Join(testPrefix, relative) - c.Assert(errors.TrimSourcePath(filename), gc.Equals, relative) -} diff --git a/test/integration/licenses/github.com/juju/fslock/.gitignore b/test/integration/licenses/github.com/juju/fslock/.gitignore deleted file mode 100644 index daf913b1b3..0000000000 --- a/test/integration/licenses/github.com/juju/fslock/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/test/integration/licenses/github.com/juju/fslock/LICENSE b/test/integration/licenses/github.com/juju/fslock/LICENSE deleted file mode 100644 index 5cec73f3a4..0000000000 --- a/test/integration/licenses/github.com/juju/fslock/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -All files in this repository are licensed as follows. If you contribute -to this repository, it is assumed that you license your contribution -under the same license unless you state otherwise. - -All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/test/integration/licenses/github.com/juju/fslock/README.md b/test/integration/licenses/github.com/juju/fslock/README.md deleted file mode 100644 index 4361b9dd0d..0000000000 --- a/test/integration/licenses/github.com/juju/fslock/README.md +++ /dev/null @@ -1,74 +0,0 @@ - -# fslock [![GoDoc](https://godoc.org/github.com/juju/fslock?status.svg)](https://godoc.org/github.com/juju/fslock) -fslock provides a cross-process mutex based on file locks that works on windows and *nix platforms. - - -![fslock](https://cloud.githubusercontent.com/assets/3185864/15507515/f3351498-2199-11e6-9f37-bc59657a9e8c.jpg) - -image: [public domain](https://pixabay.com/en/encrypted-privacy-policy-445155/) -(don't ask) - - -fslock relies on LockFileEx on Windows and flock on \*nix systems. The timeout -feature uses overlapped IO on Windows, but on \*nix platforms, timing out -requires the use of a goroutine that will run until the lock is acquired, -regardless of timeout. If you need to avoid this use of goroutines, poll -TryLock in a loop. - - - -## Variables -``` go -var ErrLocked error = trylockError("fslock is already locked") -``` -ErrLocked indicates TryLock failed because the lock was already locked. - -``` go -var ErrTimeout error = timeoutError("lock timeout exceeded") -``` -ErrTimeout indicates that the lock attempt timed out. - - -## type Lock -``` go -type Lock struct { - // contains filtered or unexported fields -} -``` -Lock implements cross-process locks using syscalls. - - -### func New -``` go -func New(filename string) *Lock -``` -New returns a new lock around the given file. - - -### func (\*Lock) Lock -``` go -func (l *Lock) Lock() error -``` -Lock locks the lock. This call will block until the lock is available. - -### func (\*Lock) LockWithTimeout -``` go -func (l *Lock) LockWithTimeout(timeout time.Duration) error -``` -LockWithTimeout tries to lock the lock until the timeout expires. If the -timeout expires, this method will return ErrTimeout. - -### func (\*Lock) TryLock -``` go -func (l *Lock) TryLock() error -``` -TryLock attempts to lock the lock. This method will return ErrLocked -immediately if the lock cannot be acquired. - -### func (\*Lock) Unlock -``` go -func (l *Lock) Unlock() error -``` -Unlock unlocks the lock. - - diff --git a/test/integration/licenses/github.com/juju/fslock/fslock.go b/test/integration/licenses/github.com/juju/fslock/fslock.go deleted file mode 100644 index f03c25e997..0000000000 --- a/test/integration/licenses/github.com/juju/fslock/fslock.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -// Package fslock provides a cross-process mutex based on file locks. -// -// It is built on top of flock for linux and darwin, and LockFileEx on Windows. -package fslock - -// ErrTimeout indicates that the lock attempt timed out. -var ErrTimeout error = timeoutError("lock timeout exceeded") - -type timeoutError string - -func (t timeoutError) Error() string { - return string(t) -} -func (timeoutError) Timeout() bool { - return true -} - -// ErrLocked indicates TryLock failed because the lock was already locked. -var ErrLocked error = trylockError("fslock is already locked") - -type trylockError string - -func (t trylockError) Error() string { - return string(t) -} - -func (trylockError) Temporary() bool { - return true -} diff --git a/test/integration/licenses/github.com/juju/fslock/fslock_nix.go b/test/integration/licenses/github.com/juju/fslock/fslock_nix.go deleted file mode 100644 index 55aabb67e1..0000000000 --- a/test/integration/licenses/github.com/juju/fslock/fslock_nix.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd -// +build darwin dragonfly freebsd linux netbsd openbsd - -package fslock - -import ( - "syscall" - "time" -) - -// Lock implements cross-process locks using syscalls. -// This implementation is based on flock syscall. -type Lock struct { - filename string - fd int -} - -// New returns a new lock around the given file. -func New(filename string) *Lock { - return &Lock{filename: filename} -} - -// Lock locks the lock. This call will block until the lock is available. -func (l *Lock) Lock() error { - if err := l.open(); err != nil { - return err - } - return syscall.Flock(l.fd, syscall.LOCK_EX) -} - -// TryLock attempts to lock the lock. This method will return ErrLocked -// immediately if the lock cannot be acquired. -func (l *Lock) TryLock() error { - if err := l.open(); err != nil { - return err - } - err := syscall.Flock(l.fd, syscall.LOCK_EX|syscall.LOCK_NB) - if err != nil { - syscall.Close(l.fd) - } - if err == syscall.EWOULDBLOCK { - return ErrLocked - } - return err -} - -func (l *Lock) open() error { - fd, err := syscall.Open(l.filename, syscall.O_CREAT|syscall.O_RDONLY, 0600) - if err != nil { - return err - } - l.fd = fd - return nil -} - -// Unlock unlocks the lock. -func (l *Lock) Unlock() error { - return syscall.Close(l.fd) -} - -// LockWithTimeout tries to lock the lock until the timeout expires. If the -// timeout expires, this method will return ErrTimeout. -func (l *Lock) LockWithTimeout(timeout time.Duration) error { - if err := l.open(); err != nil { - return err - } - result := make(chan error) - cancel := make(chan struct{}) - go func() { - err := syscall.Flock(l.fd, syscall.LOCK_EX) - select { - case <-cancel: - // Timed out, cleanup if necessary. - syscall.Flock(l.fd, syscall.LOCK_UN) - syscall.Close(l.fd) - case result <- err: - } - }() - select { - case err := <-result: - return err - case <-time.After(timeout): - close(cancel) - return ErrTimeout - } -} diff --git a/test/integration/licenses/github.com/juju/fslock/fslock_test.go b/test/integration/licenses/github.com/juju/fslock/fslock_test.go deleted file mode 100644 index 09d7aaea9b..0000000000 --- a/test/integration/licenses/github.com/juju/fslock/fslock_test.go +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package fslock_test - -import ( - "fmt" - "os" - "os/exec" - "path/filepath" - "runtime" - "sync" - "sync/atomic" - "testing" - "time" - - gc "gopkg.in/check.v1" - - "github.com/juju/fslock" -) - -func Test(t *testing.T) { - gc.TestingT(t) -} - -const ( - shortWait = 10 * time.Millisecond - longWait = 10 * shortWait -) - -type fslockSuite struct{} - -var _ = gc.Suite(&fslockSuite{}) - -func (s *fslockSuite) TestLockNoContention(c *gc.C) { - path := filepath.Join(c.MkDir(), "testing") - lock := fslock.New(path) - - started := make(chan struct{}) - acquired := make(chan struct{}) - go func() { - close(started) - err := lock.Lock() - close(acquired) - c.Assert(err, gc.IsNil) - }() - - select { - case <-started: - // good, goroutine started. - case <-time.After(shortWait * 2): - c.Fatalf("timeout waiting for goroutine to start") - } - - select { - case <-acquired: - // got the lock. good. - case <-time.After(shortWait * 2): - c.Fatalf("Timed out waiting for lock acquisition.") - } - - err := lock.Unlock() - c.Assert(err, gc.IsNil) -} - -func (s *fslockSuite) TestLockBlocks(c *gc.C) { - path := filepath.Join(c.MkDir(), "testing") - lock := fslock.New(path) - - kill := make(chan struct{}) - - // this will block until the other process has the lock. - procDone := LockFromAnotherProc(c, path, kill) - - defer func() { - close(kill) - // now wait for the other process to exit so the file will be unlocked. - select { - case <-procDone: - case <-time.After(time.Second): - } - }() - - started := make(chan struct{}) - acquired := make(chan struct{}) - go func() { - close(started) - err := lock.Lock() - close(acquired) - lock.Unlock() - c.Assert(err, gc.IsNil) - }() - - select { - case <-started: - // good, goroutine started. - case <-time.After(shortWait * 2): - c.Fatalf("timeout waiting for goroutine to start") - } - - // Waiting for something not to happen is inherently hard... - select { - case <-acquired: - c.Fatalf("Unexpected lock acquisition") - case <-time.After(shortWait * 2): - // all good. - } -} - -func (s *fslockSuite) TestTryLock(c *gc.C) { - lock := fslock.New(filepath.Join(c.MkDir(), "testing")) - - err := lock.TryLock() - c.Assert(err, gc.IsNil) - lock.Unlock() -} - -func (s *fslockSuite) TestTryLockNoBlock(c *gc.C) { - path := filepath.Join(c.MkDir(), "testing") - lock := fslock.New(path) - - kill := make(chan struct{}) - - // this will block until the other process has the lock. - procDone := LockFromAnotherProc(c, path, kill) - - defer func() { - close(kill) - // now wait for the other process to exit so the file will be unlocked. - select { - case <-procDone: - case <-time.After(time.Second): - } - }() - - started := make(chan struct{}) - result := make(chan error) - go func() { - close(started) - result <- lock.TryLock() - }() - - select { - case <-started: - // good, goroutine started. - case <-time.After(shortWait): - c.Fatalf("timeout waiting for goroutine to start") - } - - // Wait for trylock to fail. - select { - case err := <-result: - // yes, I know this is redundant with the assert below, but it makes the - // failed test message clearer. - if err == nil { - c.Fatalf("lock succeeded, but should have errored out") - } - // This should be the error from trylock failing. - c.Assert(err, gc.Equals, fslock.ErrLocked) - case <-time.After(shortWait): - c.Fatalf("took too long to fail trylock") - } -} - -func (s *fslockSuite) TestUnlockedWithTimeout(c *gc.C) { - lock := fslock.New(filepath.Join(c.MkDir(), "testing")) - - err := lock.LockWithTimeout(shortWait) - c.Assert(err, gc.IsNil) - lock.Unlock() -} - -func (s *fslockSuite) TestLockWithTimeout(c *gc.C) { - path := filepath.Join(c.MkDir(), "testing") - lock := fslock.New(path) - defer lock.Unlock() - - kill := make(chan struct{}) - - // this will block until the other process has the lock. - procDone := LockFromAnotherProc(c, path, kill) - - defer func() { - close(kill) - // now wait for the other process to exit so the file will be unlocked. - select { - case <-procDone: - case <-time.After(time.Second): - } - }() - - started := make(chan struct{}) - result := make(chan error) - go func() { - close(started) - result <- lock.LockWithTimeout(shortWait) - }() - - select { - case <-started: - // good, goroutine started. - case <-time.After(shortWait * 2): - c.Fatalf("timeout waiting for goroutine to start") - } - - // Wait for timeout. - select { - case err := <-result: - // yes, I know this is redundant with the assert below, but it makes the - // failed test message clearer. - if err == nil { - c.Fatalf("lock succeeded, but should have timed out") - } - // This should be the error from the lock timing out. - c.Assert(err, gc.Equals, fslock.ErrTimeout) - case <-time.After(shortWait * 2): - c.Fatalf("lock took too long to timeout") - } -} - -func (s *fslockSuite) TestStress(c *gc.C) { - const lockAttempts = 200 - const concurrentLocks = 10 - - var counter = new(int64) - // Use atomics to update lockState to make sure the lock isn't held by - // someone else. A value of 1 means locked, 0 means unlocked. - var lockState = new(int32) - - var wg sync.WaitGroup - - dir := c.MkDir() - - var stress = func(name string) { - defer wg.Done() - lock := fslock.New(filepath.Join(dir, "testing")) - for i := 0; i < lockAttempts; i++ { - err := lock.Lock() - c.Assert(err, gc.IsNil) - state := atomic.AddInt32(lockState, 1) - c.Assert(state, gc.Equals, int32(1)) - // Tell the go routine scheduler to give a slice to someone else - // while we have this locked. - runtime.Gosched() - // need to decrement prior to unlock to avoid the race of someone - // else grabbing the lock before we decrement the state. - atomic.AddInt32(lockState, -1) - err = lock.Unlock() - c.Assert(err, gc.IsNil) - // increment the general counter - atomic.AddInt64(counter, 1) - } - } - - for i := 0; i < concurrentLocks; i++ { - wg.Add(1) - go stress(fmt.Sprintf("Lock %d", i)) - } - wg.Wait() - c.Assert(*counter, gc.Equals, int64(lockAttempts*concurrentLocks)) -} - -// LockFromAnotherProc will launch a process and block until that process has -// created the lock file. If we time out waiting for the other process to take -// the lock, this function will fail the current test. -func LockFromAnotherProc(c *gc.C, path string, kill chan struct{}) (done chan struct{}) { - cmd := exec.Command(os.Args[0], "-test.run", "TestLockFromOtherProcess") - cmd.Env = append( - // We must preserve os.Environ() on Windows, - // or the subprocess will fail in weird and - // wonderful ways. - os.Environ(), - "FSLOCK_TEST_HELPER_WANTED=1", - "FSLOCK_TEST_HELPER_PATH="+path, - ) - - if err := cmd.Start(); err != nil { - c.Fatalf("error starting other proc: %v", err) - } - - done = make(chan struct{}) - - go func() { - cmd.Wait() - close(done) - }() - - go func() { - select { - case <-kill: - // this may fail, but there's not much we can do about it - _ = cmd.Process.Kill() - case <-done: - } - }() - - for x := 0; x < 10; x++ { - time.Sleep(shortWait) - if _, err := os.Stat(path); err == nil { - // file created by other process, let's continue - break - } - if x == 9 { - c.Fatalf("timed out waiting for other process to start") - } - } - return done -} - -func TestLockFromOtherProcess(t *testing.T) { - if os.Getenv("FSLOCK_TEST_HELPER_WANTED") == "" { - return - } - filename := os.Getenv("FSLOCK_TEST_HELPER_PATH") - lock := fslock.New(filename) - err := lock.Lock() - if err != nil { - fmt.Fprintf(os.Stderr, "error locking %q: %v", filename, err) - os.Exit(1) - } - time.Sleep(longWait) - err = lock.Unlock() - if err != nil { - fmt.Fprintf(os.Stderr, "error unlocking %q: %v", filename, err) - os.Exit(1) - } - os.Exit(0) -} diff --git a/test/integration/licenses/github.com/juju/fslock/fslock_windows.go b/test/integration/licenses/github.com/juju/fslock/fslock_windows.go deleted file mode 100644 index f29b00e4b4..0000000000 --- a/test/integration/licenses/github.com/juju/fslock/fslock_windows.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package fslock - -import ( - "log" - "syscall" - "time" - "unsafe" -) - -var ( - modkernel32 = syscall.NewLazyDLL("kernel32.dll") - procLockFileEx = modkernel32.NewProc("LockFileEx") - procCreateEventW = modkernel32.NewProc("CreateEventW") -) - -const ( - lockfileExclusiveLock = 2 - fileFlagNormal = 0x00000080 -) - -func init() { - log.SetFlags(log.Lmicroseconds | log.Ldate) -} - -// Lock implements cross-process locks using syscalls. -// This implementation is based on LockFileEx syscall. -type Lock struct { - filename string - handle syscall.Handle -} - -// New returns a new lock around the given file. -func New(filename string) *Lock { - return &Lock{filename: filename} -} - -// TryLock attempts to lock the lock. This method will return ErrLocked -// immediately if the lock cannot be acquired. -func (l *Lock) TryLock() error { - err := l.LockWithTimeout(0) - if err == ErrTimeout { - // in our case, timing out immediately just means it was already locked. - return ErrLocked - } - return err -} - -// Lock locks the lock. This call will block until the lock is available. -func (l *Lock) Lock() error { - return l.LockWithTimeout(-1) -} - -// Unlock unlocks the lock. -func (l *Lock) Unlock() error { - return syscall.Close(l.handle) -} - -// LockWithTimeout tries to lock the lock until the timeout expires. If the -// timeout expires, this method will return ErrTimeout. -func (l *Lock) LockWithTimeout(timeout time.Duration) (err error) { - name, err := syscall.UTF16PtrFromString(l.filename) - if err != nil { - return err - } - - // Open for asynchronous I/O so that we can timeout waiting for the lock. - // Also open shared so that other processes can open the file (but will - // still need to lock it). - handle, err := syscall.CreateFile( - name, - syscall.GENERIC_READ, - syscall.FILE_SHARE_READ, - nil, - syscall.OPEN_ALWAYS, - syscall.FILE_FLAG_OVERLAPPED|fileFlagNormal, - 0) - if err != nil { - return err - } - l.handle = handle - defer func() { - if err != nil { - syscall.Close(handle) - } - }() - - millis := uint32(syscall.INFINITE) - if timeout >= 0 { - millis = uint32(timeout.Nanoseconds() / 1000000) - } - - ol, err := newOverlapped() - if err != nil { - return err - } - defer syscall.CloseHandle(ol.HEvent) - err = lockFileEx(handle, lockfileExclusiveLock, 0, 1, 0, ol) - if err == nil { - return nil - } - - // ERROR_IO_PENDING is expected when we're waiting on an asychronous event - // to occur. - if err != syscall.ERROR_IO_PENDING { - return err - } - s, err := syscall.WaitForSingleObject(ol.HEvent, millis) - - switch s { - case syscall.WAIT_OBJECT_0: - // success! - return nil - case syscall.WAIT_TIMEOUT: - return ErrTimeout - default: - return err - } -} - -// newOverlapped creates a structure used to track asynchronous -// I/O requests that have been issued. -func newOverlapped() (*syscall.Overlapped, error) { - event, err := createEvent(nil, true, false, nil) - if err != nil { - return nil, err - } - return &syscall.Overlapped{HEvent: event}, nil -} - -func lockFileEx(h syscall.Handle, flags, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, uintptr(h), uintptr(flags), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol))) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} - -func createEvent(sa *syscall.SecurityAttributes, manualReset bool, initialState bool, name *uint16) (handle syscall.Handle, err error) { - var _p0 uint32 - if manualReset { - _p0 = 1 - } - var _p1 uint32 - if initialState { - _p1 = 1 - } - - r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(sa)), uintptr(_p0), uintptr(_p1), uintptr(unsafe.Pointer(name)), 0, 0) - handle = syscall.Handle(r0) - if handle == syscall.InvalidHandle { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return -} diff --git a/test/integration/licenses/github.com/juju/mutex/LICENSE b/test/integration/licenses/github.com/juju/mutex/LICENSE deleted file mode 100644 index ade9307b39..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -All files in this repository are licensed as follows. If you contribute -to this repository, it is assumed that you license your contribution -under the same license unless you state otherwise. - -All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/test/integration/licenses/github.com/juju/mutex/Makefile b/test/integration/licenses/github.com/juju/mutex/Makefile deleted file mode 100644 index a33c434b45..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -PROJECT := github.com/juju/mutex/v2 - -.PHONY: check-licence check-go check - -check: check-licence check-go - go test $(PROJECT)/... - -check-licence: - @(fgrep -rl "Licensed under the LGPLv3" .;\ - fgrep -rl "Code generated by MockGen. DO NOT EDIT." .;\ - find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \ - xargs -I {} echo FAIL: licence missed: {} - -check-go: - $(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g"))) - @(if [ x$(GOFMT) != x"" ]; then \ - echo go fmt is sad: $(GOFMT); \ - exit 1; \ - fi ) - @(go vet -all -composites=false -copylocks=false .) diff --git a/test/integration/licenses/github.com/juju/mutex/README.md b/test/integration/licenses/github.com/juju/mutex/README.md deleted file mode 100644 index 8c25248bef..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/README.md +++ /dev/null @@ -1,147 +0,0 @@ - - -# mutex -`import "github.com/juju/mutex/v2"` - -* [Overview](#pkg-overview) -* [Index](#pkg-index) - -## Overview -package mutex provides a named machine level mutex shareable between processes. -[![GoDoc](https://godoc.org/github.com/juju/mutex?status.svg)](https://godoc.org/github.com/juju/mutex) - -Mutexes have names. Each each name, only one mutex for that name can be -acquired at the same time, within and across process boundaries. If a -process dies while the mutex is held, the mutex is automatically released. - -The Linux/MacOS implementation uses flock, while the Windows implementation -uses a named mutex. - - - - -## Index -* [Variables](#pkg-variables) -* [type Clock](#Clock) -* [type Releaser](#Releaser) - * [func Acquire(spec Spec) (Releaser, error)](#Acquire) -* [type Spec](#Spec) - * [func (s *Spec) Validate() error](#Spec.Validate) - - -#### Package files -[doc.go](/src/github.com/juju/mutex/doc.go) [errors.go](/src/github.com/juju/mutex/errors.go) [legacy_mutex_linux.go](/src/github.com/juju/mutex/legacy_mutex_linux.go) [mutex.go](/src/github.com/juju/mutex/mutex.go) [mutex_flock.go](/src/github.com/juju/mutex/mutex_flock.go) - - - -## Variables -``` go -var ( - ErrTimeout = errors.New("timeout acquiring mutex") - ErrCancelled = errors.New("cancelled acquiring mutex") -) -``` - - - -## type [Clock](/src/target/mutex.go?s=682:907#L28) -``` go -type Clock interface { - // After waits for the duration to elapse and then sends the - // current time on the returned channel. - After(time.Duration) <-chan time.Time - - // Now returns the current clock time. - Now() time.Time -} -``` -Clock provides an interface for dealing with clocks. - - - - - - - - - - -## type [Releaser](/src/target/mutex.go?s=337:624#L19) -``` go -type Releaser interface { - // Release releases the mutex. Release may be called multiple times, but - // only the first call will release this instance of the mutex. Release is - // unable to release the mutex successfully it will call panic to forcibly - // release the mutex. - Release() -} -``` -Releaser defines the Release method that is the only thing that can be done -to a acquired mutex. - - - - - - - -### func [Acquire](/src/target/mutex.go?s=1757:1798#L61) -``` go -func Acquire(spec Spec) (Releaser, error) -``` -Acquire will attempt to acquire the named mutex. If the Timout value -is hit, ErrTimeout is returned. If the Cancel channel is signalled, -ErrCancelled is returned. - - - - - -## type [Spec](/src/target/mutex.go?s=986:1583#L38) -``` go -type Spec struct { - // Name is required, and must start with a letter and contain at most - // 40 letters, numbers or dashes. - Name string - - // Clock must be provided and is exposed for testing purposes. - Clock Clock - - // Delay defines how often to check for lock acquisition, for - // compatibility code that requires polling. - Delay time.Duration - - // Timeout allows the caller to specify how long to wait. If Timeout - // is zero, then the call will block forever. - Timeout time.Duration - - // Cancel if signalled will cause the Acquire method to return with ErrCancelled. - Cancel <-chan struct{} -} -``` -Spec defines the name of the mutex and behaviour of the Acquire function. - - - - - - - - - - -### func (\*Spec) [Validate](/src/target/mutex.go?s=2640:2671#L105) -``` go -func (s *Spec) Validate() error -``` -Validate checks the attributes of Spec for validity. - - - - - - - - -- - - -Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md) diff --git a/test/integration/licenses/github.com/juju/mutex/doc.go b/test/integration/licenses/github.com/juju/mutex/doc.go deleted file mode 100644 index 103836f7d5..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -/* -package mutex provides a named machine level mutex shareable between processes. -[godoc-link-here] - -Mutexes have names. Each each name, only one mutex for that name can be -acquired at the same time, within and across process boundaries. If a -process dies while the mutex is held, the mutex is automatically released. - -The Linux/MacOS implementation uses flock, while the Windows implementation -uses a named mutex. On Linux, we also acquire an abstract domain socket for -compatibility with older implementations. -*/ -package mutex diff --git a/test/integration/licenses/github.com/juju/mutex/errors.go b/test/integration/licenses/github.com/juju/mutex/errors.go deleted file mode 100644 index 0f10799005..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/errors.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package mutex - -import ( - "github.com/juju/errors" -) - -var ( - ErrTimeout = errors.New("timeout acquiring mutex") - ErrCancelled = errors.New("cancelled acquiring mutex") -) diff --git a/test/integration/licenses/github.com/juju/mutex/export_test.go b/test/integration/licenses/github.com/juju/mutex/export_test.go deleted file mode 100644 index 06da9106cf..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/export_test.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2016-2017 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package mutex - -var ( - // Export the Envars so we can test it via mocks - Envars = &envars -) diff --git a/test/integration/licenses/github.com/juju/mutex/go.mod b/test/integration/licenses/github.com/juju/mutex/go.mod deleted file mode 100644 index 448a60c46f..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/go.mod +++ /dev/null @@ -1,25 +0,0 @@ -module github.com/juju/mutex/v2 - -go 1.17 - -require ( - github.com/golang/mock v1.5.0 - github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 - github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c -) - -require ( - github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c // indirect - github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 // indirect - github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 // indirect - github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 // indirect - github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect - github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a // indirect - github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 // indirect - github.com/kr/pretty v0.2.1 // indirect - github.com/kr/text v0.2.0 // indirect - golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect - golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect -) diff --git a/test/integration/licenses/github.com/juju/mutex/go.sum b/test/integration/licenses/github.com/juju/mutex/go.sum deleted file mode 100644 index 60ab53e100..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/go.sum +++ /dev/null @@ -1,101 +0,0 @@ -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c h1:3UvYABOQRhJAApj9MdCN+Ydv841ETSoy6xLzdmmr/9A= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= -github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271 h1:4R626WTwa7pRYQFiIRLVPepMhm05eZMEx+wIurRnMLc= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= -github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 h1:EJHbsNpQyupmMeWTq7inn+5L/WZ7JfzCVPJ+DP9McCQ= -github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9/go.mod h1:TRm7EVGA3mQOqSVcBySRY7a9Y1/gyVhh/WTCnc5sD4U= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= -github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= -github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 h1:NO5tuyw++EGLnz56Q8KMyDZRwJwWO8jQnj285J3FOmY= -github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= -github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a h1:fFpWkIPzpzxd3CC+qfU5adsawpG371Ie4TmRkhxwyNU= -github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= -github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= -github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6/go.mod h1:QgWc2UdIPJ8t3rnvv95tFNOsQDfpXYEZDbP281o3b2c= -github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 h1:XEDzpuZb8Ma7vLja3+5hzUqVTvAqm5Y+ygvnDs5iTMM= -github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494/go.mod h1:rUquetT0ALL48LHZhyRGvjjBH8xZaZ8dFClulKK5wK4= -github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647 h1:wQpkHVbIIpz1PCcLYku9KFWsJ7aEMQXHBBmLy3tRBTk= -github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= -github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a h1:5ZWDCeCF0RaITrZGemzmDFIhjR/MVSvBUqgSyaeTMbE= -github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= -github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6 h1:nrqc9b4YKpKV4lPI3GPPFbo5FUuxkWxgZE2Z8O4lgaw= -github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 h1:wtEPbidt1VyHlb8RSztU6ySQj29FLsOQiI9XiJhXDM4= -github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23/go.mod h1:Ljlbryh9sYaUSGXucslAEDf0A2XUSGvDbHJgW8ps6nc= -github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= -github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= -github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= -golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -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/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= -gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= -gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= -gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -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= -launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= -launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= diff --git a/test/integration/licenses/github.com/juju/mutex/mutex.go b/test/integration/licenses/github.com/juju/mutex/mutex.go deleted file mode 100644 index 0cca9bb652..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/mutex.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package mutex - -import ( - "regexp" - "time" - - "github.com/juju/errors" -) - -var ( - validName = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]*$") -) - -// Releaser defines the Release method that is the only thing that can be done -// to a acquired mutex. -type Releaser interface { - // Release releases the mutex. Release may be called multiple times, but - // only the first call will release this instance of the mutex. Release is - // unable to release the mutex successfully it will call panic to forcibly - // release the mutex. - Release() -} - -// Clock provides an interface for dealing with clocks. -type Clock interface { - // After waits for the duration to elapse and then sends the - // current time on the returned channel. - After(time.Duration) <-chan time.Time - - // Now returns the current clock time. - Now() time.Time -} - -// Spec defines the name of the mutex and behaviour of the Acquire function. -type Spec struct { - // Name is required, and must start with a letter and contain at most - // 40 letters, numbers or dashes. - Name string - - // Clock must be provided and is exposed for testing purposes. - Clock Clock - - // Delay defines how often to check for lock acquisition, for - // compatibility code that requires polling. - Delay time.Duration - - // Timeout allows the caller to specify how long to wait. If Timeout - // is zero, then the call will block forever. - Timeout time.Duration - - // Cancel if signalled will cause the Acquire method to return with ErrCancelled. - Cancel <-chan struct{} -} - -// Acquire will attempt to acquire the named mutex. If the Timout value -// is hit, ErrTimeout is returned. If the Cancel channel is signalled, -// ErrCancelled is returned. -func Acquire(spec Spec) (Releaser, error) { - if err := spec.Validate(); err != nil { - return nil, errors.Trace(err) - } - - var timeout <-chan time.Time - if spec.Timeout > 0 { - timeout = spec.Clock.After(spec.Timeout) - } - - return acquire(spec, timeout) -} - -// Validate checks the attributes of Spec for validity. -func (s *Spec) Validate() error { - if len(s.Name) > 40 { - return errors.NotValidf("Name longer than 40 characters") - } - if !validName.MatchString(s.Name) { - return errors.NotValidf("Name %q", s.Name) - } - if s.Clock == nil { - return errors.NotValidf("missing Clock") - } - if s.Delay <= 0 { - return errors.NotValidf("non positive Delay") - } - if s.Timeout < 0 { - return errors.NotValidf("negative Timeout") - } - return nil -} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_flock.go b/test/integration/licenses/github.com/juju/mutex/mutex_flock.go deleted file mode 100644 index 73f76ccc25..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/mutex_flock.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2016-2017 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -//go:build !windows -// +build !windows - -package mutex - -import ( - "os" - "path/filepath" - "strconv" - "sync" - "syscall" - "time" - - "github.com/juju/errors" -) - -func acquire(spec Spec, timeout <-chan time.Time) (Releaser, error) { - done := make(chan struct{}) - defer close(done) - select { - case result := <-acquireFlock(spec.Name, done): - if result.err != nil { - return nil, errors.Trace(result.err) - } - return result.m, nil - case <-timeout: - return nil, ErrTimeout - case <-spec.Cancel: - return nil, ErrCancelled - } -} - -var envars Environment = osEnvironment{} - -var ( - mu sync.Mutex - active = make(map[string][]*waiter) -) - -type waiter struct { - ch chan<- acquireResult - done <-chan struct{} -} - -type acquireResult struct { - m Releaser - err error -} - -// acquireFlock returns a channel on which an acquireResult will be -// sent when the mutex acquisition completes, successfully or not. -// -// In Go, there is no natural way to cancel a flock syscall, so we -// allow a flock syscall to continue on even when there is nothing -// waiting for it, and then release the lock in that case. To avoid -// an unbounded collection of goroutines, we ensure that there is -// only one goroutine making a flock syscall at a time, per mutex -// name. -func acquireFlock(name string, done <-chan struct{}) <-chan acquireResult { - result := make(chan acquireResult) - w := &waiter{result, done} - - mu.Lock() - defer mu.Unlock() - if waiters, ok := active[name]; ok { - active[name] = append(waiters, w) - return result - } - - flockName := filepath.Join(os.TempDir(), "juju-"+name) - chownFromRoot := func() error { - if cmd, ok := envars.LookupEnv("SUDO_COMMAND"); ok && cmd != "" { - var uid, gid int - uid, err := strconv.Atoi(envars.Getenv("SUDO_UID")) - if err != nil { - return errors.Annotate(err, "parsing SUDO_UID") - } - gid, err = strconv.Atoi(envars.Getenv("SUDO_GID")) - if err != nil { - return errors.Annotate(err, "parsing SUDO_GID") - } - return syscall.Chown(flockName, uid, gid) - } - return nil - } - open := func() (int, error) { - fd, err := syscall.Open(flockName, syscall.O_CREAT|syscall.O_RDONLY|syscall.O_CLOEXEC, 0600) - if err != nil { - if os.IsPermission(err) { - err = errors.Annotatef(err, "unable to open %s", flockName) - } - return fd, err - } - // Attempting to open a lock file as root whilst using sudo can cause - // the lock file to have the wrong permissions for a non-sudo user. - // Subsequent calls to acquire the lock file can then lead to cryptic - // error messages. Let's attempt to help people out, either by - // correcting the permissions, or explaining why we can't help them. - // info: lp 1758369 - if chownErr := chownFromRoot(); chownErr != nil { - // The file has the wrong permissions, but we should let the acquire - // continue. - } - return fd, err - } - flock := func() (Releaser, error) { - fd, err := open() - if err != nil { - return nil, errors.Trace(err) - } - if err := syscall.Flock(fd, syscall.LOCK_EX); err != nil { - syscall.Close(fd) - return nil, errors.Trace(err) - } - return &mutex{fd: fd}, nil - } - acquire := func() bool { - releaser, err := flock() - result := acquireResult{releaser, err} - mu.Lock() - defer mu.Unlock() - - var sent bool - waiters := active[name] - for !sent && len(waiters) > 0 { - w, waiters = waiters[0], waiters[1:] - select { - case w.ch <- result: - sent = true - case <-w.done: - // waiter is done, so just - // remove it from the list - // and try the next one - } - } - if !sent && releaser != nil { - // No active waiters, release the lock. - releaser.Release() - } - if len(waiters) > 0 { - active[name] = waiters - return true - } - delete(active, name) - return false - } - go func() { - for acquire() { - } - }() - - active[name] = []*waiter{w} - return result -} - -// mutex implements Releaser using the flock syscall. -type mutex struct { - mu sync.Mutex - fd int -} - -// Release is part of the Releaser interface. -func (m *mutex) Release() { - m.mu.Lock() - defer m.mu.Unlock() - if m.fd == 0 { - return - } - err := syscall.Close(m.fd) - if err != nil { - panic(err) - } - m.fd = 0 -} - -// Environment defines a simple interface with interacting with environmental -// variables. -//go:generate mockgen -package mutex_test -destination mutex_mock_test.go github.com/juju/mutex Environment -type Environment interface { - - // LookupEnv retrieves the value of the environment variable named - // by the key. - LookupEnv(string) (string, bool) - - // Getenv retrieves the value of the environment variable named by the key. - Getenv(string) string -} - -// osEnvironment provides a default way to access environmental values to the -// acquire method. -type osEnvironment struct{} - -func (osEnvironment) LookupEnv(key string) (string, bool) { - return os.LookupEnv(key) -} - -func (osEnvironment) Getenv(key string) string { - return os.Getenv(key) -} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go b/test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go deleted file mode 100644 index ce34941b86..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/mutex_mock_test.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/juju/mutex (interfaces: Environment) - -// Package mutex_test is a generated GoMock package. -package mutex_test - -import ( - gomock "github.com/golang/mock/gomock" - reflect "reflect" -) - -// MockEnvironment is a mock of Environment interface -type MockEnvironment struct { - ctrl *gomock.Controller - recorder *MockEnvironmentMockRecorder -} - -// MockEnvironmentMockRecorder is the mock recorder for MockEnvironment -type MockEnvironmentMockRecorder struct { - mock *MockEnvironment -} - -// NewMockEnvironment creates a new mock instance -func NewMockEnvironment(ctrl *gomock.Controller) *MockEnvironment { - mock := &MockEnvironment{ctrl: ctrl} - mock.recorder = &MockEnvironmentMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockEnvironment) EXPECT() *MockEnvironmentMockRecorder { - return m.recorder -} - -// Getenv mocks base method -func (m *MockEnvironment) Getenv(arg0 string) string { - ret := m.ctrl.Call(m, "Getenv", arg0) - ret0, _ := ret[0].(string) - return ret0 -} - -// Getenv indicates an expected call of Getenv -func (mr *MockEnvironmentMockRecorder) Getenv(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Getenv", reflect.TypeOf((*MockEnvironment)(nil).Getenv), arg0) -} - -// LookupEnv mocks base method -func (m *MockEnvironment) LookupEnv(arg0 string) (string, bool) { - ret := m.ctrl.Call(m, "LookupEnv", arg0) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(bool) - return ret0, ret1 -} - -// LookupEnv indicates an expected call of LookupEnv -func (mr *MockEnvironmentMockRecorder) LookupEnv(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LookupEnv", reflect.TypeOf((*MockEnvironment)(nil).LookupEnv), arg0) -} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_test.go b/test/integration/licenses/github.com/juju/mutex/mutex_test.go deleted file mode 100644 index 8438cc70c8..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/mutex_test.go +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package mutex_test - -import ( - "fmt" - "net" - "os" - "os/exec" - "os/user" - "path/filepath" - "runtime" - "sync" - "sync/atomic" - "syscall" - "testing" - "time" - - "github.com/golang/mock/gomock" - - jt "github.com/juju/testing" - jc "github.com/juju/testing/checkers" - gc "gopkg.in/check.v1" - - "github.com/juju/mutex/v2" -) - -const ( - shortWait = 10 * time.Millisecond - longWait = 10 * shortWait - appWait = 5 * time.Second -) - -type mutexSuite struct{} - -var _ = gc.Suite(&mutexSuite{}) - -func (s *mutexSuite) TestSpecValidity(c *gc.C) { - for i, test := range []struct { - spec mutex.Spec - err string - }{{ - spec: mutex.Spec{Name: "", Clock: &fakeClock{}, Delay: time.Millisecond}, - err: `Name "" not valid`, - }, { - spec: mutex.Spec{Name: "42", Clock: &fakeClock{}, Delay: time.Millisecond}, - err: `Name "42" not valid`, - }, { - spec: mutex.Spec{Name: "a", Clock: &fakeClock{}, Delay: time.Millisecond}, - }, { - spec: mutex.Spec{Name: "a very very long name that is over the length limit", Clock: &fakeClock{}, Delay: time.Millisecond}, - err: `Name longer than 40 characters not valid`, - }, { - spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}, Delay: time.Millisecond}, - }, { - spec: mutex.Spec{Name: "with a space", Clock: &fakeClock{}, Delay: time.Millisecond}, - err: `Name "with a space" not valid`, - }, { - spec: mutex.Spec{Name: "test-42", Delay: time.Millisecond}, - err: `missing Clock not valid`, - }, { - spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}}, - err: `non positive Delay not valid`, - }, { - spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}, Delay: -time.Second}, - err: `non positive Delay not valid`, - }, { - spec: mutex.Spec{Name: "test-42", Clock: &fakeClock{}, Delay: time.Millisecond, Timeout: -time.Second}, - err: `negative Timeout not valid`, - }} { - c.Logf("test %d", i+1) - err := test.spec.Validate() - if test.err == "" { - c.Check(err, jc.ErrorIsNil) - } else { - c.Check(err, gc.ErrorMatches, test.err) - } - } -} - -func (s *mutexSuite) spec() mutex.Spec { - // On the off chance there are multiple tests running, we shouldn't - // clash on the lock name. - return mutex.Spec{ - Name: fmt.Sprintf("testing-%d", os.Getpid()), - Clock: &fakeClock{time.Millisecond}, - Delay: 10 * time.Second, - } -} - -func (s *mutexSuite) TestLockNoContention(c *gc.C) { - r, err := mutex.Acquire(s.spec()) - c.Assert(err, jc.ErrorIsNil) - r.Release() -} - -func (s *mutexSuite) TestLockContentionWithinProcessTimeout(c *gc.C) { - spec := s.spec() - spec.Timeout = time.Millisecond - - r, err := mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - defer r.Release() - - second, err := mutex.Acquire(spec) - c.Assert(second, gc.IsNil) - c.Assert(err, gc.Equals, mutex.ErrTimeout) -} - -func (s *mutexSuite) TestLockAfterTimeout(c *gc.C) { - spec := s.spec() - spec.Timeout = time.Nanosecond - - r, err := mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - defer r.Release() - - _, err = mutex.Acquire(spec) - c.Assert(err, gc.Equals, mutex.ErrTimeout) - - r.Release() - - r, err = mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - r.Release() -} - -func (s *mutexSuite) TestLockContentionWithinProcessCancel(c *gc.C) { - cancel := make(chan struct{}) - done := make(chan struct{}) - - spec := s.spec() - spec.Cancel = cancel - - r, err := mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - defer r.Release() - - go func() { - second, err := mutex.Acquire(spec) - c.Check(second, gc.IsNil) - c.Check(err, gc.Equals, mutex.ErrCancelled) - close(done) - }() - - close(cancel) - <-done -} - -func (s *mutexSuite) TestSecondReleaseFine(c *gc.C) { - r, err := mutex.Acquire(s.spec()) - c.Assert(err, jc.ErrorIsNil) - r.Release() - r.Release() -} - -func (s *mutexSuite) TestDifferentNamesDontBlock(c *gc.C) { - spec1 := s.spec() - spec2 := spec1 - spec2.Name = fmt.Sprintf("other-%d", os.Getpid()) - - r1, err := mutex.Acquire(spec1) - c.Assert(err, jc.ErrorIsNil) - defer r1.Release() - - r2, err := mutex.Acquire(spec2) - c.Assert(err, jc.ErrorIsNil) - defer r2.Release() -} - -func (s *mutexSuite) TestLockBlocks(c *gc.C) { - kill := make(chan struct{}) - spec := s.spec() - // this will block until the other process has the lock. - remote := LockFromAnotherProc(c, spec.Name, kill, true, true) - - acquired := make(chan struct{}) - done := make(chan struct{}) - go func() { - r, err := mutex.Acquire(spec) - if c.Check(err, gc.IsNil) { - close(acquired) - r.Release() - } - close(done) - }() - - // Waiting for something not to happen is inherently hard... - select { - case <-acquired: - c.Fatalf("Unexpected lock acquisition") - case <-time.After(shortWait * 2): - // all good. - } - close(kill) - <-done - <-remote -} - -func (s *mutexSuite) TestProcessReleasesWhenDead(c *gc.C) { - spec := s.spec() - kill := make(chan struct{}) - - // this will block until the other process has the lock. - remote := LockFromAnotherProc(c, spec.Name, kill, false, false) - - acquired := make(chan struct{}) - done := make(chan struct{}) - go func() { - r, err := mutex.Acquire(spec) - if c.Check(err, gc.IsNil) { - close(acquired) - r.Release() - } - close(done) - }() - - close(kill) - - select { - case <-acquired: - // all good. - case <-time.After(appWait): - c.Fatalf("timout waiting for mutex to be acquired") - } - <-done - <-remote -} - -func (s *mutexSuite) TestStress(c *gc.C) { - const lockAttempts = 200 - const concurrentLocks = 10 - - var counter = new(int64) - // Use atomics to update lockState to make sure the lock isn't held by - // someone else. A value of 1 means locked, 0 means unlocked. - var lockState = new(int32) - - var wg sync.WaitGroup - - spec := s.spec() - var stress = func() { - defer wg.Done() - for i := 0; i < lockAttempts; i++ { - r, err := mutex.Acquire(spec) - if !c.Check(err, jc.ErrorIsNil) { - return - } - state := atomic.AddInt32(lockState, 1) - if !c.Check(state, gc.Equals, int32(1)) { - return - } - // Tell the go routine scheduler to give a slice to someone else - // while we have this locked. - runtime.Gosched() - // need to decrement prior to unlock to avoid the race of someone - // else grabbing the lock before we decrement the state. - atomic.AddInt32(lockState, -1) - r.Release() - // increment the general counter - atomic.AddInt64(counter, 1) - } - } - - for i := 0; i < concurrentLocks; i++ { - wg.Add(1) - go stress() - } - wg.Wait() - c.Assert(*counter, gc.Equals, int64(lockAttempts*concurrentLocks)) -} - -// TestMutexNotInherited tests that subprocesses do not inherit mutexes. -func (s *mutexSuite) TestMutexNotInherited(c *gc.C) { - spec := s.spec() - r, err := mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - defer r.Release() - - kill := make(chan struct{}) - SleepFromAnotherProc(c, kill) - defer close(kill) - r.Release() - - // We should be able to acquire again now. - spec.Timeout = time.Nanosecond - r, err = mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - r.Release() -} - -// TestFilePermissions tests that the file permissions are correct. -func (s *mutexSuite) TestFilePermissions(c *gc.C) { - spec := s.spec() - r, err := mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - defer r.Release() - - filePath := filepath.Join(os.TempDir(), "juju-"+spec.Name) - fileInfo, err := os.Stat(filePath) - c.Assert(err, jc.ErrorIsNil) - - stat, ok := fileInfo.Sys().(*syscall.Stat_t) - c.Assert(ok, jc.IsTrue) - - current, err := user.Current() - c.Assert(err, jc.ErrorIsNil) - - c.Assert(fmt.Sprintf("%d", stat.Uid), gc.Equals, current.Uid) - c.Assert(fmt.Sprintf("%d", stat.Gid), gc.Equals, current.Gid) -} - -// TestFilePermissionsWithSudo tests that the file permissions are correct. -func (s *mutexSuite) TestFilePermissionsWithSudoEnvars(c *gc.C) { - ctrl := gomock.NewController(c) - defer ctrl.Finish() - - envion := NewMockEnvironment(ctrl) - - restore := jt.PatchValue(mutex.Envars, envion) - defer restore() - - current, err := user.Current() - c.Assert(err, jc.ErrorIsNil) - - exp := envion.EXPECT() - exp.LookupEnv("SUDO_COMMAND").Return("test", true) - exp.Getenv("SUDO_UID").Return(current.Uid) - exp.Getenv("SUDO_GID").Return(current.Gid) - - spec := s.spec() - r, err := mutex.Acquire(spec) - c.Assert(err, jc.ErrorIsNil) - defer r.Release() - - filePath := filepath.Join(os.TempDir(), "juju-"+spec.Name) - fileInfo, err := os.Stat(filePath) - c.Assert(err, jc.ErrorIsNil) - - stat, ok := fileInfo.Sys().(*syscall.Stat_t) - c.Assert(ok, jc.IsTrue) - - c.Assert(fmt.Sprintf("%d", stat.Uid), gc.Equals, current.Uid) - c.Assert(fmt.Sprintf("%d", stat.Gid), gc.Equals, current.Gid) -} - -// LockFromAnotherProc will launch a process and block until that process has -// created the lock file. If we time out waiting for the other process to take -// the lock, this function will fail the current test. -func LockFromAnotherProc(c *gc.C, name string, kill chan struct{}, wait, unlock bool) (done chan struct{}) { - listener, err := net.Listen("tcp", "localhost:0") - c.Assert(err, jc.ErrorIsNil) - defer listener.Close() - - cmd := exec.Command(os.Args[0], "-test.run", "TestLockFromOtherProcess") - cmd.Env = append( - // We must preserve os.Environ() on Windows, - // or the subprocess will fail in weird and - // wonderful ways. - os.Environ(), - "MUTEX_TEST_HELPER_WANTED=1", - "MUTEX_TEST_HELPER_NAME="+name, - "MUTEX_TEST_HELPER_ADDR="+listener.Addr().String(), - "MUTEX_TEST_HELPER_WAIT="+fmt.Sprint(unlock), - "MUTEX_TEST_HELPER_UNLOCK="+fmt.Sprint(unlock), - ) - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - if err := cmd.Start(); err != nil { - c.Fatalf("error starting other proc: %v", err) - } - - done = make(chan struct{}) - - go func() { - cmd.Wait() - close(done) - }() - - go func() { - select { - case <-kill: - // this may fail, but there's not much we can do about it - _ = cmd.Process.Kill() - case <-done: - } - }() - - haveLock := make(chan struct{}) - go func() { - conn, err := listener.Accept() - if c.Check(err, jc.ErrorIsNil) { - // Just close it, the signal is enough. - conn.Close() - close(haveLock) - } - }() - select { - case <-done: - c.Fatalf("other process failed before acquiring lock") - case <-haveLock: - // all good - case <-time.After(appWait): - c.Fatalf("other process failed to acquire lock") - } - - return done -} - -// SleepFromAnotherProc will launch a process and cause it to sleep -// for a minute, to prove that subprocesses do not inherit the mutex. -func SleepFromAnotherProc(c *gc.C, kill chan struct{}) (done chan struct{}) { - listener, err := net.Listen("tcp", "localhost:0") - c.Assert(err, jc.ErrorIsNil) - defer listener.Close() - - cmd := exec.Command(os.Args[0], "-test.run", "TestSleepFromOtherProcess") - cmd.Env = append( - // We must preserve os.Environ() on Windows, - // or the subprocess will fail in weird and - // wonderful ways. - os.Environ(), - "MUTEX_TEST_HELPER_WANTED=1", - "MUTEX_TEST_HELPER_ADDR="+listener.Addr().String(), - ) - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - c.Assert(cmd.Start(), jc.ErrorIsNil) - - done = make(chan struct{}) - go func() { - defer close(done) - cmd.Wait() - }() - go func() { - select { - case <-kill: - cmd.Process.Kill() - case <-done: - } - }() - - started := make(chan struct{}) - go func() { - conn, err := listener.Accept() - if c.Check(err, jc.ErrorIsNil) { - // Just close it, the signal is enough. - conn.Close() - close(started) - } - }() - select { - case <-started: - case <-done: - c.Fatalf("other process exited") - case <-time.After(appWait): - c.Fatalf("timed out waiting for other process to connect") - } - - return done -} - -func TestLockFromOtherProcess(t *testing.T) { - if os.Getenv("MUTEX_TEST_HELPER_WANTED") == "" { - return - } - - name := os.Getenv("MUTEX_TEST_HELPER_NAME") - unlock := os.Getenv("MUTEX_TEST_HELPER_UNLOCK") == "true" - wait := os.Getenv("MUTEX_TEST_HELPER_WAIT") == "true" - spec := mutex.Spec{ - Name: name, - Clock: &fakeClock{shortWait}, - Delay: shortWait, - } - - r, err := mutex.Acquire(spec) - if err != nil { - fmt.Fprintf(os.Stderr, "error acquiring mutex %q: %v", name, err) - os.Exit(1) - } - // Connect to the first process to let it know we have the connection. - addr := os.Getenv("MUTEX_TEST_HELPER_ADDR") - _, err = net.Dial("tcp", addr) - // We don't care about the connection because the server will just close the - // connection anyway. - if err != nil { - fmt.Fprintf(os.Stderr, "error notifying primary process: %v", err) - os.Exit(1) - } - - if wait { - time.Sleep(longWait) - } - if unlock { - r.Release() - } - os.Exit(0) -} - -func TestSleepFromOtherProcess(t *testing.T) { - if os.Getenv("MUTEX_TEST_HELPER_WANTED") == "" { - return - } - addr := os.Getenv("MUTEX_TEST_HELPER_ADDR") - _, err := net.Dial("tcp", addr) - if err != nil { - fmt.Fprintf(os.Stderr, "error notifying primary process: %v \n", err) - os.Exit(1) - } - time.Sleep(time.Minute) - os.Exit(0) -} - -type fakeClock struct { - delay time.Duration -} - -func (f *fakeClock) After(time.Duration) <-chan time.Time { - return time.After(f.delay) -} - -func (f *fakeClock) Now() time.Time { - return time.Now() -} diff --git a/test/integration/licenses/github.com/juju/mutex/mutex_windows.go b/test/integration/licenses/github.com/juju/mutex/mutex_windows.go deleted file mode 100644 index c4bba1ca2c..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/mutex_windows.go +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package mutex - -import ( - "runtime" - "sync" - "syscall" - "time" - "unsafe" - - "github.com/juju/errors" -) - -var ( - modkernel32 = syscall.NewLazyDLL("kernel32.dll") - procCreateMutex = modkernel32.NewProc("CreateMutexW") - procReleaseMutex = modkernel32.NewProc("ReleaseMutex") - procWaitForMultipleObjects = modkernel32.NewProc("WaitForMultipleObjects") - procCreateEvent = modkernel32.NewProc("CreateEventW") - procSetEvent = modkernel32.NewProc("SetEvent") -) - -const ( - _ERROR_ALREADY_EXISTS = 183 - _WAIT_OBJECT_0 = 0x00000000 - _WAIT_ABANDONED_0 = 0x00000080 - _WAIT_TIMEOUT = 0x00000102 - _INFINITE = 0xffffffff -) - -type mutex struct { - name string - mu sync.Mutex - release chan struct{} - released chan struct{} -} - -func acquire(spec Spec, timeoutCh <-chan time.Time) (Releaser, error) { - - // Avoid further work if the acquisition - // has already been cancelled. - select { - case <-spec.Cancel: - return nil, ErrCancelled - default: - } - - m := &mutex{ - name: spec.Name, - release: make(chan struct{}), - released: make(chan struct{}), - } - - releaseCh := m.release - errCh := make(chan error, 1) - go func() { - defer close(m.released) - - // ReleaseMutex must be called - // from the same OS thread that - // owns the mutex, i.e. the one - // that acquires it. - // - // Note that this also prevents - // any other goroutines from - // running on the same OS thread - // while the mutex is held, so - // we prevent reentrant lock - // acquisitions. - runtime.LockOSThread() - - handle, err := acquireMutex( - "juju-mutex-"+spec.Name, - spec.Timeout, - spec.Cancel, - ) - errCh <- err - if err != nil { - return - } - - // Wait until the mutex is Release()d, and - // then release and close the mutex. - <-releaseCh - - // NOTE(axw) it is not enough to just close - // the handle, it must be released first. - // It will only be abandoned when the OS - // thread underlying this goroutine exits. - // See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684266(v=vs.85).aspx - if err := releaseMutex(handle); err != nil { - panic(err) - } - if err := syscall.Close(handle); err != nil { - panic(err) - } - }() - if err := <-errCh; err != nil { - // The acquireMutex call failed, which means - // the goroutine will exit. Wait for it to - // clean up before returning. - <-m.released - return nil, err - } - return m, nil -} - -// Release implements Releaser. -func (m *mutex) Release() { - m.mu.Lock() - defer m.mu.Unlock() - if m.release != nil { - close(m.release) - m.release = nil - } - <-m.released -} - -func acquireMutex( - name string, - timeout time.Duration, - cancel <-chan struct{}, -) (syscall.Handle, error) { - mutexName, err := syscall.UTF16PtrFromString(name) - if err != nil { - return syscall.InvalidHandle, errors.Trace(err) - } - - result, _, errno := syscall.Syscall( - procCreateMutex.Addr(), 3, - uintptr(0), // attributes - uintptr(0), // initial owner - uintptr(unsafe.Pointer(mutexName)), - ) - if result == 0 { - if errno != 0 { - return syscall.InvalidHandle, errno - } - return syscall.InvalidHandle, syscall.EINVAL - } - - // Mutex was successfully created, or already exists. - // In either case, we don't own the mutex, and must - // wait for it below. - handle := syscall.Handle(result) - - handles := []syscall.Handle{handle} - if cancel != nil { - eventHandle, err := createEvent() - if err != nil { - return syscall.InvalidHandle, errors.Trace(err) - } - defer syscall.Close(eventHandle) - - // Put the event handle first, so - // cancellation takes precedence. - handles = []syscall.Handle{eventHandle, handle} - done := make(chan struct{}) - defer close(done) - go func() { - select { - case <-done: - case <-cancel: - setEvent(eventHandle) - } - }() - } - - if timeout == 0 { - // -1 indicates to waitForMultipleObjects - // that it should wait indefinitely. - timeout = -1 - } - i, err := waitForMultipleObjects(handles, timeout) - if err != nil { - syscall.Close(handle) - return syscall.InvalidHandle, err - } - if i+1 == len(handles) { - return handle, nil - } - syscall.Close(handle) - return syscall.InvalidHandle, ErrCancelled -} - -func releaseMutex(handle syscall.Handle) error { - result, _, errno := syscall.Syscall(procReleaseMutex.Addr(), 3, uintptr(handle), uintptr(1), 0) - if result == 0 { - if errno != 0 { - return errno - } - return syscall.EINVAL - } - return nil -} - -// waitForMultipleObjects calls the WaitForMultipleObjects Windows API, with the -// given handles and timeout. If the timeout value is negative, there is no timeout. -// -// The return value is the index of the handle that was signalled, or an error. -// -// See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms687025(v=vs.85).aspx -func waitForMultipleObjects(handles []syscall.Handle, timeout time.Duration) (int, error) { - timeoutMillis := uintptr(_INFINITE) - if timeout >= 0 { - timeoutMillis = uintptr(timeout.Seconds() * 1000) - } - result, _, errno := syscall.Syscall6( - procWaitForMultipleObjects.Addr(), 4, - uintptr(len(handles)), - uintptr(unsafe.Pointer(&handles[0])), - uintptr(0), // FALSE (don't wait for all) - timeoutMillis, - 0, 0, - ) - if result == _WAIT_TIMEOUT { - return -1, ErrTimeout - } - if result >= _WAIT_OBJECT_0 && result < uintptr(_WAIT_OBJECT_0+len(handles)) { - return int(result - _WAIT_OBJECT_0), nil - } - if result >= _WAIT_ABANDONED_0 && result < uintptr(_WAIT_ABANDONED_0+len(handles)) { - // The thread that owned the mutex exited without releasing the - // mutex. Ownership of the mutex is still granted as above. - return int(result - _WAIT_ABANDONED_0), nil - } - if errno != 0 { - return -1, errno - } - return -1, syscall.GetLastError() -} - -func createEvent() (syscall.Handle, error) { - result, _, errno := syscall.Syscall6( - procCreateEvent.Addr(), 4, - uintptr(0), // lpEventAttributes - uintptr(1), // bManualReset - uintptr(0), // bInitialState - uintptr(0), // lpName - 0, 0, - ) - if result == 0 { - if errno != 0 { - return syscall.Handle(0), errno - } - return syscall.Handle(0), syscall.EINVAL - } - return syscall.Handle(result), nil -} - -func setEvent(handle syscall.Handle) error { - result, _, errno := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(handle), 0, 0) - if result == 0 { - if errno != 0 { - return errno - } - return syscall.EINVAL - } - return nil -} diff --git a/test/integration/licenses/github.com/juju/mutex/package_test.go b/test/integration/licenses/github.com/juju/mutex/package_test.go deleted file mode 100644 index 3cd97b0ba4..0000000000 --- a/test/integration/licenses/github.com/juju/mutex/package_test.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 Canonical Ltd. -// Licensed under the LGPLv3, see LICENCE file for details. - -package mutex_test - -import ( - "testing" - - gc "gopkg.in/check.v1" -) - -func Test(t *testing.T) { - gc.TestingT(t) -} diff --git a/test/integration/licenses/github.com/kballard/go-shellquote/LICENSE b/test/integration/licenses/github.com/kballard/go-shellquote/LICENSE deleted file mode 100644 index a6d77312e1..0000000000 --- a/test/integration/licenses/github.com/kballard/go-shellquote/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014 Kevin Ballard - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE -OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/klauspost/compress/LICENSE b/test/integration/licenses/github.com/klauspost/compress/LICENSE deleted file mode 100644 index 87d5574777..0000000000 --- a/test/integration/licenses/github.com/klauspost/compress/LICENSE +++ /dev/null @@ -1,304 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. -Copyright (c) 2019 Klaus Post. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------- - -Files: gzhttp/* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016-2017 The New York Times Company - - 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. - ------------------- - -Files: s2/cmd/internal/readahead/* - -The MIT License (MIT) - -Copyright (c) 2015 Klaus Post - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - ---------------------- -Files: snappy/* -Files: internal/snapref/* - -Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------ - -Files: s2/cmd/internal/filepathx/* - -Copyright 2016 The filepathx Authors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE b/test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE deleted file mode 100644 index 6050c10f4c..0000000000 --- a/test/integration/licenses/github.com/klauspost/compress/internal/snapref/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt b/test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt deleted file mode 100644 index 24b53065f4..0000000000 --- a/test/integration/licenses/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2016 Caleb Spare - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/klauspost/cpuid/LICENSE b/test/integration/licenses/github.com/klauspost/cpuid/LICENSE deleted file mode 100644 index 5cec7ee949..0000000000 --- a/test/integration/licenses/github.com/klauspost/cpuid/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Klaus Post - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE b/test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/machine-drivers/docker-machine-driver-vmware/pkg/drivers/vmware/config/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/magiconair/properties/LICENSE.md b/test/integration/licenses/github.com/magiconair/properties/LICENSE.md deleted file mode 100644 index 79c87e3e6f..0000000000 --- a/test/integration/licenses/github.com/magiconair/properties/LICENSE.md +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2013-2020, Frank Schroeder - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/mailru/easyjson/LICENSE b/test/integration/licenses/github.com/mailru/easyjson/LICENSE deleted file mode 100644 index fbff658f70..0000000000 --- a/test/integration/licenses/github.com/mailru/easyjson/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2016 Mail.Ru Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mattn/go-colorable/LICENSE b/test/integration/licenses/github.com/mattn/go-colorable/LICENSE deleted file mode 100644 index 91b5cef30e..0000000000 --- a/test/integration/licenses/github.com/mattn/go-colorable/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Yasuhiro Matsumoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/test/integration/licenses/github.com/mattn/go-isatty/LICENSE b/test/integration/licenses/github.com/mattn/go-isatty/LICENSE deleted file mode 100644 index 65dc692b6b..0000000000 --- a/test/integration/licenses/github.com/mattn/go-isatty/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -Copyright (c) Yasuhiro MATSUMOTO - -MIT License (Expat) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mattn/go-runewidth/LICENSE b/test/integration/licenses/github.com/mattn/go-runewidth/LICENSE deleted file mode 100644 index 91b5cef30e..0000000000 --- a/test/integration/licenses/github.com/mattn/go-runewidth/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Yasuhiro Matsumoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE b/test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE deleted file mode 100644 index f9c841a51e..0000000000 --- a/test/integration/licenses/github.com/mitchellh/go-homedir/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Mitchell Hashimoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md b/test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md deleted file mode 100644 index 2298515904..0000000000 --- a/test/integration/licenses/github.com/mitchellh/go-ps/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mitchell Hashimoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE b/test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE deleted file mode 100644 index a3866a291f..0000000000 --- a/test/integration/licenses/github.com/mitchellh/go-testing-interface/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Mitchell Hashimoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md b/test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md deleted file mode 100644 index 2298515904..0000000000 --- a/test/integration/licenses/github.com/mitchellh/go-wordwrap/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mitchell Hashimoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE b/test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE deleted file mode 100644 index f9c841a51e..0000000000 --- a/test/integration/licenses/github.com/mitchellh/mapstructure/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Mitchell Hashimoto - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/moby/spdystream/LICENSE b/test/integration/licenses/github.com/moby/spdystream/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/moby/spdystream/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/moby/spdystream/NOTICE b/test/integration/licenses/github.com/moby/spdystream/NOTICE deleted file mode 100644 index b9b11c9ab7..0000000000 --- a/test/integration/licenses/github.com/moby/spdystream/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -SpdyStream -Copyright 2014-2021 Docker Inc. - -This product includes software developed at -Docker Inc. (https://www.docker.com/). diff --git a/test/integration/licenses/github.com/moby/sys/mount/LICENSE b/test/integration/licenses/github.com/moby/sys/mount/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/moby/sys/mount/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE b/test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/moby/sys/mountinfo/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/moby/term/LICENSE b/test/integration/licenses/github.com/moby/term/LICENSE deleted file mode 100644 index 6d8d58fb67..0000000000 --- a/test/integration/licenses/github.com/moby/term/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2013-2018 Docker, Inc. - - 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 - - https://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. diff --git a/test/integration/licenses/github.com/modern-go/concurrent/LICENSE b/test/integration/licenses/github.com/modern-go/concurrent/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/modern-go/concurrent/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/modern-go/reflect2/LICENSE b/test/integration/licenses/github.com/modern-go/reflect2/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/github.com/modern-go/reflect2/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/muesli/reflow/LICENSE b/test/integration/licenses/github.com/muesli/reflow/LICENSE deleted file mode 100644 index 8532c45c96..0000000000 --- a/test/integration/licenses/github.com/muesli/reflow/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Christian Muehlhaeuser - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/test/integration/licenses/github.com/munnerz/goautoneg/LICENSE b/test/integration/licenses/github.com/munnerz/goautoneg/LICENSE deleted file mode 100644 index bbc7b897cb..0000000000 --- a/test/integration/licenses/github.com/munnerz/goautoneg/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Copyright (c) 2011, Open Knowledge Foundation Ltd. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - Neither the name of the Open Knowledge Foundation Ltd. nor the - names of its contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md b/test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md deleted file mode 100644 index a0769b5c15..0000000000 --- a/test/integration/licenses/github.com/olekukonko/tablewriter/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014 by Oleku Konko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/opencontainers/go-digest/LICENSE b/test/integration/licenses/github.com/opencontainers/go-digest/LICENSE deleted file mode 100644 index 3ac8ab6487..0000000000 --- a/test/integration/licenses/github.com/opencontainers/go-digest/LICENSE +++ /dev/null @@ -1,192 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2019, 2020 OCI Contributors - Copyright 2016 Docker, Inc. - - 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 - - https://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. diff --git a/test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE b/test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE deleted file mode 100644 index 9fdc20fdb6..0000000000 --- a/test/integration/licenses/github.com/opencontainers/image-spec/specs-go/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2016 The Linux Foundation. - - 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. diff --git a/test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE b/test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE deleted file mode 100644 index 27448585ad..0000000000 --- a/test/integration/licenses/github.com/opencontainers/runc/libcontainer/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2014 Docker, Inc. - - 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. diff --git a/test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE b/test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE deleted file mode 100644 index 5c97abce4b..0000000000 --- a/test/integration/licenses/github.com/opencontainers/runc/libcontainer/NOTICE +++ /dev/null @@ -1,17 +0,0 @@ -runc - -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (http://www.docker.com). - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see http://www.bis.doc.gov - -See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE b/test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE deleted file mode 100644 index bdc403653e..0000000000 --- a/test/integration/licenses/github.com/opencontainers/runtime-spec/specs-go/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 The Linux Foundation. - - 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. diff --git a/test/integration/licenses/github.com/otiai10/copy/LICENSE b/test/integration/licenses/github.com/otiai10/copy/LICENSE deleted file mode 100644 index 1f0cc5dec7..0000000000 --- a/test/integration/licenses/github.com/otiai10/copy/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 otiai10 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE b/test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE deleted file mode 100644 index 6839d51cd4..0000000000 --- a/test/integration/licenses/github.com/pelletier/go-toml/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/test/integration/licenses/github.com/phayes/freeport/LICENSE.md b/test/integration/licenses/github.com/phayes/freeport/LICENSE.md deleted file mode 100644 index d9882e595e..0000000000 --- a/test/integration/licenses/github.com/phayes/freeport/LICENSE.md +++ /dev/null @@ -1,15 +0,0 @@ -Open Source License (BSD 3-Clause) ----------------------------------- - -Copyright (c) 2014, Patrick Hayes / HighWire Press -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/pkg/browser/LICENSE b/test/integration/licenses/github.com/pkg/browser/LICENSE deleted file mode 100644 index 65f78fb629..0000000000 --- a/test/integration/licenses/github.com/pkg/browser/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2014, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/pkg/errors/LICENSE b/test/integration/licenses/github.com/pkg/errors/LICENSE deleted file mode 100644 index 835ba3e755..0000000000 --- a/test/integration/licenses/github.com/pkg/errors/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2015, Dave Cheney -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/pkg/profile/LICENSE b/test/integration/licenses/github.com/pkg/profile/LICENSE deleted file mode 100644 index f747a8411e..0000000000 --- a/test/integration/licenses/github.com/pkg/profile/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2013 Dave Cheney. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt b/test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt deleted file mode 100644 index 5040f1ef80..0000000000 --- a/test/integration/licenses/github.com/rivo/uniseg/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Oliver Kuederle - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt b/test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt deleted file mode 100644 index 7fbb253a8e..0000000000 --- a/test/integration/licenses/github.com/russross/blackfriday/LICENSE.txt +++ /dev/null @@ -1,28 +0,0 @@ -Blackfriday is distributed under the Simplified BSD License: - -Copyright © 2011 Russ Ross -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided with - the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/samalba/dockerclient/LICENSE b/test/integration/licenses/github.com/samalba/dockerclient/LICENSE deleted file mode 100644 index 00e1edb90f..0000000000 --- a/test/integration/licenses/github.com/samalba/dockerclient/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 Sam Alba - - 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. - diff --git a/test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE b/test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE deleted file mode 100644 index 6f06adcbff..0000000000 --- a/test/integration/licenses/github.com/shirou/gopsutil/v3/LICENSE +++ /dev/null @@ -1,61 +0,0 @@ -gopsutil is distributed under BSD license reproduced below. - -Copyright (c) 2014, WAKAYAMA Shirou -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the gopsutil authors nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -------- -internal/common/binary.go in the gopsutil is copied and modified from golang/encoding/binary.go. - - - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/sirupsen/logrus/LICENSE b/test/integration/licenses/github.com/sirupsen/logrus/LICENSE deleted file mode 100644 index f090cb42f3..0000000000 --- a/test/integration/licenses/github.com/sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/spf13/afero/LICENSE.txt b/test/integration/licenses/github.com/spf13/afero/LICENSE.txt deleted file mode 100644 index 298f0e2665..0000000000 --- a/test/integration/licenses/github.com/spf13/afero/LICENSE.txt +++ /dev/null @@ -1,174 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/test/integration/licenses/github.com/spf13/cast/LICENSE b/test/integration/licenses/github.com/spf13/cast/LICENSE deleted file mode 100644 index 4527efb9c0..0000000000 --- a/test/integration/licenses/github.com/spf13/cast/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Steve Francia - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/spf13/cobra/LICENSE.txt b/test/integration/licenses/github.com/spf13/cobra/LICENSE.txt deleted file mode 100644 index 298f0e2665..0000000000 --- a/test/integration/licenses/github.com/spf13/cobra/LICENSE.txt +++ /dev/null @@ -1,174 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE b/test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE deleted file mode 100644 index 4527efb9c0..0000000000 --- a/test/integration/licenses/github.com/spf13/jwalterweatherman/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Steve Francia - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/spf13/pflag/LICENSE b/test/integration/licenses/github.com/spf13/pflag/LICENSE deleted file mode 100644 index 63ed1cfea1..0000000000 --- a/test/integration/licenses/github.com/spf13/pflag/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 Alex Ogier. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/spf13/viper/LICENSE b/test/integration/licenses/github.com/spf13/viper/LICENSE deleted file mode 100644 index 4527efb9c0..0000000000 --- a/test/integration/licenses/github.com/spf13/viper/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Steve Francia - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/test/integration/licenses/github.com/subosito/gotenv/LICENSE b/test/integration/licenses/github.com/subosito/gotenv/LICENSE deleted file mode 100644 index f64ccaedc3..0000000000 --- a/test/integration/licenses/github.com/subosito/gotenv/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Alif Rachmawadi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE b/test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE deleted file mode 100644 index cf198debc6..0000000000 --- a/test/integration/licenses/github.com/tklauser/go-sysconf/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2018-2021, Tobias Klauser -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/tklauser/numcpus/LICENSE b/test/integration/licenses/github.com/tklauser/numcpus/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/github.com/tklauser/numcpus/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/github.com/ulikunitz/xz/LICENSE b/test/integration/licenses/github.com/ulikunitz/xz/LICENSE deleted file mode 100644 index d32149979d..0000000000 --- a/test/integration/licenses/github.com/ulikunitz/xz/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2014-2020 Ulrich Kunitz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* My name, Ulrich Kunitz, may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE b/test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE deleted file mode 100644 index ca03685b15..0000000000 --- a/test/integration/licenses/github.com/vbatts/tar-split/archive/tar/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2015 Vincent Batts, Raleigh, NC, USA - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/github.com/xo/terminfo/LICENSE b/test/integration/licenses/github.com/xo/terminfo/LICENSE deleted file mode 100644 index 197dadb12c..0000000000 --- a/test/integration/licenses/github.com/xo/terminfo/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Anmol Sethi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/test/integration/licenses/go.opencensus.io/LICENSE b/test/integration/licenses/go.opencensus.io/LICENSE deleted file mode 100644 index 7a4a3ea242..0000000000 --- a/test/integration/licenses/go.opencensus.io/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. \ No newline at end of file diff --git a/test/integration/licenses/go.opentelemetry.io/otel/LICENSE b/test/integration/licenses/go.opentelemetry.io/otel/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/go.opentelemetry.io/otel/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE b/test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/go.opentelemetry.io/otel/sdk/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE b/test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/test/integration/licenses/go.opentelemetry.io/otel/trace/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/go.uber.org/atomic/LICENSE.txt b/test/integration/licenses/go.uber.org/atomic/LICENSE.txt deleted file mode 100644 index 8765c9fbc6..0000000000 --- a/test/integration/licenses/go.uber.org/atomic/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2016 Uber Technologies, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/go.uber.org/multierr/LICENSE.txt b/test/integration/licenses/go.uber.org/multierr/LICENSE.txt deleted file mode 100644 index 413e30f7ce..0000000000 --- a/test/integration/licenses/go.uber.org/multierr/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2017-2021 Uber Technologies, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/go.uber.org/zap/LICENSE.txt b/test/integration/licenses/go.uber.org/zap/LICENSE.txt deleted file mode 100644 index 6652bed45f..0000000000 --- a/test/integration/licenses/go.uber.org/zap/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2016-2017 Uber Technologies, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/test/integration/licenses/golang.org/x/crypto/LICENSE b/test/integration/licenses/golang.org/x/crypto/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/crypto/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/exp/ebnf/LICENSE b/test/integration/licenses/golang.org/x/exp/ebnf/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/exp/ebnf/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/mod/semver/LICENSE b/test/integration/licenses/golang.org/x/mod/semver/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/mod/semver/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/net/LICENSE b/test/integration/licenses/golang.org/x/net/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/net/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/oauth2/LICENSE b/test/integration/licenses/golang.org/x/oauth2/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/oauth2/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/sync/LICENSE b/test/integration/licenses/golang.org/x/sync/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/sync/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/sys/LICENSE b/test/integration/licenses/golang.org/x/sys/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/sys/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/term/LICENSE b/test/integration/licenses/golang.org/x/term/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/term/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/text/LICENSE b/test/integration/licenses/golang.org/x/text/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/text/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/time/rate/LICENSE b/test/integration/licenses/golang.org/x/time/rate/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/golang.org/x/time/rate/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/golang.org/x/xerrors/LICENSE b/test/integration/licenses/golang.org/x/xerrors/LICENSE deleted file mode 100644 index e4a47e17f1..0000000000 --- a/test/integration/licenses/golang.org/x/xerrors/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2019 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/google.golang.org/api/LICENSE b/test/integration/licenses/google.golang.org/api/LICENSE deleted file mode 100644 index 263aa7a0c1..0000000000 --- a/test/integration/licenses/google.golang.org/api/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE b/test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE deleted file mode 100644 index 7109c6ef93..0000000000 --- a/test/integration/licenses/google.golang.org/api/internal/third_party/uritemplates/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 Joshua Tacoma. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/google.golang.org/genproto/LICENSE b/test/integration/licenses/google.golang.org/genproto/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/google.golang.org/genproto/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/google.golang.org/grpc/LICENSE b/test/integration/licenses/google.golang.org/grpc/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/google.golang.org/grpc/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/google.golang.org/grpc/NOTICE.txt b/test/integration/licenses/google.golang.org/grpc/NOTICE.txt deleted file mode 100644 index 530197749e..0000000000 --- a/test/integration/licenses/google.golang.org/grpc/NOTICE.txt +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2014 gRPC 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. diff --git a/test/integration/licenses/google.golang.org/protobuf/LICENSE b/test/integration/licenses/google.golang.org/protobuf/LICENSE deleted file mode 100644 index 49ea0f9288..0000000000 --- a/test/integration/licenses/google.golang.org/protobuf/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2018 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/gopkg.in/inf.v0/LICENSE b/test/integration/licenses/gopkg.in/inf.v0/LICENSE deleted file mode 100644 index 87a5cede33..0000000000 --- a/test/integration/licenses/gopkg.in/inf.v0/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 Péter Surányi. Portions Copyright (c) 2009 The Go -Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/gopkg.in/ini.v1/LICENSE b/test/integration/licenses/gopkg.in/ini.v1/LICENSE deleted file mode 100644 index d361bbcdf5..0000000000 --- a/test/integration/licenses/gopkg.in/ini.v1/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright 2014 Unknwon - - 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. diff --git a/test/integration/licenses/gopkg.in/yaml.v2/LICENSE b/test/integration/licenses/gopkg.in/yaml.v2/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/test/integration/licenses/gopkg.in/yaml.v2/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/test/integration/licenses/gopkg.in/yaml.v2/NOTICE b/test/integration/licenses/gopkg.in/yaml.v2/NOTICE deleted file mode 100644 index 866d74a7ad..0000000000 --- a/test/integration/licenses/gopkg.in/yaml.v2/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2011-2016 Canonical Ltd. - -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. diff --git a/test/integration/licenses/gopkg.in/yaml.v3/LICENSE b/test/integration/licenses/gopkg.in/yaml.v3/LICENSE deleted file mode 100644 index 2683e4bb1f..0000000000 --- a/test/integration/licenses/gopkg.in/yaml.v3/LICENSE +++ /dev/null @@ -1,50 +0,0 @@ - -This project is covered by two different licenses: MIT and Apache. - -#### MIT License #### - -The following files were ported to Go from C files of libyaml, and thus -are still covered by their original MIT license, with the additional -copyright staring in 2011 when the project was ported over: - - apic.go emitterc.go parserc.go readerc.go scannerc.go - writerc.go yamlh.go yamlprivateh.go - -Copyright (c) 2006-2010 Kirill Simonov -Copyright (c) 2006-2011 Kirill Simonov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -### Apache License ### - -All the remaining project files are covered by the Apache license: - -Copyright (c) 2011-2019 Canonical Ltd - -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. diff --git a/test/integration/licenses/gopkg.in/yaml.v3/NOTICE b/test/integration/licenses/gopkg.in/yaml.v3/NOTICE deleted file mode 100644 index 866d74a7ad..0000000000 --- a/test/integration/licenses/gopkg.in/yaml.v3/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2011-2016 Canonical Ltd. - -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. diff --git a/test/integration/licenses/k8s.io/api/LICENSE b/test/integration/licenses/k8s.io/api/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/api/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE b/test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/apimachinery/pkg/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE b/test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/test/integration/licenses/k8s.io/apimachinery/third_party/forked/golang/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/k8s.io/client-go/LICENSE b/test/integration/licenses/k8s.io/client-go/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/client-go/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE b/test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/cluster-bootstrap/token/api/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/component-base/featuregate/LICENSE b/test/integration/licenses/k8s.io/component-base/featuregate/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/component-base/featuregate/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/klog/v2/LICENSE b/test/integration/licenses/k8s.io/klog/v2/LICENSE deleted file mode 100644 index 37ec93a14f..0000000000 --- a/test/integration/licenses/k8s.io/klog/v2/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE b/test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/kube-openapi/pkg/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE b/test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/kube-openapi/pkg/validation/spec/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE b/test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/test/integration/licenses/k8s.io/kubectl/pkg/util/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/test/integration/licenses/k8s.io/minikube/LICENSE b/test/integration/licenses/k8s.io/minikube/LICENSE deleted file mode 100644 index 21cb533d2d..0000000000 --- a/test/integration/licenses/k8s.io/minikube/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016 The Kubernetes Authors All rights reserved. - - 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. diff --git a/test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go b/test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go deleted file mode 100644 index 252450da2b..0000000000 --- a/test/integration/licenses/k8s.io/minikube/cmd/minikube/cmd/license.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors All rights reserved. - -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 cmd - -import ( - "github.com/spf13/cobra" - "k8s.io/minikube/pkg/minikube/download" - "k8s.io/minikube/pkg/minikube/exit" - "k8s.io/minikube/pkg/minikube/reason" -) - -var dir string - -// licenseCmd represents the credits command -var licenseCmd = &cobra.Command{ - Use: "license", - Short: "Outputs the licenses of dependencies to a directory", - Long: "Outputs the licenses of dependencies to a directory", - Run: func(cmd *cobra.Command, args []string) { - if err := download.Licenses(dir); err != nil { - exit.Error(reason.InetLicenses, "Failed to download licenses", err) - } - }, -} - -func init() { - licenseCmd.Flags().StringVarP(&dir, "dir", "d", ".", "Directory to output licenses to") -} diff --git a/test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go b/test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go deleted file mode 100644 index a5c6cb60fd..0000000000 --- a/test/integration/licenses/k8s.io/minikube/pkg/minikube/download/licenses.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors All rights reserved. - -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 download - -import ( - "fmt" - "io" - "net/http" - "os" - "os/exec" - - "k8s.io/minikube/pkg/version" -) - -func Licenses(dir string) error { - resp, err := http.Get(fmt.Sprintf("https://storage.googleapis.com/minikube/releases/%s/licenses.tar.gz", version.GetVersion())) - if err != nil { - return fmt.Errorf("failed to download licenses: %v", err) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("download request did not return a 200, received: %d", resp.StatusCode) - } - f, err := os.CreateTemp("", "licenses") - if err != nil { - return fmt.Errorf("failed to create file in tmp dir: %v", err) - } - defer os.Remove(f.Name()) - if _, err := io.Copy(f, resp.Body); err != nil { - return fmt.Errorf("failed to copy: %v", err) - } - if err := exec.Command("tar", "-xvzf", f.Name(), "-C", dir).Run(); err != nil { - return fmt.Errorf("failed to untar licenses: %v", err) - } - return nil -} diff --git a/test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE b/test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE deleted file mode 100644 index 707a0ed49b..0000000000 --- a/test/integration/licenses/k8s.io/minikube/third_party/go-dockerclient/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2013-2021, go-dockerclient authors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE b/test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE deleted file mode 100644 index 755d715d4f..0000000000 --- a/test/integration/licenses/k8s.io/minikube/third_party/go9p/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go9p Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * The names of Go9p's contributors may not be used to endorse -or promote products derived from this software without specific prior -written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/k8s.io/utils/LICENSE b/test/integration/licenses/k8s.io/utils/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/test/integration/licenses/k8s.io/utils/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE b/test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE deleted file mode 100644 index 7448756763..0000000000 --- a/test/integration/licenses/k8s.io/utils/internal/third_party/forked/golang/net/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/sigs.k8s.io/json/LICENSE b/test/integration/licenses/sigs.k8s.io/json/LICENSE deleted file mode 100644 index e5adf7f0c0..0000000000 --- a/test/integration/licenses/sigs.k8s.io/json/LICENSE +++ /dev/null @@ -1,238 +0,0 @@ -Files other than internal/golang/* licensed under: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. - - ------------------- - -internal/golang/* files licensed under: - - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE b/test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/test/integration/licenses/sigs.k8s.io/structured-merge-diff/v4/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/test/integration/licenses/sigs.k8s.io/yaml/LICENSE b/test/integration/licenses/sigs.k8s.io/yaml/LICENSE deleted file mode 100644 index 7805d36de7..0000000000 --- a/test/integration/licenses/sigs.k8s.io/yaml/LICENSE +++ /dev/null @@ -1,50 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Sam Ghods - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 796a4b800631db1c47c7563c53f874f84df30d1d Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 5 Dec 2022 02:16:15 +0000 Subject: [PATCH 03/44] cleanup --- pkg/minikube/cni/cilium.yaml | 778 ----------------------------------- 1 file changed, 778 deletions(-) delete mode 100644 pkg/minikube/cni/cilium.yaml diff --git a/pkg/minikube/cni/cilium.yaml b/pkg/minikube/cni/cilium.yaml deleted file mode 100644 index d9a4442c2c..0000000000 --- a/pkg/minikube/cni/cilium.yaml +++ /dev/null @@ -1,778 +0,0 @@ ---- -# Source: cilium/templates/cilium-agent-serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: cilium - namespace: kube-system ---- -# Source: cilium/templates/cilium-operator-serviceaccount.yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: cilium-operator - namespace: kube-system ---- -# Source: cilium/templates/cilium-configmap.yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: cilium-config - namespace: kube-system -data: - - # Identity allocation mode selects how identities are shared between cilium - # nodes by setting how they are stored. The options are "crd" or "kvstore". - # - "crd" stores identities in kubernetes as CRDs (custom resource definition). - # These can be queried with: - # kubectl get ciliumid - # - "kvstore" stores identities in a kvstore, etcd or consul, that is - # configured below. Cilium versions before 1.6 supported only the kvstore - # backend. Upgrades from these older cilium versions should continue using - # the kvstore by commenting out the identity-allocation-mode below, or - # setting it to "kvstore". - identity-allocation-mode: crd - cilium-endpoint-gc-interval: "5m0s" - - # If you want to run cilium in debug mode change this value to true - debug: "false" - # The agent can be put into the following three policy enforcement modes - # default, always and never. - # https://docs.cilium.io/en/latest/policy/intro/#policy-enforcement-modes - enable-policy: "default" - - # Enable IPv4 addressing. If enabled, all endpoints are allocated an IPv4 - # address. - enable-ipv4: "true" - - # Enable IPv6 addressing. If enabled, all endpoints are allocated an IPv6 - # address. - enable-ipv6: "false" - # Users who wish to specify their own custom CNI configuration file must set - # custom-cni-conf to "true", otherwise Cilium may overwrite the configuration. - custom-cni-conf: "false" - enable-bpf-clock-probe: "true" - # If you want cilium monitor to aggregate tracing for packets, set this level - # to "low", "medium", or "maximum". The higher the level, the less packets - # that will be seen in monitor output. - monitor-aggregation: medium - - # The monitor aggregation interval governs the typical time between monitor - # notification events for each allowed connection. - # - # Only effective when monitor aggregation is set to "medium" or higher. - monitor-aggregation-interval: 5s - - # The monitor aggregation flags determine which TCP flags which, upon the - # first observation, cause monitor notifications to be generated. - # - # Only effective when monitor aggregation is set to "medium" or higher. - monitor-aggregation-flags: all - # Specifies the ratio (0.0-1.0) of total system memory to use for dynamic - # sizing of the TCP CT, non-TCP CT, NAT and policy BPF maps. - bpf-map-dynamic-size-ratio: "0.0025" - # bpf-policy-map-max specifies the maximum number of entries in endpoint - # policy map (per endpoint) - bpf-policy-map-max: "16384" - # bpf-lb-map-max specifies the maximum number of entries in bpf lb service, - # backend and affinity maps. - bpf-lb-map-max: "65536" - # Pre-allocation of map entries allows per-packet latency to be reduced, at - # the expense of up-front memory allocation for the entries in the maps. The - # default value below will minimize memory usage in the default installation; - # users who are sensitive to latency may consider setting this to "true". - # - # This option was introduced in Cilium 1.4. Cilium 1.3 and earlier ignore - # this option and behave as though it is set to "true". - # - # If this value is modified, then during the next Cilium startup the restore - # of existing endpoints and tracking of ongoing connections may be disrupted. - # As a result, reply packets may be dropped and the load-balancing decisions - # for established connections may change. - # - # If this option is set to "false" during an upgrade from 1.3 or earlier to - # 1.4 or later, then it may cause one-time disruptions during the upgrade. - preallocate-bpf-maps: "false" - - # Regular expression matching compatible Istio sidecar istio-proxy - # container image names - sidecar-istio-proxy-image: "cilium/istio_proxy" - - # Name of the cluster. Only relevant when building a mesh of clusters. - cluster-name: cluster - # Unique ID of the cluster. Must be unique across all conneted clusters and - # in the range of 1 and 255. Only relevant when building a mesh of clusters. - cluster-id: "1" - - # Encapsulation mode for communication between nodes - # Possible values: - # - disabled - # - vxlan (default) - # - geneve - tunnel: vxlan - # Enables L7 proxy for L7 policy enforcement and visibility - enable-l7-proxy: "true" - - # wait-bpf-mount makes init container wait until bpf filesystem is mounted - wait-bpf-mount: "false" - - masquerade: "true" - enable-bpf-masquerade: "true" - - enable-xt-socket-fallback: "true" - install-iptables-rules: "true" - - auto-direct-node-routes: "false" - enable-bandwidth-manager: "false" - enable-local-redirect-policy: "false" - kube-proxy-replacement: "probe" - kube-proxy-replacement-healthz-bind-address: "" - enable-health-check-nodeport: "true" - node-port-bind-protection: "true" - enable-auto-protect-node-port-range: "true" - enable-session-affinity: "true" - k8s-require-ipv4-pod-cidr: "true" - k8s-require-ipv6-pod-cidr: "false" - enable-endpoint-health-checking: "true" - enable-health-checking: "true" - enable-well-known-identities: "false" - enable-remote-node-identity: "true" - operator-api-serve-addr: "127.0.0.1:9234" - # Enable Hubble gRPC service. - enable-hubble: "true" - # UNIX domain socket for Hubble server to listen to. - hubble-socket-path: "/var/run/cilium/hubble.sock" - # An additional address for Hubble server to listen to (e.g. ":4244"). - hubble-listen-address: ":4244" - hubble-disable-tls: "false" - hubble-tls-cert-file: /var/lib/cilium/tls/hubble/server.crt - hubble-tls-key-file: /var/lib/cilium/tls/hubble/server.key - hubble-tls-client-ca-files: /var/lib/cilium/tls/hubble/client-ca.crt - ipam: "cluster-pool" - cluster-pool-ipv4-cidr: "{{.PodSubnet }}" - cluster-pool-ipv4-mask-size: "24" - disable-cnp-status-updates: "true" - cgroup-root: "/run/cilium/cgroupv2" ---- -# Source: cilium/templates/cilium-agent-clusterrole.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cilium -rules: -- apiGroups: - - networking.k8s.io - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: - - discovery.k8s.io - resources: - - endpointslices - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - namespaces - - services - - nodes - - endpoints - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - pods - - pods/finalizers - verbs: - - get - - list - - watch - - update - - delete -- apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - watch - - update -- apiGroups: - - "" - resources: - - nodes - - nodes/status - verbs: - - patch -- apiGroups: - - apiextensions.k8s.io - resources: - - customresourcedefinitions - verbs: - # Deprecated for removal in v1.10 - - create - - list - - watch - - update - - # This is used when validating policies in preflight. This will need to stay - # until we figure out how to avoid "get" inside the preflight, and then - # should be removed ideally. - - get -- apiGroups: - - cilium.io - resources: - - ciliumnetworkpolicies - - ciliumnetworkpolicies/status - - ciliumnetworkpolicies/finalizers - - ciliumclusterwidenetworkpolicies - - ciliumclusterwidenetworkpolicies/status - - ciliumclusterwidenetworkpolicies/finalizers - - ciliumendpoints - - ciliumendpoints/status - - ciliumendpoints/finalizers - - ciliumnodes - - ciliumnodes/status - - ciliumnodes/finalizers - - ciliumidentities - - ciliumidentities/finalizers - - ciliumlocalredirectpolicies - - ciliumlocalredirectpolicies/status - - ciliumlocalredirectpolicies/finalizers - verbs: - - '*' ---- -# Source: cilium/templates/cilium-operator-clusterrole.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cilium-operator -rules: -- apiGroups: - - "" - resources: - # to automatically delete [core|kube]dns pods so that are starting to being - # managed by Cilium - - pods - verbs: - - get - - list - - watch - - delete - - apiGroups: - - "" - resources: - - nodes - verbs: - - list - - watch -- apiGroups: - - "" - resources: - # To remove node taints - - nodes - # To set NetworkUnavailable false on startup - - nodes/status - verbs: - - patch -- apiGroups: - - discovery.k8s.io - resources: - - endpointslices - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - # to perform the translation of a CNP that contains 'ToGroup' to its endpoints - - services - - endpoints - # to check apiserver connectivity - - namespaces - verbs: - - get - - list - - watch -- apiGroups: - - cilium.io - resources: - - ciliumnetworkpolicies - - ciliumnetworkpolicies/status - - ciliumnetworkpolicies/finalizers - - ciliumclusterwidenetworkpolicies - - ciliumclusterwidenetworkpolicies/status - - ciliumclusterwidenetworkpolicies/finalizers - - ciliumendpoints - - ciliumendpoints/status - - ciliumendpoints/finalizers - - ciliumnodes - - ciliumnodes/status - - ciliumnodes/finalizers - - ciliumidentities - - ciliumidentities/status - - ciliumidentities/finalizers - - ciliumlocalredirectpolicies - - ciliumlocalredirectpolicies/status - - ciliumlocalredirectpolicies/finalizers - verbs: - - '*' -- apiGroups: - - apiextensions.k8s.io - resources: - - customresourcedefinitions - verbs: - - create - - get - - list - - update - - watch -# For cilium-operator running in HA mode. -# -# Cilium operator running in HA mode requires the use of ResourceLock for Leader Election -# between multiple running instances. -# The preferred way of doing this is to use LeasesResourceLock as edits to Leases are less -# common and fewer objects in the cluster watch "all Leases". -# The support for leases was introduced in coordination.k8s.io/v1 during Kubernetes 1.14 release. -# In Cilium we currently don't support HA mode for K8s version < 1.14. This condition make sure -# that we only authorize access to leases resources in supported K8s versions. -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - create - - get - - update ---- -# Source: cilium/templates/cilium-agent-clusterrolebinding.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: cilium -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cilium -subjects: -- kind: ServiceAccount - name: cilium - namespace: kube-system ---- -# Source: cilium/templates/cilium-operator-clusterrolebinding.yaml -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: cilium-operator -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cilium-operator -subjects: -- kind: ServiceAccount - name: cilium-operator - namespace: kube-system ---- -# Source: cilium/templates/cilium-agent-daemonset.yaml -apiVersion: apps/v1 -kind: DaemonSet -metadata: - labels: - k8s-app: cilium - name: cilium - namespace: kube-system -spec: - selector: - matchLabels: - k8s-app: cilium - updateStrategy: - rollingUpdate: - maxUnavailable: 2 - type: RollingUpdate - template: - metadata: - annotations: - # This annotation plus the CriticalAddonsOnly toleration makes - # cilium to be a critical pod in the cluster, which ensures cilium - # gets priority scheduling. - # https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/ - scheduler.alpha.kubernetes.io/critical-pod: "" - labels: - k8s-app: cilium - spec: - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: k8s-app - operator: In - values: - - cilium - topologyKey: kubernetes.io/hostname - containers: - - args: - - --config-dir=/tmp/cilium/config-map - command: - - cilium-agent - livenessProbe: - httpGet: - host: '127.0.0.1' - path: /healthz - port: 9879 - scheme: HTTP - httpHeaders: - - name: "brief" - value: "true" - failureThreshold: 10 - # The initial delay for the liveness probe is intentionally large to - # avoid an endless kill & restart cycle if in the event that the initial - # bootstrapping takes longer than expected. - initialDelaySeconds: 120 - periodSeconds: 30 - successThreshold: 1 - timeoutSeconds: 5 - readinessProbe: - httpGet: - host: '127.0.0.1' - path: /healthz - port: 9879 - scheme: HTTP - httpHeaders: - - name: "brief" - value: "true" - failureThreshold: 3 - initialDelaySeconds: 5 - periodSeconds: 30 - successThreshold: 1 - timeoutSeconds: 5 - env: - - name: K8S_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: CILIUM_K8S_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - - name: CILIUM_FLANNEL_MASTER_DEVICE - valueFrom: - configMapKeyRef: - key: flannel-master-device - name: cilium-config - optional: true - - name: CILIUM_FLANNEL_UNINSTALL_ON_EXIT - valueFrom: - configMapKeyRef: - key: flannel-uninstall-on-exit - name: cilium-config - optional: true - - name: CILIUM_CLUSTERMESH_CONFIG - value: /var/lib/cilium/clustermesh/ - - name: CILIUM_CNI_CHAINING_MODE - valueFrom: - configMapKeyRef: - key: cni-chaining-mode - name: cilium-config - optional: true - - name: CILIUM_CUSTOM_CNI_CONF - valueFrom: - configMapKeyRef: - key: custom-cni-conf - name: cilium-config - optional: true - image: "quay.io/cilium/cilium:v1.12.3@sha256:30de50c4dc0a1e1077e9e7917a54d5cab253058b3f779822aec00f5c817ca826" - imagePullPolicy: IfNotPresent - lifecycle: - postStart: - exec: - command: - - "/cni-install.sh" - - "--enable-debug=false" - preStop: - exec: - command: - - /cni-uninstall.sh - name: cilium-agent - securityContext: - capabilities: - add: - - NET_ADMIN - - SYS_MODULE - privileged: true - volumeMounts: - - mountPath: /sys/fs/bpf - name: bpf-maps - - mountPath: /var/run/cilium - name: cilium-run - - mountPath: /host/opt/cni/bin - name: cni-path - - mountPath: /host/etc/cni/net.d - name: etc-cni-netd - - mountPath: /var/lib/cilium/clustermesh - name: clustermesh-secrets - readOnly: true - - mountPath: /tmp/cilium/config-map - name: cilium-config-path - readOnly: true - # Needed to be able to load kernel modules - - mountPath: /lib/modules - name: lib-modules - readOnly: true - - mountPath: /run/xtables.lock - name: xtables-lock - - mountPath: /var/lib/cilium/tls/hubble - name: hubble-tls - readOnly: true - hostNetwork: true - initContainers: - # Required to mount cgroup2 filesystem on the underlying Kubernetes node. - # We use nsenter command with host's cgroup and mount namespaces enabled. - - name: mount-cgroup - env: - - name: CGROUP_ROOT - value: /run/cilium/cgroupv2 - - name: BIN_PATH - value: /opt/cni/bin - command: - - sh - - -c - # The statically linked Go program binary is invoked to avoid any - # dependency on utilities like sh and mount that can be missing on certain - # distros installed on the underlying host. Copy the binary to the - # same directory where we install cilium cni plugin so that exec permissions - # are available. - - 'cp /usr/bin/cilium-mount /hostbin/cilium-mount && nsenter --cgroup=/hostproc/1/ns/cgroup --mount=/hostproc/1/ns/mnt "${BIN_PATH}/cilium-mount" $CGROUP_ROOT; rm /hostbin/cilium-mount' - image: "quay.io/cilium/cilium:v1.12.3@sha256:30de50c4dc0a1e1077e9e7917a54d5cab253058b3f779822aec00f5c817ca826" - imagePullPolicy: IfNotPresent - volumeMounts: - - mountPath: /hostproc - name: hostproc - - mountPath: /hostbin - name: cni-path - securityContext: - privileged: true - - command: - - /init-container.sh - env: - - name: CILIUM_ALL_STATE - valueFrom: - configMapKeyRef: - key: clean-cilium-state - name: cilium-config - optional: true - - name: CILIUM_BPF_STATE - valueFrom: - configMapKeyRef: - key: clean-cilium-bpf-state - name: cilium-config - optional: true - - name: CILIUM_WAIT_BPF_MOUNT - valueFrom: - configMapKeyRef: - key: wait-bpf-mount - name: cilium-config - optional: true - image: "quay.io/cilium/cilium:v1.12.3@sha256:30de50c4dc0a1e1077e9e7917a54d5cab253058b3f779822aec00f5c817ca826" - imagePullPolicy: IfNotPresent - name: clean-cilium-state - securityContext: - capabilities: - add: - - NET_ADMIN - privileged: true - volumeMounts: - - mountPath: /sys/fs/bpf - name: bpf-maps - mountPropagation: HostToContainer - # Required to mount cgroup filesystem from the host to cilium agent pod - - mountPath: /run/cilium/cgroupv2 - name: cilium-cgroup - mountPropagation: HostToContainer - - mountPath: /var/run/cilium - name: cilium-run - resources: - requests: - cpu: 100m - memory: 100Mi - restartPolicy: Always - priorityClassName: system-node-critical - serviceAccount: cilium - serviceAccountName: cilium - terminationGracePeriodSeconds: 1 - tolerations: - - operator: Exists - volumes: - # To keep state between restarts / upgrades - - hostPath: - path: /var/run/cilium - type: DirectoryOrCreate - name: cilium-run - # To keep state between restarts / upgrades for bpf maps - - hostPath: - path: /sys/fs/bpf - type: DirectoryOrCreate - name: bpf-maps - # To mount cgroup2 filesystem on the host - - hostPath: - path: /proc - type: Directory - name: hostproc - # To keep state between restarts / upgrades for cgroup2 filesystem - - hostPath: - path: /run/cilium/cgroupv2 - type: DirectoryOrCreate - name: cilium-cgroup - # To install cilium cni plugin in the host - - hostPath: - path: /opt/cni/bin - type: DirectoryOrCreate - name: cni-path - # To install cilium cni configuration in the host - - hostPath: - path: /etc/cni/net.d - type: DirectoryOrCreate - name: etc-cni-netd - # To be able to load kernel modules - - hostPath: - path: /lib/modules - name: lib-modules - # To access iptables concurrently with other processes (e.g. kube-proxy) - - hostPath: - path: /run/xtables.lock - type: FileOrCreate - name: xtables-lock - # To read the clustermesh configuration - - name: clustermesh-secrets - secret: - defaultMode: 420 - optional: true - secretName: cilium-clustermesh - # To read the configuration from the config map - - configMap: - name: cilium-config - name: cilium-config-path - - name: hubble-tls - projected: - sources: - - secret: - name: hubble-server-certs - items: - - key: tls.crt - path: server.crt - - key: tls.key - path: server.key - optional: true - - configMap: - name: hubble-ca-cert - items: - - key: ca.crt - path: client-ca.crt - optional: true ---- -# Source: cilium/templates/cilium-operator-deployment.yaml -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - io.cilium/app: operator - name: cilium-operator - name: cilium-operator - namespace: kube-system -spec: - # We support HA mode only for Kubernetes version > 1.14 - # See docs on ServerCapabilities.LeasesResourceLock in file pkg/k8s/version/version.go - # for more details. - replicas: 1 - selector: - matchLabels: - io.cilium/app: operator - name: cilium-operator - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - type: RollingUpdate - template: - metadata: - annotations: - labels: - io.cilium/app: operator - name: cilium-operator - spec: - # In HA mode, cilium-operator pods must not be scheduled on the same - # node as they will clash with each other. - affinity: - podAntiAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: io.cilium/app - operator: In - values: - - operator - topologyKey: kubernetes.io/hostname - containers: - - args: - - --config-dir=/tmp/cilium/config-map - - --debug=$(CILIUM_DEBUG) - command: - - cilium-operator-generic - env: - - name: K8S_NODE_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: spec.nodeName - - name: CILIUM_K8S_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - - name: CILIUM_DEBUG - valueFrom: - configMapKeyRef: - key: debug - name: cilium-config - optional: true - image: "quay.io/cilium/operator-generic:v1.12.3@sha256:816ec1da586139b595eeb31932c61a7c13b07fb4a0255341c0e0f18608e84eff" - imagePullPolicy: IfNotPresent - name: cilium-operator - livenessProbe: - httpGet: - host: '127.0.0.1' - path: /healthz - port: 9234 - scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 10 - timeoutSeconds: 3 - volumeMounts: - - mountPath: /tmp/cilium/config-map - name: cilium-config-path - readOnly: true - hostNetwork: true - restartPolicy: Always - priorityClassName: system-cluster-critical - serviceAccount: cilium-operator - serviceAccountName: cilium-operator - tolerations: - - operator: Exists - volumes: - # To read the configuration from the config map - - configMap: - name: cilium-config - name: cilium-config-path From bd7efa03f945279d3626f60dbac653a743b28b49 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 7 Dec 2022 01:20:57 +0000 Subject: [PATCH 04/44] fix additional issues found --- pkg/drivers/kic/oci/network_create.go | 1 + pkg/drivers/kvm/network.go | 27 +++++++++++---------- pkg/minikube/cni/bridge.go | 3 ++- pkg/minikube/cni/cni.go | 35 +++++++++++++++------------ pkg/minikube/cruntime/docker.go | 9 ++++--- pkg/network/network.go | 14 +++++------ test/integration/helpers_test.go | 6 +++-- test/integration/net_test.go | 5 +++- test/integration/util_test.go | 2 +- 9 files changed, 58 insertions(+), 44 deletions(-) diff --git a/pkg/drivers/kic/oci/network_create.go b/pkg/drivers/kic/oci/network_create.go index aaccbe651b..dc764ecff7 100644 --- a/pkg/drivers/kic/oci/network_create.go +++ b/pkg/drivers/kic/oci/network_create.go @@ -137,6 +137,7 @@ func tryCreateDockerNetwork(ociBin string, subnet *network.Parameters, mtu int, rr, err := runCmd(exec.Command(ociBin, args...)) if err != nil { + klog.Errorf("failed to create %s network %s %s with gateway %s and MTU of %d: %v", ociBin, name, subnet.CIDR, subnet.Gateway, mtu, err) // Pool overlaps with other one on this address space if strings.Contains(rr.Output(), "Pool overlaps") { return nil, ErrNetworkSubnetTaken diff --git a/pkg/drivers/kvm/network.go b/pkg/drivers/kvm/network.go index 08731512c3..08215df2cd 100644 --- a/pkg/drivers/kvm/network.go +++ b/pkg/drivers/kvm/network.go @@ -477,19 +477,20 @@ func ifListFromAPI(conn *libvirt.Connect, domain string) ([]libvirt.DomainInterf } defer func() { _ = dom.Free() }() - ifs, err := dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_ARP) - if ifs == nil { - if err != nil { - log.Debugf("failed listing network interface addresses of domain %s(source=arp): %w", domain, err) - } else { - log.Debugf("No network interface addresses found for domain %s(source=arp)", domain) - } - log.Debugf("trying to list again with source=lease") - - ifs, err = dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE) - if err != nil { - return nil, fmt.Errorf("failed listing network interface addresses of domain %s(source=lease): %w", domain, err) - } + // check lease first, then arp + // ref: https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceAddresses + ifs, err := dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE) + if err == nil && len(ifs) > 0 { + return ifs, nil + } + if err != nil { + log.Debugf("failed listing network interface addresses of domain %s using lease (will try arp): %v", domain, err) + } else if len(ifs) == 0 { + log.Debugf("no network interface addresses found for domain %s using lease (will try arp)", domain) + } + ifs, err = dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_ARP) + if err != nil { + return nil, fmt.Errorf("failed listing network interface addresses of domain %s using arp: %w", domain, err) } return ifs, nil diff --git a/pkg/minikube/cni/bridge.go b/pkg/minikube/cni/bridge.go index eb736abe2d..c0d38b90e2 100644 --- a/pkg/minikube/cni/bridge.go +++ b/pkg/minikube/cni/bridge.go @@ -28,7 +28,8 @@ import ( ) // bridge is what minikube defaulted to when `--enable-default-cni=true` -// https://github.com/containernetworking/plugins/blob/master/plugins/main/bridge/README.md +// ref: https://www.cni.dev/plugins/current/main/bridge/ +// ref: https://www.cni.dev/plugins/current/meta/portmap/ var bridgeConf = template.Must(template.New("bridge").Parse(` { diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index efdbab60a2..e4201e0e41 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -188,9 +188,9 @@ func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) err } if driver.IsKIC(cc.Driver) { - klog.Info("disabling CRIO bridge for Docker driver ...") + klog.Infof("disabling cri-o bridge for %s driver ... ", cc.Driver) if err := disableCrioBridge(r); err != nil { - klog.Warningf("disabling CRIO bridge for Docker driver: %v", err) + klog.Warningf("unable to disable cri-o bridge for %s driver: %v", cc.Driver, err) } } @@ -244,8 +244,6 @@ func configureCNI(cc *config.ClusterConfig, cnm Manager) error { // respect user-specified custom CNI Config Directory ConfDir = cc.KubernetesConfig.ExtraOptions.Get("cni-conf-dir", "kubelet") } - } else { - ConfDir = CustomConfDir } } return nil @@ -257,25 +255,32 @@ func configureCNI(cc *config.ClusterConfig, cnm Manager) error { // Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "..." network for pod "...": networkPlugin cni failed to set up pod "..." network: missing network name:, // failed to clean up sandbox container "..." network for pod "...": networkPlugin cni failed to teardown pod "..." network: missing network name] func NameLoopback(r Runner) error { - loopback := "/etc/cni/net.d/*loopback.conf" // usually: 200-loopback.conf + loopback := "/etc/cni/net.d/*loopback.conf*" // usually: 200-loopback.conf // turn { "cniVersion": "0.3.1", "type": "loopback" } // into { "cniVersion": "0.3.1", "name": "loopback", "type": "loopback" } - if _, err := r.RunCmd(exec.Command("stat", loopback)); err != nil { - klog.Warningf("%q not found, skipping patching loopback config step: %v", loopback, err) - } else if _, err := r.RunCmd(exec.Command( - "sudo", "find", filepath.Dir(loopback), "-name", filepath.Base(loopback), "-type", "f", "-exec", "sh", "-c", - `grep -q loopback {} && ( grep -q name {} || sed -i '/"type": "loopback"/i \ \ \ \ "name": "loopback",' {} )`, ";")); err != nil { + if _, err := r.RunCmd(exec.Command("sh", "-c", fmt.Sprintf("stat %s", loopback))); err != nil { + klog.Warningf("%q not found, skipping patching loopback config step", loopback) + return nil + } + if _, err := r.RunCmd(exec.Command( + "sudo", "find", filepath.Dir(loopback), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(loopback), "-exec", "sh", "-c", + `grep -q loopback {} && ( grep -q name {} || sudo sed -i '/"type": "loopback"/i \ \ \ \ "name": "loopback",' {} )`, ";")); err != nil { return fmt.Errorf("unable to patch loopback config %q: %v", loopback, err) } return nil } -// disableCrioBridge disables cri-o bridge by prefixing its config file in /etc/cni/net.d with "DISABLED" (effectively deprioritising its lexicographical order placement) +// disableCrioBridge disables cri-o bridge config file in /etc/cni/net.d by changing extension to "mk_disabled" +// ref: https://github.com/containernetworking/cni/blob/6e5ac36b42c0b582358e67ac581d0316507967cb/libcni/conf.go#L176-L184 func disableCrioBridge(r Runner) error { - conflict := "/etc/cni/net.d/100-crio-bridge.conf" - if _, err := r.RunCmd(exec.Command("stat", conflict)); err != nil { - klog.Warningf("%q not found, skipping disabling cri-o bridge config step: %v", conflict, err) - } else if _, err = r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict)))); err != nil { + conflict := "/etc/cni/net.d/*crio-bridge.conf" // usually: 100-crio-bridge.conf + if _, err := r.RunCmd(exec.Command("sh", "-c", fmt.Sprintf("stat %s", conflict))); err != nil { + klog.Warningf("%q not found, skipping disabling cri-o bridge config step", conflict) + return nil + } + if _, err := r.RunCmd(exec.Command( + "sudo", "find", filepath.Dir(conflict), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(conflict), "-exec", "sh", "-c", + `sudo mv {} {}.mk_disabled`, ";")); err != nil { return fmt.Errorf("unable to disable cri-o bridge config %q: %v", conflict, err) } return nil diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index a22b865437..3f6c23a741 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -682,9 +682,12 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) } - args := " --cni-bin-dir=" + CNIBinDir - args += " --cni-cache-dir=" + CNICacheDir - args += " --cni-conf-dir=" + cni.ConfDir + args := "" + if r.KubernetesVersion.LT(semver.MustParse("1.24.0-alpha.2")) { + args += " --cni-bin-dir=" + CNIBinDir + args += " --cni-cache-dir=" + CNICacheDir + args += " --cni-conf-dir=" + cni.ConfDir + } args += " --hairpin-mode=promiscuous-bridge" opts := struct { diff --git a/pkg/network/network.go b/pkg/network/network.go index 05fd93864b..bdd1c9a275 100644 --- a/pkg/network/network.go +++ b/pkg/network/network.go @@ -262,20 +262,18 @@ func FreeSubnet(startSubnet string, step, tries int) (*Parameters, error) { } // reserveSubnet returns if subnet was successfully reserved for given period: -// - false, if it already has unexpired reservation -// - true, if new reservation was created or expired one renewed -// +// - false, if it already has unexpired reservation +// - true, if new reservation was created or expired one renewed // uses sync.Map to manage reservations thread-safe var reserveSubnet = func(subnet string, period time.Duration) bool { - // put 'zero' reservation{} Map value for subnet Map key + // put nil reservation{} Map value for subnet Map key // to block other processes from concurrently changing this subnet - zero := reservation{} - r, loaded := reservedSubnets.LoadOrStore(subnet, zero) + r, loaded := reservedSubnets.LoadOrStore(subnet, nil) // check if there was previously issued reservation if loaded { - // back off if previous reservation was already set to 'zero' + // back off if previous reservation was already set to 'nil' // as then other process is already managing this subnet concurrently - if r == zero { + if r == nil { klog.Infof("backing off reserving subnet %s (other process is managing it!): %+v", subnet, &reservedSubnets) return false } diff --git a/test/integration/helpers_test.go b/test/integration/helpers_test.go index f3f2999419..f01124961f 100644 --- a/test/integration/helpers_test.go +++ b/test/integration/helpers_test.go @@ -263,10 +263,12 @@ func PostMortemLogs(t *testing.T, profile string, multinode ...bool) { t.Logf("%s: %v", rr.Command(), rerr) return } - notRunning := strings.Split(rr.Stdout.String(), " ") - if len(notRunning) == 0 { + // strings.Split("", " ") results in [""] slice of len 1 ! + out := strings.TrimSpace(rr.Stdout.String()) + if len(out) == 0 { continue } + notRunning := strings.Split(out, " ") t.Logf("non-running pods: %s", strings.Join(notRunning, " ")) t.Logf("======> post-mortem[%s]: describe non-running pods <======", t.Name()) diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 61420db58e..9962b164a3 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -40,6 +40,9 @@ import ( // Options tested: kubenet, bridge, flannel, kindnet, calico, cilium // Flags tested: enable-default-cni (legacy), false (CNI off), auto-detection func TestNetworkPlugins(t *testing.T) { + // generate reasonably unique profile name suffix to be used for all tests + suffix := UniqueProfileName("") + MaybeParallel(t) if NoneDriver() { t.Skip("skipping since test for none driver") @@ -71,7 +74,7 @@ func TestNetworkPlugins(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { - profile := UniqueProfileName(tc.name) + profile := tc.name + suffix ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) defer CleanupWithLogs(t, profile, cancel) diff --git a/test/integration/util_test.go b/test/integration/util_test.go index ab8421fbb1..b65f8b58cf 100644 --- a/test/integration/util_test.go +++ b/test/integration/util_test.go @@ -35,7 +35,7 @@ func UniqueProfileName(prefix string) string { return "minikube" } // example: prefix-162239 - return fmt.Sprintf("%s-%s", prefix, time.Now().Format("150405")) + return fmt.Sprintf("%s-%s", prefix, fmt.Sprintf("%06d", time.Now().UnixNano()%1000000)) } // auditContains checks if the provided string is contained within the logs. From 394302c93c399eaab2e2ff5190d1667578704783 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 7 Dec 2022 10:07:40 +0000 Subject: [PATCH 05/44] remove unrelated kvm stuff --- pkg/drivers/kvm/network.go | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/pkg/drivers/kvm/network.go b/pkg/drivers/kvm/network.go index 08215df2cd..08731512c3 100644 --- a/pkg/drivers/kvm/network.go +++ b/pkg/drivers/kvm/network.go @@ -477,20 +477,19 @@ func ifListFromAPI(conn *libvirt.Connect, domain string) ([]libvirt.DomainInterf } defer func() { _ = dom.Free() }() - // check lease first, then arp - // ref: https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceAddresses - ifs, err := dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE) - if err == nil && len(ifs) > 0 { - return ifs, nil - } - if err != nil { - log.Debugf("failed listing network interface addresses of domain %s using lease (will try arp): %v", domain, err) - } else if len(ifs) == 0 { - log.Debugf("no network interface addresses found for domain %s using lease (will try arp)", domain) - } - ifs, err = dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_ARP) - if err != nil { - return nil, fmt.Errorf("failed listing network interface addresses of domain %s using arp: %w", domain, err) + ifs, err := dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_ARP) + if ifs == nil { + if err != nil { + log.Debugf("failed listing network interface addresses of domain %s(source=arp): %w", domain, err) + } else { + log.Debugf("No network interface addresses found for domain %s(source=arp)", domain) + } + log.Debugf("trying to list again with source=lease") + + ifs, err = dom.ListAllInterfaceAddresses(libvirt.DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE) + if err != nil { + return nil, fmt.Errorf("failed listing network interface addresses of domain %s(source=lease): %w", domain, err) + } } return ifs, nil From 1a972459fa8ecfd49cce119e19f2be985a0df4a5 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 7 Dec 2022 17:45:10 +0000 Subject: [PATCH 06/44] increase wait timeout to mitigate ImagePullBackOff errors --- go.sum | 1 + test/integration/net_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index 7fc6221516..aba40a0e83 100644 --- a/go.sum +++ b/go.sum @@ -1402,6 +1402,7 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 9962b164a3..c9fa693bd6 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -94,7 +94,7 @@ func TestNetworkPlugins(t *testing.T) { start := time.Now() MaybeParallel(t) - startArgs := append([]string{"start", "-p", profile, "--memory=3072", "--alsologtostderr", "--wait=true", "--wait-timeout=10m"}, tc.args...) + startArgs := append([]string{"start", "-p", profile, "--memory=3072", "--alsologtostderr", "--wait=true", "--wait-timeout=20m"}, tc.args...) startArgs = append(startArgs, StartArgs()...) t.Run("Start", func(t *testing.T) { From a7b6923be589de74185b44c857d253f1988fa97a Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Fri, 9 Dec 2022 02:18:17 +0000 Subject: [PATCH 07/44] poc --- pkg/kapi/kapi.go | 10 ++-- .../bootstrapper/bsutil/ktmpl/v1beta1.go | 3 ++ .../bootstrapper/bsutil/ktmpl/v1beta2.go | 3 ++ pkg/minikube/bootstrapper/bsutil/kubeadm.go | 16 +++++- .../bootstrapper/bsutil/kubeadm_test.go | 2 +- pkg/minikube/bootstrapper/bsutil/kubelet.go | 5 ++ .../bootstrapper/bsutil/kubelet_test.go | 6 +-- .../testdata/v1.19/containerd-api-port.yaml | 2 + .../v1.19/containerd-pod-network-cidr.yaml | 2 + .../bsutil/testdata/v1.19/containerd.yaml | 2 + .../testdata/v1.19/crio-options-gates.yaml | 2 + .../bsutil/testdata/v1.19/crio.yaml | 2 + .../bsutil/testdata/v1.19/default.yaml | 2 + .../bsutil/testdata/v1.19/dns.yaml | 2 + .../testdata/v1.19/image-repository.yaml | 2 + .../bsutil/testdata/v1.19/options.yaml | 2 + .../testdata/v1.20/containerd-api-port.yaml | 2 + .../v1.20/containerd-pod-network-cidr.yaml | 2 + .../bsutil/testdata/v1.20/containerd.yaml | 2 + .../testdata/v1.20/crio-options-gates.yaml | 2 + .../bsutil/testdata/v1.20/crio.yaml | 2 + .../bsutil/testdata/v1.20/default.yaml | 2 + .../bsutil/testdata/v1.20/dns.yaml | 2 + .../testdata/v1.20/image-repository.yaml | 2 + .../bsutil/testdata/v1.20/options.yaml | 2 + .../testdata/v1.21/containerd-api-port.yaml | 2 + .../v1.21/containerd-pod-network-cidr.yaml | 2 + .../bsutil/testdata/v1.21/containerd.yaml | 2 + .../testdata/v1.21/crio-options-gates.yaml | 2 + .../bsutil/testdata/v1.21/crio.yaml | 2 + .../bsutil/testdata/v1.21/default.yaml | 2 + .../bsutil/testdata/v1.21/dns.yaml | 2 + .../testdata/v1.21/image-repository.yaml | 2 + .../bsutil/testdata/v1.21/options.yaml | 2 + .../testdata/v1.22/containerd-api-port.yaml | 2 + .../v1.22/containerd-pod-network-cidr.yaml | 2 + .../bsutil/testdata/v1.22/containerd.yaml | 2 + .../testdata/v1.22/crio-options-gates.yaml | 2 + .../bsutil/testdata/v1.22/crio.yaml | 2 + .../bsutil/testdata/v1.22/default.yaml | 2 + .../bsutil/testdata/v1.22/dns.yaml | 2 + .../testdata/v1.22/image-repository.yaml | 2 + .../bsutil/testdata/v1.22/options.yaml | 2 + .../testdata/v1.23/containerd-api-port.yaml | 2 + .../v1.23/containerd-pod-network-cidr.yaml | 2 + .../bsutil/testdata/v1.23/containerd.yaml | 2 + .../testdata/v1.23/crio-options-gates.yaml | 2 + .../bsutil/testdata/v1.23/crio.yaml | 2 + .../bsutil/testdata/v1.23/default.yaml | 2 + .../bsutil/testdata/v1.23/dns.yaml | 2 + .../testdata/v1.23/image-repository.yaml | 2 + .../bsutil/testdata/v1.23/options.yaml | 2 + .../testdata/v1.24/containerd-api-port.yaml | 2 + .../v1.24/containerd-pod-network-cidr.yaml | 2 + .../bsutil/testdata/v1.24/containerd.yaml | 2 + .../testdata/v1.24/crio-options-gates.yaml | 2 + .../bsutil/testdata/v1.24/crio.yaml | 2 + .../bsutil/testdata/v1.24/default.yaml | 2 + .../bsutil/testdata/v1.24/dns.yaml | 2 + .../testdata/v1.24/image-repository.yaml | 2 + .../bsutil/testdata/v1.24/options.yaml | 2 + .../testdata/v1.25/containerd-api-port.yaml | 2 + .../v1.25/containerd-pod-network-cidr.yaml | 2 + .../bsutil/testdata/v1.25/containerd.yaml | 2 + .../testdata/v1.25/crio-options-gates.yaml | 2 + .../bsutil/testdata/v1.25/crio.yaml | 2 + .../bsutil/testdata/v1.25/default.yaml | 2 + .../bsutil/testdata/v1.25/dns.yaml | 2 + .../testdata/v1.25/image-repository.yaml | 2 + .../bsutil/testdata/v1.25/options.yaml | 2 + pkg/minikube/cni/bridge.go | 7 +++ pkg/minikube/cni/calico.go | 16 ++++++ pkg/minikube/cni/cilium.go | 16 ++++++ pkg/minikube/cni/cni.go | 3 ++ pkg/minikube/cni/custom.go | 5 ++ pkg/minikube/cni/disabled.go | 5 ++ pkg/minikube/cni/flannel.go | 16 ++++++ pkg/minikube/cni/kindnet.go | 16 ++++++ pkg/minikube/cruntime/containerd.go | 1 - pkg/minikube/cruntime/crio.go | 1 - pkg/minikube/cruntime/cruntime_test.go | 2 - pkg/minikube/cruntime/docker.go | 3 +- pkg/minikube/node/start.go | 54 ++++++++++++++++--- 83 files changed, 294 insertions(+), 22 deletions(-) diff --git a/pkg/kapi/kapi.go b/pkg/kapi/kapi.go index 63f653543d..bf92bf18a6 100644 --- a/pkg/kapi/kapi.go +++ b/pkg/kapi/kapi.go @@ -234,7 +234,11 @@ func ScaleDeployment(kcontext, namespace, deploymentName string, replicas int) e scale.Spec.Replicas = int32(replicas) _, err = client.AppsV1().Deployments(namespace).UpdateScale(context.Background(), deploymentName, scale, meta.UpdateOptions{}) if err != nil { - klog.Warningf("failed rescaling deployment, will retry: %v", err) + if IsRetryableAPIError(err) { + klog.Warningf("failed rescaling %s deployment, will retry: %v", deploymentName, err) + } else { + klog.Info("non-retryable failure while rescaling %s deployment: %v", deploymentName, err) + } } // repeat (if change was successful - once again to check & confirm requested scale) return false, nil @@ -242,10 +246,10 @@ func ScaleDeployment(kcontext, namespace, deploymentName string, replicas int) e return true, nil }) if err != nil { - klog.Infof("failed to rescale deployment %q in namespace %q and context %q to %d: %v", deploymentName, namespace, kcontext, replicas, err) + klog.Infof("failed rescaling %q deployment in %q namespace and %q context to %d replicas: %v", deploymentName, namespace, kcontext, replicas, err) return err } - klog.Infof("deployment %q in namespace %q and context %q rescaled to %d", deploymentName, namespace, kcontext, replicas) + klog.Infof("%q deployment in %q namespace and %q context rescaled to %d replicas", deploymentName, namespace, kcontext, replicas) return nil } diff --git a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go index 8161e47b7b..3e0d021f72 100644 --- a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go +++ b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta1.go @@ -77,6 +77,9 @@ authentication: x509: clientCAFile: {{.ClientCAFile}} cgroupDriver: {{.CgroupDriver}} +{{- range $key, $val := .KubeletConfigOpts}} +{{$key}}: {{$val}} +{{- end}} clusterDomain: "{{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta2.go b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta2.go index ce6970ff28..fc098623cf 100644 --- a/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta2.go +++ b/pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta2.go @@ -80,6 +80,9 @@ authentication: x509: clientCAFile: {{.ClientCAFile}} cgroupDriver: {{.CgroupDriver}} +{{- range $key, $val := .KubeletConfigOpts}} +{{$key}}: {{$val}} +{{- end}} clusterDomain: "{{if .DNSDomain}}{{.DNSDomain}}{{else}}cluster.local{{end}}" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm.go b/pkg/minikube/bootstrapper/bsutil/kubeadm.go index 112a395de6..decd753fac 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm.go @@ -86,6 +86,20 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana } klog.Infof("Using pod CIDR: %s", podCIDR) + // ref: https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration + kubeletConfigOpts := kubeletConfigOpts(k8s.ExtraOptions) + // set hairpin mode to hairpin-veth to achieve hairpin NAT, because promiscuous-bridge assumes the existence of a container bridge named cbr0 + // ref: https://kubernetes.io/docs/tasks/debug/debug-application/debug-service/#a-pod-fails-to-reach-itself-via-the-service-ip + kubeletConfigOpts["hairpinMode"] = k8s.ExtraOptions.Get("hairpin-mode", Kubelet) + if kubeletConfigOpts["hairpinMode"] == "" { + kubeletConfigOpts["hairpinMode"] = "hairpin-veth" + } + // set timeout for all runtime requests except long running requests - pull, logs, exec and attach + kubeletConfigOpts["runtimeRequestTimeout"] = k8s.ExtraOptions.Get("runtime-request-timeout", Kubelet) + if kubeletConfigOpts["runtimeRequestTimeout"] == "" { + kubeletConfigOpts["runtimeRequestTimeout"] = "15m" + } + opts := struct { CertDir string ServiceCIDR string @@ -134,7 +148,7 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana ControlPlaneAddress: constants.ControlPlaneAlias, KubeProxyOptions: createKubeProxyOptions(k8s.ExtraOptions), ResolvConfSearchRegression: HasResolvConfSearchRegression(k8s.KubernetesVersion), - KubeletConfigOpts: kubeletConfigOpts(k8s.ExtraOptions), + KubeletConfigOpts: kubeletConfigOpts, } if k8s.ServiceCIDR != "" { diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go b/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go index 8a9548b3b3..a8201baacf 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go @@ -128,7 +128,7 @@ This test case has only 1 thing to test and that is the networking/dnsDomain value */ func TestGenerateKubeadmYAMLDNS(t *testing.T) { - versions, err := recentReleases(0) + versions, err := recentReleases(6) if err != nil { t.Errorf("versions: %v", err) } diff --git a/pkg/minikube/bootstrapper/bsutil/kubelet.go b/pkg/minikube/bootstrapper/bsutil/kubelet.go index b358d06300..1b6019d89b 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubelet.go +++ b/pkg/minikube/bootstrapper/bsutil/kubelet.go @@ -37,8 +37,13 @@ import ( ) // kubeletConfigParams are the only allowed kubelet parameters for kubeadmin config file and not to be used as kubelet flags +// ref: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/ - look for "DEPRECATED" flags +// ref: https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ +// ref: https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration var kubeletConfigParams = []string{ "localStorageCapacityIsolation", + "runtime-request-timeout", + "hairpin-mode", } func extraKubeletOpts(mc config.ClusterConfig, nc config.Node, r cruntime.Manager) (map[string]string, error) { diff --git a/pkg/minikube/bootstrapper/bsutil/kubelet_test.go b/pkg/minikube/bootstrapper/bsutil/kubelet_test.go index 8094583a5d..390cbee65f 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubelet_test.go +++ b/pkg/minikube/bootstrapper/bsutil/kubelet_test.go @@ -80,7 +80,7 @@ Wants=crio.service [Service] ExecStart= -ExecStart=/var/lib/minikube/binaries/v1.18.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=/var/run/crio/crio.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m +ExecStart=/var/lib/minikube/binaries/v1.18.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=/var/run/crio/crio.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=/var/run/crio/crio.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests [Install] `, @@ -106,7 +106,7 @@ Wants=containerd.service [Service] ExecStart= -ExecStart=/var/lib/minikube/binaries/v1.18.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m +ExecStart=/var/lib/minikube/binaries/v1.18.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.100 --pod-manifest-path=/etc/kubernetes/manifests [Install] `, @@ -139,7 +139,7 @@ Wants=containerd.service [Service] ExecStart= -ExecStart=/var/lib/minikube/binaries/v1.18.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.200 --pod-manifest-path=/etc/kubernetes/manifests --runtime-request-timeout=15m +ExecStart=/var/lib/minikube/binaries/v1.18.2/kubelet --authorization-mode=Webhook --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --cgroup-driver=cgroupfs --client-ca-file=/var/lib/minikube/certs/ca.crt --cluster-domain=cluster.local --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock --fail-swap-on=false --hostname-override=minikube --image-service-endpoint=unix:///run/containerd/containerd.sock --kubeconfig=/etc/kubernetes/kubelet.conf --node-ip=192.168.1.200 --pod-manifest-path=/etc/kubernetes/manifests [Install] `, diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml index c946a53272..3e83c315dc 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml index e1f0f3f325..a3aeff370a 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml index 9e1fd6d74b..33fbd96c8c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml index 3663007278..3ea843675f 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio-options-gates.yaml @@ -58,6 +58,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml index bc7a440b6c..2e1de3b47c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/crio.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml index dc484b5891..ca5d6dc6f4 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/default.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml index 7891a251e1..8633fac685 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/dns.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "minikube.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml index 39d7d628f3..79ad87073c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/image-repository.yaml @@ -53,6 +53,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml index be5e8249eb..afa2f1a703 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/options.yaml @@ -55,6 +55,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml index 7f270f6b7b..f3206df7ed 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml index 2689cfe746..683ae434da 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml index 3f4a81576a..dbe8756d95 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml index 42f5ce1e6a..a40b5c04e0 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio-options-gates.yaml @@ -58,6 +58,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml index 7e15a5b789..2ca61302aa 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/crio.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml index 2ee50bb1c0..862db516e4 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/default.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml index 19bac3f2e7..e23562baa0 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/dns.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "minikube.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml index d3b14db355..f36591d1ed 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/image-repository.yaml @@ -53,6 +53,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml index 41951675a9..74bbe84b11 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/options.yaml @@ -55,6 +55,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml index ca06be4676..9c67aa0d29 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml index 49d1d4c253..79d5b2d411 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml index 20c133ade3..bfcaa98467 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio-options-gates.yaml index 90cbcd5a64..71258a5bcd 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio-options-gates.yaml @@ -58,6 +58,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio.yaml index 3fb371631c..3f2f1ce536 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/crio.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/default.yaml index 63dda5e2d1..7d97ab09f6 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/default.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/dns.yaml index 486cb139a3..6dd304998d 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/dns.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "minikube.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/image-repository.yaml index 41171d19e3..b60d5647a6 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/image-repository.yaml @@ -53,6 +53,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/options.yaml index 0ae6233719..c7e3535316 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/options.yaml @@ -55,6 +55,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml index a6f66ca3fc..88198f3a5b 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml index be1449f67c..42a3f48168 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml index 17add873e8..ceebe37e37 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml index 675695d35c..f24e17f7ce 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio-options-gates.yaml @@ -58,6 +58,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml index c4cdca797b..c7b569de1a 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/crio.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml index 41c52cead9..95cc1f7b35 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/default.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml index 6ad1aece47..7ea1313b05 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/dns.yaml @@ -52,6 +52,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "minikube.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml index 6eea4cd782..d85c27dbca 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/image-repository.yaml @@ -53,6 +53,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml index 0869698959..75e8edf30a 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/options.yaml @@ -55,6 +55,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml index 8ba73ba262..7b46b2fcd5 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml index 329588b9a1..0b14634f79 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml index b9598d7fe8..0700426ea5 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio-options-gates.yaml index 6b220ff965..8f06d0c9bf 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio-options-gates.yaml @@ -56,6 +56,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio.yaml index f986859773..8e95541b6c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/crio.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/default.yaml index 05a6d75980..5c4ee61fbd 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/default.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/dns.yaml index 4343f08828..3387cb9a3d 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/dns.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "minikube.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/image-repository.yaml index 25b3e44885..df980fb545 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/image-repository.yaml @@ -51,6 +51,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/options.yaml index b44de0a03c..b608822891 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/options.yaml @@ -53,6 +53,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml index c0d6a2e107..9c1f32e2e4 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml index ad0f6e2d5f..b91a260532 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml index b57437de99..9df6aaa449 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio-options-gates.yaml index c071093bf1..d11d3e77a8 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio-options-gates.yaml @@ -56,6 +56,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio.yaml index e610321bef..bb4fe9c470 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/crio.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/default.yaml index a7d163f7ae..357b86a2e1 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/default.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/dns.yaml index f304a30dd2..b589145b10 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/dns.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "minikube.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/image-repository.yaml index 232c8785ab..660efe8242 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/image-repository.yaml @@ -51,6 +51,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/options.yaml index 71046482a4..1e824985e0 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/options.yaml @@ -53,6 +53,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml index 9dd0cf7182..cd57de3e0f 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml index 0852428188..744eb4a75a 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml index 7b29b31b96..9ef1d535b7 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio-options-gates.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio-options-gates.yaml index f30daf411f..a7c48c4492 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio-options-gates.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio-options-gates.yaml @@ -56,6 +56,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio.yaml index f1446b644a..7915ee5350 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/crio.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/default.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/default.yaml index c03e0657c0..b3463c08f7 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/default.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/default.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/dns.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/dns.yaml index d8c7e3ac99..84ca57799c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/dns.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/dns.yaml @@ -50,6 +50,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "minikube.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/image-repository.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/image-repository.yaml index 327ecc65d7..b6fe947d09 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/image-repository.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/image-repository.yaml @@ -51,6 +51,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/options.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/options.yaml index e215c9f955..e75fc3e18b 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/options.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/options.yaml @@ -53,6 +53,8 @@ authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt cgroupDriver: systemd +hairpinMode: hairpin-veth +runtimeRequestTimeout: 15m clusterDomain: "cluster.local" # disable disk resource management by default imageGCHighThresholdPercent: 100 diff --git a/pkg/minikube/cni/bridge.go b/pkg/minikube/cni/bridge.go index c0d38b90e2..063d769401 100644 --- a/pkg/minikube/cni/bridge.go +++ b/pkg/minikube/cni/bridge.go @@ -31,6 +31,8 @@ import ( // ref: https://www.cni.dev/plugins/current/main/bridge/ // ref: https://www.cni.dev/plugins/current/meta/portmap/ +// note: "cannot set hairpin mode and promiscuous mode at the same time" +// ref: https://github.com/containernetworking/plugins/blob/7e9ada51e751740541969e1ea5a803cbf45adcf3/plugins/main/bridge/bridge.go#L424 var bridgeConf = template.Must(template.New("bridge").Parse(` { "cniVersion": "0.3.1", @@ -106,3 +108,8 @@ func (c Bridge) Apply(r Runner) error { func (c Bridge) CIDR() string { return DefaultPodCIDR } + +// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). +func (c Bridge) Ready() bool { + return true +} diff --git a/pkg/minikube/cni/calico.go b/pkg/minikube/cni/calico.go index 01ec3cb74d..d16a9d83cf 100644 --- a/pkg/minikube/cni/calico.go +++ b/pkg/minikube/cni/calico.go @@ -19,6 +19,7 @@ package cni import ( "bytes" "fmt" + "time" // goembed needs this _ "embed" @@ -26,6 +27,9 @@ import ( "github.com/blang/semver/v4" "github.com/pkg/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" + "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/bootstrapper/images" "k8s.io/minikube/pkg/minikube/config" @@ -92,3 +96,15 @@ func (c Calico) CIDR() string { // Calico docs specify 192.168.0.0/16 - but we do this for compatibility with other CNI's. return DefaultPodCIDR } + +// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). +// Calico uses k8s-app=calico-node and k8s-app=calico-kube-controllers labels. +func (c Calico) Ready() bool { + client, err := kapi.Client(c.cc.Name) + if err != nil { + klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) + return false + } + + return kapi.WaitForPods(client, meta.NamespaceAll, "k8s-app in (calico-node, calico-kube-controllers)", 10*time.Millisecond) == nil +} diff --git a/pkg/minikube/cni/cilium.go b/pkg/minikube/cni/cilium.go index ddfcb288e4..9a0c861deb 100644 --- a/pkg/minikube/cni/cilium.go +++ b/pkg/minikube/cni/cilium.go @@ -20,9 +20,12 @@ import ( "bytes" "os/exec" "text/template" + "time" "github.com/pkg/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" + "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/config" ) @@ -862,3 +865,16 @@ func (c Cilium) Apply(r Runner) error { return applyManifest(c.cc, r, manifestAsset(ciliumCfg)) } + +// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). +// Cilium uses k8s-app=cilium and name=cilium-operator labels. +func (c Cilium) Ready() bool { + client, err := kapi.Client(c.cc.Name) + if err != nil { + klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) + return false + } + + return kapi.WaitForPods(client, meta.NamespaceAll, "k8s-app=cilium", 10*time.Millisecond) == nil && + kapi.WaitForPods(client, meta.NamespaceAll, "name=cilium-operator", 10*time.Millisecond) == nil +} diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index e4201e0e41..f6bf00a249 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -76,6 +76,9 @@ type Manager interface { // String representation String() string + + // Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). + Ready() bool } // tmplInputs are inputs to CNI templates diff --git a/pkg/minikube/cni/custom.go b/pkg/minikube/cni/custom.go index b70dfbf9e6..fd3012eb36 100644 --- a/pkg/minikube/cni/custom.go +++ b/pkg/minikube/cni/custom.go @@ -69,3 +69,8 @@ func (c Custom) Apply(r Runner) error { func (c Custom) CIDR() string { return DefaultPodCIDR } + +// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). +func (c Custom) Ready() bool { + return true +} diff --git a/pkg/minikube/cni/disabled.go b/pkg/minikube/cni/disabled.go index 5c273ef121..5196b821b8 100644 --- a/pkg/minikube/cni/disabled.go +++ b/pkg/minikube/cni/disabled.go @@ -51,3 +51,8 @@ func (c Disabled) CIDR() string { // Even without any CNI we want our nodes to have spec.PodCIDR set. return DefaultPodCIDR } + +// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). +func (c Disabled) Ready() bool { + return true +} diff --git a/pkg/minikube/cni/flannel.go b/pkg/minikube/cni/flannel.go index c906dafd46..c1f3605a61 100644 --- a/pkg/minikube/cni/flannel.go +++ b/pkg/minikube/cni/flannel.go @@ -21,8 +21,12 @@ import ( _ "embed" "os/exec" "text/template" + "time" "github.com/pkg/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" + "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/config" ) @@ -80,3 +84,15 @@ func (c Flannel) manifest() (assets.CopyableFile, error) { func (c Flannel) CIDR() string { return DefaultPodCIDR } + +// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). +// Flannel uses app=flannel label. +func (c Flannel) Ready() bool { + client, err := kapi.Client(c.cc.Name) + if err != nil { + klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) + return false + } + + return kapi.WaitForPods(client, meta.NamespaceAll, "app=flannel", 10*time.Millisecond) == nil +} diff --git a/pkg/minikube/cni/kindnet.go b/pkg/minikube/cni/kindnet.go index d25d4b6135..1ee2c4f001 100644 --- a/pkg/minikube/cni/kindnet.go +++ b/pkg/minikube/cni/kindnet.go @@ -20,8 +20,12 @@ import ( "bytes" "os/exec" "text/template" + "time" "github.com/pkg/errors" + meta "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" + "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/bootstrapper/images" "k8s.io/minikube/pkg/minikube/config" @@ -195,3 +199,15 @@ func (c KindNet) Apply(r Runner) error { func (c KindNet) CIDR() string { return DefaultPodCIDR } + +// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). +// KindNet uses app=kindnet or k8s-app=kindnet label. +func (c KindNet) Ready() bool { + client, err := kapi.Client(c.cc.Name) + if err != nil { + klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) + return false + } + + return kapi.WaitForPods(client, meta.NamespaceAll, "app=kindnet", 10*time.Millisecond) == nil +} diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index b9167b6147..ec4d4db34c 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -410,7 +410,6 @@ func (r *Containerd) KubeletOptions() map[string]string { "container-runtime": "remote", "container-runtime-endpoint": fmt.Sprintf("unix://%s", r.SocketPath()), "image-service-endpoint": fmt.Sprintf("unix://%s", r.SocketPath()), - "runtime-request-timeout": "15m", } } diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 86af57ac97..ad52c82ad3 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -356,7 +356,6 @@ func (r *CRIO) KubeletOptions() map[string]string { "container-runtime": "remote", "container-runtime-endpoint": r.SocketPath(), "image-service-endpoint": r.SocketPath(), - "runtime-request-timeout": "15m", } } diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index c5d12c024a..2b76eeea9c 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -154,13 +154,11 @@ func TestKubeletOptions(t *testing.T) { "container-runtime": "remote", "container-runtime-endpoint": "/var/run/crio/crio.sock", "image-service-endpoint": "/var/run/crio/crio.sock", - "runtime-request-timeout": "15m", }}, {"containerd", map[string]string{ "container-runtime": "remote", "container-runtime-endpoint": "unix:///run/containerd/containerd.sock", "image-service-endpoint": "unix:///run/containerd/containerd.sock", - "runtime-request-timeout": "15m", }}, } for _, tc := range tests { diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 3f6c23a741..e8a278537e 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -373,7 +373,6 @@ func (r *Docker) KubeletOptions() map[string]string { "container-runtime": "remote", "container-runtime-endpoint": r.SocketPath(), "image-service-endpoint": r.SocketPath(), - "runtime-request-timeout": "15m", } } return map[string]string{ @@ -688,7 +687,7 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri args += " --cni-cache-dir=" + CNICacheDir args += " --cni-conf-dir=" + cni.ConfDir } - args += " --hairpin-mode=promiscuous-bridge" + args += " --hairpin-mode=hairpin-veth" opts := struct { NetworkPlugin string diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 6b36d7da81..094b960a07 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -90,7 +90,7 @@ type Starter struct { } // Start spins up a guest and starts the Kubernetes node. -func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { +func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { //nolint to temporary suppress cyclomatic complexity 31 of func `Start` is high (> 30) var wg sync.WaitGroup stopk8s, err := handleNoKubernetes(starter) if err != nil { @@ -209,9 +209,27 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { return nil, errors.Wrap(err, "cni apply") } } - klog.Infof("Will wait %s for node %+v", viper.GetDuration(waitTimeout), starter.Node) - if err := bs.WaitForNode(*starter.Cfg, *starter.Node, viper.GetDuration(waitTimeout)); err != nil { - return nil, errors.Wrapf(err, "wait %s for node", viper.GetDuration(waitTimeout)) + + timeout := viper.GetDuration(waitTimeout) + delay := time.Duration(0) + if !starter.Cfg.DisableOptimizations { + cm, err := cni.New(starter.Cfg) + if err != nil { + klog.Warning("unable to create cni manager - will skip waiting for cni to become ready") + } else if !cm.Ready() { + // wait for cni to become ready up to half of the total waitTimeout + if delay, err = waitCNIReady(cm, timeout/2); err != nil { + klog.Warningf("cni did not appear ready after %s (will continue): %v", cm.String(), delay, err) + } + } + // scale coredns to 1 replica + if err := kapi.ScaleDeployment(starter.Cfg.Name, meta.NamespaceSystem, kconst.CoreDNSDeploymentName, 1); err != nil { + klog.Errorf("unable to scale deployment %q in namespace %q to 1 replica: %v", kconst.CoreDNSDeploymentName, meta.NamespaceSystem, err) + } + } + klog.Infof("Will wait %s for node %+v", timeout-delay, starter.Node) + if err := bs.WaitForNode(*starter.Cfg, *starter.Node, timeout-delay); err != nil { + return nil, errors.Wrapf(err, "wait %s for node", timeout-delay) } klog.Infof("waiting for startup goroutines ...") @@ -221,6 +239,20 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { return kcs, config.Write(viper.GetString(config.ProfileName), starter.Cfg) } +func waitCNIReady(cm cni.Manager, wait time.Duration) (time.Duration, error) { + start := time.Now() + + klog.Infof("will wait %s for %s cni to become ready", wait, cm.String()) + + query := func() error { + if cm.Ready() { + return nil + } + return fmt.Errorf("%s cni not ready yet", cm.String()) + } + return time.Since(start), retry.Local(query, wait) +} + // handleNoKubernetes handles starting minikube without Kubernetes. func handleNoKubernetes(starter Starter) (bool, error) { // Do not bootstrap cluster if --no-kubernetes. @@ -262,10 +294,16 @@ func handleAPIServer(starter Starter, cr cruntime.Manager, hostIP net.IP) (*kube return nil, bs, errors.Wrap(err, "Failed kubeconfig update") } - if !starter.Cfg.DisableOptimizations { - // Scale down CoreDNS from default 2 to 1 replica. - if err := kapi.ScaleDeployment(starter.Cfg.Name, meta.NamespaceSystem, kconst.CoreDNSDeploymentName, 1); err != nil { - klog.Errorf("Unable to scale down deployment %q in namespace %q to 1 replica: %v", kconst.CoreDNSDeploymentName, meta.NamespaceSystem, err) + if !starter.Cfg.DisableOptimizations && starter.Cfg.KubernetesConfig.CNI != "" { + // CoreDNS needs CNI to be Ready - scale down to 0 replica if not, so we don't "count" this into waiting time for CoreDNS to come up and we don't hit max CrashLoopBackOff delay later (5 mins atm). + cnm, err := cni.New(starter.Cfg) + if err != nil { + klog.Warning("unable to create cni manager - will skip scaling corens down to 0") + } else if !cnm.Ready() { + klog.Infof("%s cni is not yet ready - will scale coredns down to 0 for now", cnm.String()) + if err := kapi.ScaleDeployment(starter.Cfg.Name, meta.NamespaceSystem, kconst.CoreDNSDeploymentName, 0); err != nil { + klog.Errorf("unable to scale coredns down to 0: %v", err) + } } } From 9ac814ae8d6505f83c33147bd1928ee3874be8bd Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Sat, 10 Dec 2022 02:42:16 +0000 Subject: [PATCH 08/44] test cri-dockerd v0.2.6 --- pkg/minikube/cruntime/docker.go | 25 +++++++++++++++++++ pkg/minikube/node/start.go | 4 +-- .../testdata/netcat-deployment.yaml | 3 ++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index e8a278537e..a1bb849b76 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -697,6 +697,12 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri ExtraArguments: args, } + // TODO: remove once cri-dockerd is updated in future minikube release + klog.Info("replacing original cri-dockerd with v0.2.6: %v") + if err := downloadCRIDockerdBinary(cr, "0.2.6"); err != nil { + klog.Warningf("unable to replace original cri-dockerd with v0.2.6: %v", err) + } + const CRIDockerServiceConfFile = "/etc/systemd/system/cri-docker.service.d/10-cni.conf" var CRIDockerServiceConfTemplate = template.Must(template.New("criDockerServiceConfTemplate").Parse(`[Service] ExecStart= @@ -717,3 +723,22 @@ ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plug } return r.Init.Restart("cri-docker") } + +// download cri-dockerd version +func downloadCRIDockerdBinary(cr CommandRunner, version string) error { + if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", + `curl -sSfL https://github.com/Mirantis/cri-dockerd/releases/download/v0.2.6/cri-dockerd-0.2.6.amd64.tgz | tar -xz -C /tmp`)); err != nil { + return fmt.Errorf("unable to download new cri-dockerd: %v", err) + } + if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/usr/bin/cri-dockerd", "/usr/bin/cri-dockerd-org")); err != nil { + return fmt.Errorf("unable to backup org cri-dockerd: %v", err) + } + if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/tmp/cri-dockerd/cri-dockerd", "/usr/bin/cri-dockerd")); err != nil { + if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/usr/bin/cri-dockerd", "/usr/bin/cri-dockerd-org")); err != nil { + return fmt.Errorf("unable to install new cri-dockerd and restore org cri-dockerd - it's broken!: %v", err) + } else { + return fmt.Errorf("unable to install new cri-dockerd: %v", err) + } + } + return nil +} diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 094b960a07..a45aa701d4 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -242,13 +242,13 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { //no func waitCNIReady(cm cni.Manager, wait time.Duration) (time.Duration, error) { start := time.Now() - klog.Infof("will wait %s for %s cni to become ready", wait, cm.String()) + klog.Infof("will wait %s for %s to become ready", wait, cm.String()) query := func() error { if cm.Ready() { return nil } - return fmt.Errorf("%s cni not ready yet", cm.String()) + return fmt.Errorf("%s not ready yet", cm.String()) } return time.Since(start), retry.Local(query, wait) } diff --git a/test/integration/testdata/netcat-deployment.yaml b/test/integration/testdata/netcat-deployment.yaml index 48930cb55d..53b4585553 100644 --- a/test/integration/testdata/netcat-deployment.yaml +++ b/test/integration/testdata/netcat-deployment.yaml @@ -17,7 +17,8 @@ spec: containers: # dnsutils is easier to debug DNS issues with than the standard busybox image - name: dnsutils - image: k8s.gcr.io/e2e-test-images/agnhost:2.32 + # https://github.com/kubernetes/kubernetes/blob/master/test/images/agnhost/README.md + image: registry.k8s.io/e2e-test-images/agnhost:2.40 command: ["/bin/sh", "-c", "while true; do echo hello | nc -l -p 8080; done"] --- From cc9efaa3d569f997a1807358c0efab6dff4e7554 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Sat, 10 Dec 2022 03:13:18 +0000 Subject: [PATCH 09/44] lint --- pkg/minikube/cruntime/docker.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index a1bb849b76..bc16fa8d30 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -726,8 +726,8 @@ ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plug // download cri-dockerd version func downloadCRIDockerdBinary(cr CommandRunner, version string) error { - if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", - `curl -sSfL https://github.com/Mirantis/cri-dockerd/releases/download/v0.2.6/cri-dockerd-0.2.6.amd64.tgz | tar -xz -C /tmp`)); err != nil { + curl := fmt.Sprintf("curl -sSfL https://github.com/Mirantis/cri-dockerd/releases/download/v%s/cri-dockerd-%s.amd64.tgz | tar -xz -C /tmp", version, version) + if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { return fmt.Errorf("unable to download new cri-dockerd: %v", err) } if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/usr/bin/cri-dockerd", "/usr/bin/cri-dockerd-org")); err != nil { @@ -736,9 +736,8 @@ func downloadCRIDockerdBinary(cr CommandRunner, version string) error { if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/tmp/cri-dockerd/cri-dockerd", "/usr/bin/cri-dockerd")); err != nil { if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/usr/bin/cri-dockerd", "/usr/bin/cri-dockerd-org")); err != nil { return fmt.Errorf("unable to install new cri-dockerd and restore org cri-dockerd - it's broken!: %v", err) - } else { - return fmt.Errorf("unable to install new cri-dockerd: %v", err) } + return fmt.Errorf("unable to install new cri-dockerd: %v", err) } return nil } From 670c2941530781ae075a255fdf3fa5ced224317c Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Sun, 11 Dec 2022 00:02:36 +0000 Subject: [PATCH 10/44] debug --- test/integration/net_test.go | 136 ++++++++++++++++++ .../testdata/netcat-deployment.yaml | 1 + 2 files changed, 137 insertions(+) diff --git a/test/integration/net_test.go b/test/integration/net_test.go index c9fa693bd6..db09475521 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -177,6 +177,8 @@ func TestNetworkPlugins(t *testing.T) { want := []byte("10.96.0.1") if !bytes.Contains(rr.Stdout.Bytes(), want) { + start := time.Now() + t.Logf(">>> debugDNS logs:\n%s\n<<< debugDNS took %v", debugDNS(t, profile), time.Since(start)) t.Errorf("failed nslookup: got=%q, want=*%q*", rr.Stdout.Bytes(), want) } }) @@ -268,3 +270,137 @@ func verifyKubeletFlagsOutput(t *testing.T, k8sVersion, kubeletPlugin, out strin t.Errorf("expected --network-plugin=%s, got %s", kubeletPlugin, out) } } + +func debugDNS(t *testing.T, profile string) string { + var output strings.Builder + + cmd := exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-type=a", "kubernetes.default") + out, _ := cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: nslookup type A kubernetes.default:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-debug", "kubernetes.default") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: nslookup kubernetes.default:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-debug", "kubernetes.default.svc.cluster.local") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: nslookup kubernetes.default.svc.cluster.local:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "kubernetes.default") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: dig kubernetes.default:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "kubernetes.default.svc.cluster.local") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: dig kubernetes.default.svc.cluster.local:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "@10.96.0.10", "kubernetes.default") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: dig @10.96.0.10 kubernetes.default:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "@10.96.0.10", "kubernetes.default.svc.cluster.local") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: dig @10.96.0.10 kubernetes.default.svc.cluster.local:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "ping", "-c", "1", "-w", "1", "kubernetes.default") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: ping kubernetes.default:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "ping", "-c", "1", "-w", "1", "kubernetes.default.svc.cluster.local") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: ping kubernetes.default.svc.cluster.local:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nc", "-z", "-w", "5", "-v", "10.96.0.10", "53") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: nc 10.96.0.10 tcp/53:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nc", "-z", "-w", "5", "-u", "-v", "10.96.0.10", "53") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: nc 10.96.0.10 udp/53:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "cat", "/etc/nsswitch.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: /etc/nsswitch.conf:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "cat", "/etc/hosts") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: /etc/hosts:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "cat", "/etc/resolv.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: /etc/resolv.conf:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/nsswitch.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/nsswitch.conf:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/hosts") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/hosts:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/resolv.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/resolv.conf:\n%s\n", out)) + + cmd = exec.Command("kubectl", "config", "view") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: kubectl config:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "get", "cm", "-A", "-oyaml") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: cms:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "get", "svc", "-A", "-owide") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: svcs:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "get", "pods", "-A", "-owide") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: pods:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /var/lib/kubelet/config.yaml") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /var/lib/kubelet/config.yaml:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo", "find /etc/cni -type f -exec sh -c 'echo {}; cat {}' \\;") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/cni:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status docker | cat") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: docker svc:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status containerd | cat") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: containerd svc:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status cri-docker | cat") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: cri-docker svc:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cri-dockerd --version") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: cri-dockerd version:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo ip a s") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: ip a s:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo iptables-save") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: iptables-save:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo iptables -t nat -L") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: iptables table nat:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "-n", "kube-system", "logs", "--selector=k8s-app=kube-proxy", "--tail=-1") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: kube-proxy logs:\n%s\n", out)) + + return output.String() +} diff --git a/test/integration/testdata/netcat-deployment.yaml b/test/integration/testdata/netcat-deployment.yaml index 53b4585553..dd1e1a0c43 100644 --- a/test/integration/testdata/netcat-deployment.yaml +++ b/test/integration/testdata/netcat-deployment.yaml @@ -19,6 +19,7 @@ spec: - name: dnsutils # https://github.com/kubernetes/kubernetes/blob/master/test/images/agnhost/README.md image: registry.k8s.io/e2e-test-images/agnhost:2.40 + imagePullPolicy: IfNotPresent command: ["/bin/sh", "-c", "while true; do echo hello | nc -l -p 8080; done"] --- From 19812b0cc114cda208db37839d9650ca1846f9e5 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Sun, 11 Dec 2022 06:06:11 +0000 Subject: [PATCH 11/44] debug --- pkg/minikube/cruntime/docker.go | 11 ++++++----- pkg/minikube/node/start.go | 15 +++++++++++++-- test/integration/net_test.go | 20 ++++++++++++++++++-- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index bc16fa8d30..a6c7f17202 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -23,6 +23,7 @@ import ( "os" "os/exec" "path" + "runtime" "strings" "text/template" "time" @@ -698,9 +699,9 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri } // TODO: remove once cri-dockerd is updated in future minikube release - klog.Info("replacing original cri-dockerd with v0.2.6: %v") - if err := downloadCRIDockerdBinary(cr, "0.2.6"); err != nil { - klog.Warningf("unable to replace original cri-dockerd with v0.2.6: %v", err) + klog.Infof("replacing original cri-dockerd with v0.2.6-%s", runtime.GOARCH) + if err := downloadCRIDockerdBinary(cr, "0.2.6", runtime.GOARCH); err != nil { + klog.Warningf("unable to replace original cri-dockerd with v0.2.6-%s: %v", runtime.GOARCH, err) } const CRIDockerServiceConfFile = "/etc/systemd/system/cri-docker.service.d/10-cni.conf" @@ -725,8 +726,8 @@ ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plug } // download cri-dockerd version -func downloadCRIDockerdBinary(cr CommandRunner, version string) error { - curl := fmt.Sprintf("curl -sSfL https://github.com/Mirantis/cri-dockerd/releases/download/v%s/cri-dockerd-%s.amd64.tgz | tar -xz -C /tmp", version, version) +func downloadCRIDockerdBinary(cr CommandRunner, version, arch string) error { + curl := fmt.Sprintf("curl -sSfL https://github.com/Mirantis/cri-dockerd/releases/download/v%s/cri-dockerd-%s.%s.tgz | tar -xz -C /tmp", version, version, arch) if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { return fmt.Errorf("unable to download new cri-dockerd: %v", err) } diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index a45aa701d4..7329b86d54 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -846,13 +846,24 @@ func addCoreDNSEntry(runner command.Runner, name, ip string, cc config.ClusterCo } // inject hosts block with host record into coredns configmap - sed := fmt.Sprintf("sed '/^ forward . \\/etc\\/resolv.conf.*/i \\ hosts {\\n %s %s\\n fallthrough\\n }'", ip, name) + sed := fmt.Sprintf("sed -e '/^ forward . \\/etc\\/resolv.conf.*/i \\ hosts {\\n %s %s\\n fallthrough\\n }'", ip, name) // check if hosts block already exists in coredns configmap hosts := regexp.MustCompile(`(?smU)^ *hosts {.*}`) if hosts.MatchString(cm) { // inject host record into existing coredns configmap hosts block instead klog.Info("CoreDNS already contains hosts block, will inject host record there...") - sed = fmt.Sprintf("sed '/^ hosts {.*/a \\ %s %s'", ip, name) + sed = fmt.Sprintf("sed -e '/^ hosts {.*/a \\ %s %s'", ip, name) + } + + res, _ := runner.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("%s | %s", get, sed))) + klog.Info("coredns sed: %s\n%s", sed, res.Output()) + // check if logging is already enabled (via log plugin) in coredns configmap, so not to duplicate it + logs := regexp.MustCompile(`(?smU)^ *log *$`) + if !logs.MatchString(cm) { + // inject log plugin into coredns configmap + sed = fmt.Sprintf("%s -e '/^ errors *$/i \\ log'", sed) + res, _ := runner.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("%s | %s", get, sed))) + klog.Info("coredns sed: %s\n%s", sed, res.Output()) } // replace coredns configmap via kubectl diff --git a/test/integration/net_test.go b/test/integration/net_test.go index db09475521..f6477bdc1f 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -178,7 +178,7 @@ func TestNetworkPlugins(t *testing.T) { want := []byte("10.96.0.1") if !bytes.Contains(rr.Stdout.Bytes(), want) { start := time.Now() - t.Logf(">>> debugDNS logs:\n%s\n<<< debugDNS took %v", debugDNS(t, profile), time.Since(start)) + t.Logf(">>> debugDNS logs:\n%s\n<<< debugDNS took %v", debugDNS(profile), time.Since(start)) t.Errorf("failed nslookup: got=%q, want=*%q*", rr.Stdout.Bytes(), want) } }) @@ -271,7 +271,7 @@ func verifyKubeletFlagsOutput(t *testing.T, k8sVersion, kubeletPlugin, out strin } } -func debugDNS(t *testing.T, profile string) string { +func debugDNS(profile string) string { var output strings.Builder cmd := exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-type=a", "kubernetes.default") @@ -354,6 +354,10 @@ func debugDNS(t *testing.T, profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: svcs:\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "get", "ep", "-A", "-owide") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: eps:\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "get", "pods", "-A", "-owide") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: pods:\n%s\n", out)) @@ -382,6 +386,10 @@ func debugDNS(t *testing.T, profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: cri-docker svc:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/cri-docker.service.d/10-cni.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/systemd/system/cri-docker.service.d/10-cni.conf:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cri-dockerd --version") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: cri-dockerd version:\n%s\n", out)) @@ -390,6 +398,10 @@ func debugDNS(t *testing.T, profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: ip a s:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo ip r s") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: ip r s:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo iptables-save") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: iptables-save:\n%s\n", out)) @@ -402,5 +414,9 @@ func debugDNS(t *testing.T, profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: kube-proxy logs:\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "-n", "kube-system", "logs", "--selector=k8s-app=kube-dns", "--tail=-1") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: kube-proxy logs:\n%s\n", out)) + return output.String() } From 0fa75ce152e566de65ad77b3085851e87e23d33c Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Sun, 11 Dec 2022 18:12:41 +0000 Subject: [PATCH 12/44] use systemd --- pkg/minikube/node/start.go | 15 ++++++++------- test/integration/net_test.go | 15 +++++++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 7329b86d54..0fc86bbb55 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -446,7 +446,7 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k } inUserNamespace := strings.Contains(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true") - err = cr.Enable(disableOthers, forceSystemd(), inUserNamespace) + err = cr.Enable(disableOthers, forceSystemd(kv), inUserNamespace) if err != nil { exit.Error(reason.RuntimeEnable, "Failed to enable container runtime", err) } @@ -465,8 +465,13 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k return cr } -func forceSystemd() bool { - return viper.GetBool("force-systemd") || os.Getenv(constants.MinikubeForceSystemdEnv) == "true" +func forceSystemd(kv semver.Version) bool { + // starting from k8s v1.22: "kubeadm clusters should be using the systemd driver" + // ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.22.md#no-really-you-must-read-this-before-you-upgrade + // still, respect user preference, if present + return kv.GTE(semver.Version{Major: 1, Minor: 22}) && + os.Getenv(constants.MinikubeForceSystemdEnv) != "false" && + (!viper.IsSet("force-systemd") || viper.GetBool("force-systemd")) } func pathExists(runner cruntime.CommandRunner, path string) (bool, error) { @@ -855,15 +860,11 @@ func addCoreDNSEntry(runner command.Runner, name, ip string, cc config.ClusterCo sed = fmt.Sprintf("sed -e '/^ hosts {.*/a \\ %s %s'", ip, name) } - res, _ := runner.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("%s | %s", get, sed))) - klog.Info("coredns sed: %s\n%s", sed, res.Output()) // check if logging is already enabled (via log plugin) in coredns configmap, so not to duplicate it logs := regexp.MustCompile(`(?smU)^ *log *$`) if !logs.MatchString(cm) { // inject log plugin into coredns configmap sed = fmt.Sprintf("%s -e '/^ errors *$/i \\ log'", sed) - res, _ := runner.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("%s | %s", get, sed))) - klog.Info("coredns sed: %s\n%s", sed, res.Output()) } // replace coredns configmap via kubectl diff --git a/test/integration/net_test.go b/test/integration/net_test.go index f6477bdc1f..c4140c69c5 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -177,8 +177,6 @@ func TestNetworkPlugins(t *testing.T) { want := []byte("10.96.0.1") if !bytes.Contains(rr.Stdout.Bytes(), want) { - start := time.Now() - t.Logf(">>> debugDNS logs:\n%s\n<<< debugDNS took %v", debugDNS(profile), time.Since(start)) t.Errorf("failed nslookup: got=%q, want=*%q*", rr.Stdout.Bytes(), want) } }) @@ -203,6 +201,14 @@ func TestNetworkPlugins(t *testing.T) { }) } + if t.Failed() { + start := time.Now() + t.Logf(">>> debugLogs:\n%s\n<<< debugLogs took %v", debugLogs(profile), time.Since(start)) + } + // if err := os.WriteFile(fmt.Sprintf("%s/%s.log", os.TempDir(), profile), []byte(debugLogs(profile)), 0644); err != nil { + // t.Logf("cannot write debug logs: %v", err) + // } + t.Logf("%q test finished in %s, failed=%v", tc.name, time.Since(start), t.Failed()) }) } @@ -271,7 +277,8 @@ func verifyKubeletFlagsOutput(t *testing.T, k8sVersion, kubeletPlugin, out strin } } -func debugDNS(profile string) string { +// debug logs for dns and other network issues +func debugLogs(profile string) string { var output strings.Builder cmd := exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-type=a", "kubernetes.default") @@ -416,7 +423,7 @@ func debugDNS(profile string) string { cmd = exec.Command("kubectl", "--context", profile, "-n", "kube-system", "logs", "--selector=k8s-app=kube-dns", "--tail=-1") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: kube-proxy logs:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> k8s: coredns logs:\n%s\n", out)) return output.String() } From 4cd9a94637b373c11bd552b5e309fcaebe2d61a0 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 12 Dec 2022 00:49:23 +0000 Subject: [PATCH 13/44] use systemd --- pkg/minikube/cruntime/crio.go | 2 +- pkg/minikube/cruntime/cruntime_test.go | 2 +- pkg/minikube/cruntime/docker.go | 2 +- pkg/minikube/node/start.go | 12 ++++++-- test/integration/net_test.go | 42 +++++++++++++++++++++++--- 5 files changed, 49 insertions(+), 11 deletions(-) diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index ad52c82ad3..f616814dfd 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -219,7 +219,7 @@ func (r *CRIO) Enable(disOthers, forceSystemd, inUserNamespace bool) error { } } // NOTE: before we start crio explicitly here, crio might be already started automatically - return r.Init.Start("crio") + return r.Init.Restart("crio") } // Disable idempotently disables CRIO on a host diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index 2b76eeea9c..5dc65fb11c 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -685,7 +685,7 @@ func TestEnable(t *testing.T) { map[string]serviceState{ "docker": SvcExited, "containerd": SvcExited, - "crio": SvcRunning, + "crio": SvcRestarted, "crio-shutdown": SvcExited, }}, } diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index a6c7f17202..de5b273d14 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -164,7 +164,7 @@ func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error { if err := r.Init.Enable(r.CRIService); err != nil { return err } - if err := r.Init.Start(r.CRIService); err != nil { + if err := r.Init.Restart(r.CRIService); err != nil { return err } } diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 0fc86bbb55..ac5fff75b4 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -468,10 +468,16 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k func forceSystemd(kv semver.Version) bool { // starting from k8s v1.22: "kubeadm clusters should be using the systemd driver" // ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.22.md#no-really-you-must-read-this-before-you-upgrade + // ref: https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-drivers + // ref: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/configure-cgroup-driver/ // still, respect user preference, if present - return kv.GTE(semver.Version{Major: 1, Minor: 22}) && - os.Getenv(constants.MinikubeForceSystemdEnv) != "false" && - (!viper.IsSet("force-systemd") || viper.GetBool("force-systemd")) + if viper.IsSet("force-systemd") { + return viper.GetBool("force-systemd") + } + if env := os.Getenv(constants.MinikubeForceSystemdEnv); env != "" { + return env == "true" + } + return kv.GTE(semver.Version{Major: 1, Minor: 22}) } func pathExists(runner cruntime.CommandRunner, path string) (bool, error) { diff --git a/test/integration/net_test.go b/test/integration/net_test.go index c4140c69c5..1d99ae8646 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -377,21 +377,29 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /var/lib/kubelet/config.yaml:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo", "find /etc/cni -type f -exec sh -c 'echo {}; cat {}' \\;") + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo find /etc/cni -type f -exec sh -c 'echo {}; cat {}' \\;") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/cni:\n%s\n", out)) cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status docker | cat") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: docker svc:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> host: docker daemon:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status containerd | cat") + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/docker/daemon.json") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: containerd svc:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> host: /etc/docker/daemon.json:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo docker system info") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: docker system info:\n%s\n", out)) cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status cri-docker | cat") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: cri-docker svc:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> host: cri daemon:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /usr/lib/systemd/system/cri-docker.service") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /usr/lib/systemd/system/cri-docker.service:\n%s\n", out)) cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/cri-docker.service.d/10-cni.conf") out, _ = cmd.CombinedOutput() @@ -401,6 +409,30 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: cri-dockerd version:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status containerd | cat") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: containerd daemon:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/containerd/config.toml") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/containerd/config.toml:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo containerd config dump") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: containerd config dump:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status crio | cat") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: crio daemon:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo find /etc/crio -type f -exec sh -c 'echo {}; cat {}' \\;") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/crio:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo crio config") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: crio config:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo ip a s") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: ip a s:\n%s\n", out)) From 788a9d6bd77758bd34db1d9308152fc4ec1d180b Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 12 Dec 2022 11:45:52 +0000 Subject: [PATCH 14/44] wait and log --- pkg/kapi/kapi.go | 15 ++++++++++++--- test/integration/helpers_test.go | 11 ++++++++++- test/integration/net_test.go | 25 ++++++++++++++++--------- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/pkg/kapi/kapi.go b/pkg/kapi/kapi.go index bf92bf18a6..d3391f7051 100644 --- a/pkg/kapi/kapi.go +++ b/pkg/kapi/kapi.go @@ -69,7 +69,7 @@ func Client(context string) (*kubernetes.Clientset, error) { return kubernetes.NewForConfig(c) } -// WaitForPods waits for all matching pods to become Running or finish successfully and at least one matching pod exists. +// WaitForPods waits for all matching pods to become Ready or finish successfully and at least one matching pod exists. func WaitForPods(c kubernetes.Interface, ns string, selector string, timeOut ...time.Duration) error { start := time.Now() klog.Infof("Waiting for pod with label %q in ns %q ...", selector, ns) @@ -93,11 +93,20 @@ func WaitForPods(c kubernetes.Interface, ns string, selector string, timeOut ... for _, pod := range pods.Items { if pod.Status.Phase != core.PodRunning && pod.Status.Phase != core.PodSucceeded { - klog.Infof("waiting for pod %q, current state: %s: [%v]\n", selector, pod.Status.Phase, err) + klog.Infof("waiting for pod %q, current phase: %s", selector, pod.Status.Phase) return false, nil } + if pod.Status.Phase == core.PodRunning { + for _, c := range pod.Status.Conditions { + if c.Type == core.PodReady { + if c.Status != core.ConditionTrue { + klog.Infof("waiting for pod %q, current phase/status: %s/%s:%s\n", selector, pod.Status.Phase, core.PodReady, c.Status) + return false, nil + } + } + } + } } - return true, nil } t := ReasonableStartTime diff --git a/test/integration/helpers_test.go b/test/integration/helpers_test.go index f01124961f..34d3cad78a 100644 --- a/test/integration/helpers_test.go +++ b/test/integration/helpers_test.go @@ -306,7 +306,7 @@ func podStatusMsg(pod core.Pod) string { return sb.String() } -// PodWait waits for pods to achieve a running state. +// PodWait waits for pods to achieve a Ready state. func PodWait(ctx context.Context, t *testing.T, profile string, ns string, selector string, timeout time.Duration) ([]string, error) { t.Helper() client, err := kapi.Client(profile) @@ -356,6 +356,15 @@ func PodWait(ctx context.Context, t *testing.T, profile string, ns string, selec podStart = time.Time{} return false, nil } + for _, c := range pod.Status.Conditions { + if c.Type == core.PodReady { + if c.Status != core.ConditionTrue { + t.Logf("%s: pod %q is not yet ready - current phase/status: %s/%s:%s\n", t.Name(), selector, pod.Status.Phase, core.PodReady, c.Status) + podStart = time.Time{} + return false, nil + } + } + } if podStart.IsZero() { podStart = time.Now() diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 1d99ae8646..b136935317 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -79,6 +79,18 @@ func TestNetworkPlugins(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) defer CleanupWithLogs(t, profile, cancel) + defer func() { + if t.Failed() { + start := time.Now() + logs := debugLogs(profile) + t.Logf(">>> debugLogs:\n%s\n<<< debugLogs took %v", logs, time.Since(start)) + // if err := os.WriteFile(fmt.Sprintf("%s/%s.log", os.TempDir(), profile), []byte(logs), 0644); err != nil { + // t.Logf("cannot write debug logs: %v", err) + // } + // } + } + }() + if ContainerRuntime() != "docker" && tc.name == "false" { // CNI is required for current container runtime validateFalseCNI(ctx, t, profile) @@ -152,7 +164,6 @@ func TestNetworkPlugins(t *testing.T) { if _, err := PodWait(ctx, t, profile, "default", "app=netcat", Minutes(15)); err != nil { t.Fatalf("failed waiting for netcat pod: %v", err) } - }) } @@ -201,14 +212,6 @@ func TestNetworkPlugins(t *testing.T) { }) } - if t.Failed() { - start := time.Now() - t.Logf(">>> debugLogs:\n%s\n<<< debugLogs took %v", debugLogs(profile), time.Since(start)) - } - // if err := os.WriteFile(fmt.Sprintf("%s/%s.log", os.TempDir(), profile), []byte(debugLogs(profile)), 0644); err != nil { - // t.Logf("cannot write debug logs: %v", err) - // } - t.Logf("%q test finished in %s, failed=%v", tc.name, time.Since(start), t.Failed()) }) } @@ -457,5 +460,9 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: coredns logs:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo journalctl -xeu kubelet --all --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: kubelet logs:\n%s\n", out)) + return output.String() } From 72c8acc370ec2c1a1d03440df864e3556768acee Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 13 Dec 2022 03:35:16 +0000 Subject: [PATCH 15/44] fix Docker_Linux and multinode --- cmd/minikube/cmd/docker-env.go | 2 +- pkg/minikube/cni/cni.go | 92 ++++++++--------------------- pkg/minikube/cni/kindnet.go | 2 +- pkg/minikube/cruntime/containerd.go | 2 +- pkg/minikube/cruntime/docker.go | 7 ++- pkg/minikube/node/start.go | 10 +++- 6 files changed, 41 insertions(+), 74 deletions(-) diff --git a/cmd/minikube/cmd/docker-env.go b/cmd/minikube/cmd/docker-env.go index bebbb7f5e6..b8b96333e1 100644 --- a/cmd/minikube/cmd/docker-env.go +++ b/cmd/minikube/cmd/docker-env.go @@ -199,7 +199,7 @@ func mustRestartDockerd(name string, runner command.Runner) { if err := sysinit.New(runner).Reload("docker"); err != nil { klog.Warningf("will try to restart dockerd because reload failed: %v", err) if err := sysinit.New(runner).Restart("docker"); err != nil { - klog.Warningf("Couldn't restart docker inside minikbue within '%v' because: %v", name, err) + klog.Warningf("Couldn't restart docker inside minikube within '%v' because: %v", name, err) return } // if we get to the point that we have to restart docker (instead of reload) diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index f6bf00a249..26857e645a 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -23,9 +23,9 @@ import ( "os/exec" "path" "path/filepath" + "strings" "time" - "github.com/blang/semver/v4" "github.com/pkg/errors" "k8s.io/klog/v2" "k8s.io/minikube/pkg/kapi" @@ -34,8 +34,8 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/driver" + "k8s.io/minikube/pkg/minikube/sysinit" "k8s.io/minikube/pkg/minikube/vmpath" - "k8s.io/minikube/pkg/util" ) const ( @@ -44,15 +44,9 @@ const ( // DefaultConfDir is the default CNI Config Directory path DefaultConfDir = "/etc/cni/net.d" - // CustomConfDir is the custom CNI Config Directory path used to avoid conflicting CNI configs - // ref: https://github.com/kubernetes/minikube/issues/10984 and https://github.com/kubernetes/minikube/pull/11106 - CustomConfDir = "/etc/cni/net.mk" ) var ( - // ConfDir is the CNI Config Directory path that can be customised, defaulting to DefaultConfDir - ConfDir = DefaultConfDir - // Network is the network name that CNI should use (eg, "kindnet"). // Currently, only crio (and podman) can use it, so that setting custom ConfDir is not necessary. // ref: https://github.com/cri-o/cri-o/issues/2121 (and https://github.com/containers/podman/issues/2370) @@ -119,10 +113,6 @@ func New(cc *config.ClusterConfig) (Manager, error) { cnm, err = NewCustom(*cc, cc.KubernetesConfig.CNI) } - if err := configureCNI(cc, cnm); err != nil { - klog.Errorf("unable to set CNI Config Directory: %v", err) - } - return cnm, err } @@ -190,13 +180,6 @@ func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) err klog.Warningf("unable to name loopback interface in applyManifest: %v", err) } - if driver.IsKIC(cc.Driver) { - klog.Infof("disabling cri-o bridge for %s driver ... ", cc.Driver) - if err := disableCrioBridge(r); err != nil { - klog.Warningf("unable to disable cri-o bridge for %s driver: %v", cc.Driver, err) - } - } - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() @@ -215,43 +198,6 @@ func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) err return nil } -// configureCNI - to avoid conflicting CNI configs, it sets: -// - for crio: 'cni_default_network' config param via cni.Network -// - for containerd and docker: kubelet's '--cni-conf-dir' flag to custom CNI Config Directory path (same used also by CNI Deployment). -// ref: https://github.com/kubernetes/minikube/issues/10984 and https://github.com/kubernetes/minikube/pull/11106 -// Note: currently, this change affects only Kindnet CNI (and all multinodes using it), but it can be easily expanded to other/all CNIs if needed. -// Note2: Cilium does not need workaround as they automatically restart pods after CNI is successfully deployed. -func configureCNI(cc *config.ClusterConfig, cnm Manager) error { - if _, kindnet := cnm.(KindNet); kindnet { - // crio only needs CNI network name; hopefully others (containerd, docker and kubeadm/kubelet) will follow eventually - if cc.KubernetesConfig.ContainerRuntime == constants.CRIO { - Network = "kindnet" - return nil - } - version, err := util.ParseKubernetesVersion(cc.KubernetesConfig.KubernetesVersion) - if err != nil { - return err - } - // The CNI configuration is handled by CRI in 1.24+ - if version.LT(semver.MustParse("1.24.0-alpha.2")) { - // for containerd and docker: auto-set custom CNI via kubelet's 'cni-conf-dir' param, if not user-specified - eo := fmt.Sprintf("kubelet.cni-conf-dir=%s", CustomConfDir) - if !cc.KubernetesConfig.ExtraOptions.Exists(eo) { - klog.Infof("auto-setting extra-config to %q", eo) - if err := cc.KubernetesConfig.ExtraOptions.Set(eo); err != nil { - return fmt.Errorf("failed auto-setting extra-config %q: %v", eo, err) - } - ConfDir = CustomConfDir - klog.Infof("extra-config set to %q", eo) - } else { - // respect user-specified custom CNI Config Directory - ConfDir = cc.KubernetesConfig.ExtraOptions.Get("cni-conf-dir", "kubelet") - } - } - } - return nil -} - // NameLoopback ensures loopback has a name in its config file in /etc/cni/net.d // cri-o is leaving it out atm (https://github.com/cri-o/cri-o/pull/6273) // avoid errors like: @@ -273,18 +219,32 @@ func NameLoopback(r Runner) error { return nil } -// disableCrioBridge disables cri-o bridge config file in /etc/cni/net.d by changing extension to "mk_disabled" -// ref: https://github.com/containernetworking/cni/blob/6e5ac36b42c0b582358e67ac581d0316507967cb/libcni/conf.go#L176-L184 -func disableCrioBridge(r Runner) error { - conflict := "/etc/cni/net.d/*crio-bridge.conf" // usually: 100-crio-bridge.conf - if _, err := r.RunCmd(exec.Command("sh", "-c", fmt.Sprintf("stat %s", conflict))); err != nil { - klog.Warningf("%q not found, skipping disabling cri-o bridge config step", conflict) +// DisableBridgeCNIs disables all default bridge CNIs on a node (designated by runner) by changing extension to "mk_disabled" of *bridge* config file(s) found in /etc/cni/net.d. +// It's usually called before deploying new CNI or on restarts, to avoid conflicts and flip-flopping of pods' ip addresses. +// ref: https://github.com/containernetworking/cni/blob/main/libcni/conf.go +func DisableAllBridgeCNIs(r Runner, cc config.ClusterConfig) error { + path := "/etc/cni/net.d" + out, err := r.RunCmd(exec.Command( + "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*.mk_disabled", "-printf", "%p|", "-exec", "sh", "-c", + `sudo mv {} {}.mk_disabled`, ";")) + if err != nil { + return fmt.Errorf("failed to disable all bridge cni configs in %q: %v", path, err) + } + configs := strings.Trim(out.Stdout.String(), "|") + if len(configs) == 0 { + klog.Infof("no bridge cni config found in %q - nothing to disable", configs, path) return nil } - if _, err := r.RunCmd(exec.Command( - "sudo", "find", filepath.Dir(conflict), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(conflict), "-exec", "sh", "-c", - `sudo mv {} {}.mk_disabled`, ";")); err != nil { - return fmt.Errorf("unable to disable cri-o bridge config %q: %v", conflict, err) + svc := cc.KubernetesConfig.ContainerRuntime + klog.Infof("disabled [%s] bridge cni config(s) in %q, now restarting selected %q container runtime", configs, path, svc) + + if svc == "cri-o" { + svc = "crio" } + if err := sysinit.New(r).Restart(svc); err != nil { + klog.Warningf("failed to restart %q container runtime service in %q: %v", svc, cc.Name, err) + return err + } + return nil } diff --git a/pkg/minikube/cni/kindnet.go b/pkg/minikube/cni/kindnet.go index 1ee2c4f001..3e99125009 100644 --- a/pkg/minikube/cni/kindnet.go +++ b/pkg/minikube/cni/kindnet.go @@ -170,7 +170,7 @@ func (c KindNet) manifest() (assets.CopyableFile, error) { DefaultRoute: "0.0.0.0/0", // assumes IPv4 PodCIDR: DefaultPodCIDR, ImageName: images.KindNet(c.cc.KubernetesConfig.ImageRepository), - CNIConfDir: ConfDir, + CNIConfDir: DefaultConfDir, } b := bytes.Buffer{} diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index ec4d4db34c..476eaaa4a1 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -138,7 +138,7 @@ func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semve if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*SystemdCgroup = .*$|SystemdCgroup = %t|' -i %s", forceSystemd, containerdConfigFile))); err != nil { return errors.Wrap(err, "update SystemdCgroup") } - if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*conf_dir = .*$|conf_dir = \"%s\"|' -i %s", cni.ConfDir, containerdConfigFile))); err != nil { + if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*conf_dir = .*$|conf_dir = \"%s\"|' -i %s", cni.DefaultConfDir, containerdConfigFile))); err != nil { return errors.Wrap(err, "update conf_dir") } diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index de5b273d14..81aaa65fb5 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -668,7 +668,6 @@ func (r *Docker) ImagesPreloaded(images []string) bool { const ( CNIBinDir = "/opt/cni/bin" - CNIConfDir = "/etc/cni/net.d" CNICacheDir = "/var/lib/cni/cache" ) @@ -683,10 +682,12 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri } args := "" - if r.KubernetesVersion.LT(semver.MustParse("1.24.0-alpha.2")) { + // The CNI configuration is handled by CRI in 1.24+ + // ref: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#installation + if networkPlugin == "cni" && r.KubernetesVersion.GTE(semver.MustParse("1.24.0-alpha.2")) { args += " --cni-bin-dir=" + CNIBinDir args += " --cni-cache-dir=" + CNICacheDir - args += " --cni-conf-dir=" + cni.ConfDir + args += " --cni-conf-dir=" + cni.DefaultConfDir } args += " --hairpin-mode=hairpin-veth" diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index ac5fff75b4..e8adfee42e 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -294,7 +294,7 @@ func handleAPIServer(starter Starter, cr cruntime.Manager, hostIP net.IP) (*kube return nil, bs, errors.Wrap(err, "Failed kubeconfig update") } - if !starter.Cfg.DisableOptimizations && starter.Cfg.KubernetesConfig.CNI != "" { + if !starter.Cfg.DisableOptimizations && starter.Cfg.KubernetesConfig.NetworkPlugin == "cni" { // CoreDNS needs CNI to be Ready - scale down to 0 replica if not, so we don't "count" this into waiting time for CoreDNS to come up and we don't hit max CrashLoopBackOff delay later (5 mins atm). cnm, err := cni.New(starter.Cfg) if err != nil { @@ -439,6 +439,11 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k } } + // if cni is used, ensure all default CNI(s) are disabled on every node start + if err := cni.DisableAllBridgeCNIs(runner, cc); err != nil { + klog.Errorf("unable to disable default CNI(s): %v", err) + } + if kv.GTE(semver.MustParse("1.24.0-alpha.2")) { if err := cruntime.ConfigureNetworkPlugin(cr, runner, cc.KubernetesConfig.NetworkPlugin); err != nil { exit.Error(reason.RuntimeEnable, "Failed to configure network plugin", err) @@ -462,6 +467,7 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k if err != nil { exit.Error(reason.RuntimeEnable, "Failed to start container runtime", err) } + return cr } @@ -879,7 +885,7 @@ func addCoreDNSEntry(runner command.Runner, name, ip string, cc config.ClusterCo klog.Errorf("failed to inject {%q: %s} host record into CoreDNS", name, ip) return err } - klog.Infof("{%q: %s} host record injected into CoreDNS", name, ip) + klog.Infof("{%q: %s} host record injected into CoreDNS's ConfigMap", name, ip) return nil } From 7e20c16886994c1f02c8af7ccca7b2f392a6db37 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 13 Dec 2022 14:41:30 +0000 Subject: [PATCH 16/44] collect debug logs --- pkg/minikube/node/start.go | 4 ++-- test/integration/net_test.go | 23 ++++++++++------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index e8adfee42e..20a17dc381 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -219,7 +219,7 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { //no } else if !cm.Ready() { // wait for cni to become ready up to half of the total waitTimeout if delay, err = waitCNIReady(cm, timeout/2); err != nil { - klog.Warningf("cni did not appear ready after %s (will continue): %v", cm.String(), delay, err) + klog.Warningf("%s cni did not appear ready after %s (will continue): %v", cm.String(), delay, err) } } // scale coredns to 1 replica @@ -248,7 +248,7 @@ func waitCNIReady(cm cni.Manager, wait time.Duration) (time.Duration, error) { if cm.Ready() { return nil } - return fmt.Errorf("%s not ready yet", cm.String()) + return fmt.Errorf("%s cni not ready yet", cm.String()) } return time.Since(start), retry.Local(query, wait) } diff --git a/test/integration/net_test.go b/test/integration/net_test.go index b136935317..03f7f12de4 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -79,18 +79,6 @@ func TestNetworkPlugins(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) defer CleanupWithLogs(t, profile, cancel) - defer func() { - if t.Failed() { - start := time.Now() - logs := debugLogs(profile) - t.Logf(">>> debugLogs:\n%s\n<<< debugLogs took %v", logs, time.Since(start)) - // if err := os.WriteFile(fmt.Sprintf("%s/%s.log", os.TempDir(), profile), []byte(logs), 0644); err != nil { - // t.Logf("cannot write debug logs: %v", err) - // } - // } - } - }() - if ContainerRuntime() != "docker" && tc.name == "false" { // CNI is required for current container runtime validateFalseCNI(ctx, t, profile) @@ -112,6 +100,7 @@ func TestNetworkPlugins(t *testing.T) { t.Run("Start", func(t *testing.T) { _, err := Run(t, exec.CommandContext(ctx, Target(), startArgs...)) if err != nil { + t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed start: %v", err) } }) @@ -119,6 +108,7 @@ func TestNetworkPlugins(t *testing.T) { if !t.Failed() && tc.podLabel != "" { t.Run("ControllerPod", func(t *testing.T) { if _, err := PodWait(ctx, t, profile, tc.namespace, tc.podLabel, Minutes(10)); err != nil { + t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed waiting for %s labeled pod: %v", tc.podLabel, err) } }) @@ -134,6 +124,7 @@ func TestNetworkPlugins(t *testing.T) { rr, err = Run(t, exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "pgrep -a kubelet")) } if err != nil { + t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("ssh failed: %v", err) } out := rr.Stdout.String() @@ -154,6 +145,7 @@ func TestNetworkPlugins(t *testing.T) { client, err := kapi.Client(profile) if err != nil { + t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed to get Kubernetes client for %s: %v", profile, err) } @@ -162,6 +154,7 @@ func TestNetworkPlugins(t *testing.T) { } if _, err := PodWait(ctx, t, profile, "default", "app=netcat", Minutes(15)); err != nil { + t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed waiting for netcat pod: %v", err) } }) @@ -212,6 +205,10 @@ func TestNetworkPlugins(t *testing.T) { }) } + if t.Failed() { + t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) + } + t.Logf("%q test finished in %s, failed=%v", tc.name, time.Since(start), t.Failed()) }) } @@ -255,7 +252,7 @@ func validateHairpinMode(ctx context.Context, t *testing.T, profile string, hair } } else { if tryHairPin() == nil { - t.Fatalf("hairpin connection unexpectedly succeeded - misconfigured test?") + t.Errorf("hairpin connection unexpectedly succeeded - misconfigured test?") } } } From d3bdac0379531b92dea8934fd93eb92ec27dfcb1 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 13 Dec 2022 21:16:25 +0000 Subject: [PATCH 17/44] fix containerd when bound to docker --- .../containerd-bin-aarch64/config.toml | 2 +- .../x86_64/package/containerd-bin/config.toml | 2 +- deploy/kicbase/containerd.toml | 2 +- pkg/minikube/cruntime/containerd.go | 3 +- pkg/minikube/cruntime/docker.go | 8 ++++++ test/integration/net_test.go | 28 ++++++++++++++++--- 6 files changed, 37 insertions(+), 8 deletions(-) diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml index d5de73eae4..487a5a0a21 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml @@ -54,7 +54,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" - conf_dir = "/etc/cni/net.mk" + conf_dir = "/etc/cni/net.d" conf_template = "" [plugins."io.containerd.grpc.v1.cri".registry] config_path = "/etc/containerd/certs.d" diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml index e63ad23c34..20abf3e760 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml @@ -54,7 +54,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" - conf_dir = "/etc/cni/net.mk" + conf_dir = "/etc/cni/net.d" conf_template = "" [plugins."io.containerd.grpc.v1.cri".registry] config_path = "/etc/containerd/certs.d" diff --git a/deploy/kicbase/containerd.toml b/deploy/kicbase/containerd.toml index 98b902d7a1..477645de9c 100644 --- a/deploy/kicbase/containerd.toml +++ b/deploy/kicbase/containerd.toml @@ -54,7 +54,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" - conf_dir = "/etc/cni/net.mk" + conf_dir = "/etc/cni/net.d" conf_template = "" [plugins."io.containerd.grpc.v1.cri".registry] config_path = "/etc/containerd/certs.d" diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 476eaaa4a1..c3035192aa 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -175,6 +175,7 @@ func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semve } // Enable idempotently enables containerd on a host +// It is also called by docker.Enable() - if bound to containerd, to enforce proper containerd configuration completed by service restart. func (r *Containerd) Enable(disOthers, forceSystemd, inUserNamespace bool) error { if inUserNamespace { if err := CheckKernelCompatibility(r.Runner, 5, 11); err != nil { @@ -509,7 +510,7 @@ func (r *Containerd) Preload(cc config.ClusterConfig) error { return r.Restart() } -// Restart restarts Docker on a host +// Restart restarts this container runtime on a host func (r *Containerd) Restart() error { return r.Init.Restart("containerd") } diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 81aaa65fb5..33a861d559 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -137,6 +137,14 @@ func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error { klog.Warningf("disableOthers: %v", err) } } + // check if containerd is still alive (hopefully because being being bound to docker), and if so: ensure it's configured properly by calling its Enable() method + cdr, errCdR := New(Config{Type: "containerd", Runner: r.Runner}) + if errCdR == nil && cdr.Active() { + errCdR = cdr.Enable(false, forceSystemd, inUserNamespace) + } + if errCdR != nil { + klog.Warningf("cannot ensure containerd (as bound to docker) is configured properly and reloaded - cluster might be unstable: %v", errCdR) + } if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil { return err diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 03f7f12de4..e24087c6d8 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -357,6 +357,10 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: cms:\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "get", "node", "-A", "-owide") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: nodes:\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "get", "svc", "-A", "-owide") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: svcs:\n%s\n", out)) @@ -369,10 +373,18 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: pods:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo crictl pods") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: crictl pods:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/kubernetes/kubelet.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/kubernetes/kubelet.conf:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /var/lib/kubelet/config.yaml") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /var/lib/kubelet/config.yaml:\n%s\n", out)) @@ -397,14 +409,14 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: cri daemon:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /usr/lib/systemd/system/cri-docker.service") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /usr/lib/systemd/system/cri-docker.service:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/cri-docker.service.d/10-cni.conf") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/systemd/system/cri-docker.service.d/10-cni.conf:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /usr/lib/systemd/system/cri-docker.service") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /usr/lib/systemd/system/cri-docker.service:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cri-dockerd --version") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: cri-dockerd version:\n%s\n", out)) @@ -413,6 +425,10 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: containerd daemon:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /lib/systemd/system/containerd.service") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /lib/systemd/system/containerd.service:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/containerd/config.toml") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/containerd/config.toml:\n%s\n", out)) @@ -461,5 +477,9 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: kubelet logs:\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /run/flannel/subnet.env") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /run/flannel/subnet.env:\n%s\n", out)) + return output.String() } From e51fef3118a4ba0f1b276aefa61a970a5941966b Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 14 Dec 2022 23:38:45 +0000 Subject: [PATCH 18/44] prevent overlapping network segments --- .../arch/aarch64/package/containerd-bin-aarch64/config.toml | 2 +- .../package/containerd-bin-aarch64/containerd-bin.hash | 2 +- .../package/containerd-bin-aarch64/containerd-bin.mk | 1 + .../package/containerd-bin-aarch64/containerd.service | 4 ++-- .../arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk | 5 +++-- .../arch/x86_64/package/containerd-bin/config.toml | 4 ++-- .../arch/x86_64/package/containerd-bin/containerd.service | 4 ++-- .../arch/x86_64/package/cri-dockerd/cri-dockerd.mk | 3 +++ deploy/kicbase/containerd.toml | 6 +++--- hack/update/cri_dockerd/update_cri_dockerd.sh | 3 ++- pkg/minikube/cni/calico.go | 2 ++ pkg/minikube/cni/calico.yaml | 2 ++ pkg/minikube/cruntime/containerd.go | 2 +- pkg/minikube/cruntime/docker.go | 5 ++++- site/content/en/docs/faq/_index.md | 4 ++-- test/integration/start_stop_delete_test.go | 2 +- 16 files changed, 32 insertions(+), 19 deletions(-) diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml index 487a5a0a21..953a3bd101 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml @@ -50,7 +50,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - SystemdCgroup = false + SystemdCgroup = true [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.hash b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.hash index 9894c41be2..e87a009097 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.hash +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.hash @@ -15,6 +15,6 @@ sha256 85a531725f15e2d136131119d42af4507a5389e0947015152075c4c93816fb5c v1.4.12. sha256 7507913ba169c103ab67bc51bec31cd977d4348d7bc842da32b7eab5f930a14b v1.5.10.tar.gz sha256 02b79d5e2b07b5e64cd28f1fe84395ee11eef95fc49fd923a9ab93022b148be6 v1.5.11.tar.gz sha256 f422e21e35705d1e741c1f3280813e43f811eaff4dcc5cdafac8b8952b15f468 v1.6.4.tar.gz -sha265 27afb673c20d53aa5c31aec07b38eb7e4dc911e7e1f0c76fac9513bbf070bd24 v1.6.6.tar.gz +sha256 27afb673c20d53aa5c31aec07b38eb7e4dc911e7e1f0c76fac9513bbf070bd24 v1.6.6.tar.gz sha256 f5f938513c28377f64f85e84f2750d39f26b01262f3a062b7e8ce35b560ca407 v1.6.8.tar.gz sha256 a034b2273533207d5d96bef8bd3fce1efff85139815efb756d90c705ae1a05ce v1.6.9.tar.gz diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk index 9bf242ea20..8e3be0a3a3 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk @@ -14,6 +14,7 @@ CONTAINERD_BIN_AARCH64_ENV = \ CGO_ENABLED=1 \ GO111MODULE=off \ GOPATH="$(CONTAINERD_BIN_AARCH64_GOPATH)" \ + GOBIN="$(CONTAINERD_BIN_AARCH64_GOPATH)/bin" \ PATH=$(CONTAINERD_BIN_AARCH64_GOPATH)/bin:$(BR_PATH) \ GOARCH=arm64 diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service index 2d3d1e5ec9..c4e4331630 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service @@ -9,14 +9,14 @@ EnvironmentFile=-/etc/sysconfig/containerd EnvironmentFile=-/etc/sysconfig/containerd.minikube EnvironmentFile=/var/run/minikube/env Environment=GOTRACEBACK=crash -ExecStartPre=/sbin/modprobe overlay +ExecStartPre=-/sbin/modprobe overlay ExecStart=/usr/bin/containerd \ $CONTAINERD_OPTIONS \ $CONTAINERD_MINIKUBE_OPTIONS \ --root ${PERSISTENT_DIR}/var/lib/containerd TasksMax=8192 Delegate=yes -KillMode=mixed +KillMode=process LimitNOFILE=1048576 # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk b/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk index 4f7ee9ef50..91e4fd1e8c 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk +++ b/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk @@ -4,6 +4,9 @@ # ################################################################################ +# If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change +# This uses the static make target at the top level Makefile, since that builds everything, then picks out the arm64 binary + # As of 2022-06-09 CRI_DOCKERD_AARCH64_VER = 0.2.2 CRI_DOCKERD_AARCH64_REV = 0737013 @@ -24,8 +27,6 @@ CRI_DOCKERD_AARCH64_ENV = \ CRI_DOCKERD_AARCH64_COMPILE_SRC = $(CRI_DOCKERD_AARCH64_GOPATH)/src/github.com/Mirantis/cri-dockerd CRI_DOCKERD_AARCH64_BUILDFLAGS = "-ldflags '-X github.com/Mirantis/cri-dockerd/version.Version=$(CRI_DOCKERD_AARCH64_VER) -X github.com/Mirantis/cri-dockerd/version.GitCommit=$(CRI_DOCKERD_AARCH64_REV)'" -# If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change -# This uses the static make target at the top level Makefile, since that builds everything, then picks out the arm64 binary define CRI_DOCKERD_AARCH64_BUILD_CMDS $(CRI_DOCKERD_AARCH64_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) LDFLAGS=$(CRI_DOCKERD_AARCH64_BUILDFLAGS) GO_VERSION=$(GO_VERSION) -C $(@D) VERSION=$(CRI_DOCKERD_AARCH64_VER) REVISION=$(CRI_DOCKERD_AARCH64_REV) static endef diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml index 20abf3e760..953a3bd101 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml @@ -50,7 +50,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - SystemdCgroup = false + SystemdCgroup = true [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" @@ -58,7 +58,7 @@ oom_score = 0 conf_template = "" [plugins."io.containerd.grpc.v1.cri".registry] config_path = "/etc/containerd/certs.d" - + [plugins."io.containerd.service.v1.diff-service"] default = ["walking"] [plugins."io.containerd.gc.v1.scheduler"] diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service index 2d3d1e5ec9..c4e4331630 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service @@ -9,14 +9,14 @@ EnvironmentFile=-/etc/sysconfig/containerd EnvironmentFile=-/etc/sysconfig/containerd.minikube EnvironmentFile=/var/run/minikube/env Environment=GOTRACEBACK=crash -ExecStartPre=/sbin/modprobe overlay +ExecStartPre=-/sbin/modprobe overlay ExecStart=/usr/bin/containerd \ $CONTAINERD_OPTIONS \ $CONTAINERD_MINIKUBE_OPTIONS \ --root ${PERSISTENT_DIR}/var/lib/containerd TasksMax=8192 Delegate=yes -KillMode=mixed +KillMode=process LimitNOFILE=1048576 # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk b/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk index 5502a2b9b8..280828575d 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk +++ b/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk @@ -4,6 +4,9 @@ # ################################################################################ +# If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change +# This uses the static make target at the top level Makefile, since that builds everything, then picks out the amd64 binary + # As of 2022-06-09 CRI_DOCKERD_VER = 0.2.2 CRI_DOCKERD_REV = 0737013 diff --git a/deploy/kicbase/containerd.toml b/deploy/kicbase/containerd.toml index 477645de9c..953a3bd101 100644 --- a/deploy/kicbase/containerd.toml +++ b/deploy/kicbase/containerd.toml @@ -1,7 +1,7 @@ version = 2 -root = "/var/lib/containerd" +root = "/var/lib/containerd" state = "/run/containerd" -oom_score = 0 +oom_score = 0 # imports [grpc] @@ -50,7 +50,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - SystemdCgroup = false + SystemdCgroup = true [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" diff --git a/hack/update/cri_dockerd/update_cri_dockerd.sh b/hack/update/cri_dockerd/update_cri_dockerd.sh index bf42db6de6..d48ecbf8d1 100755 --- a/hack/update/cri_dockerd/update_cri_dockerd.sh +++ b/hack/update/cri_dockerd/update_cri_dockerd.sh @@ -35,7 +35,8 @@ git checkout $version for (( i=0; i < ${#archarray[*]}; i++ )) do arch=${archarray[i]#"linux/"} - env GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build -ldflags "-X github.com/Mirantis/cri-dockerd/version.GitCommit=${version:0:7}" -o cri-dockerd-$arch + # If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change + env GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build -ldflags "-X github.com/Mirantis/cri-dockerd/cmd/version.GitCommit=${version:0:7}" -o cri-dockerd-$arch gsutil cp cri-dockerd-$arch gs://kicbase-artifacts/cri-dockerd/$version/$arch/cri-dockerd done diff --git a/pkg/minikube/cni/calico.go b/pkg/minikube/cni/calico.go index d16a9d83cf..0105266d25 100644 --- a/pkg/minikube/cni/calico.go +++ b/pkg/minikube/cni/calico.go @@ -50,6 +50,7 @@ type Calico struct { } type calicoTmplStruct struct { + PodCIDR string DeploymentImageName string DaemonSetImageName string BinaryImageName string @@ -69,6 +70,7 @@ func (c Calico) manifest() (assets.CopyableFile, error) { } input := &calicoTmplStruct{ + PodCIDR: DefaultPodCIDR, DeploymentImageName: images.CalicoDeployment(c.cc.KubernetesConfig.ImageRepository), DaemonSetImageName: images.CalicoDaemonSet(c.cc.KubernetesConfig.ImageRepository), BinaryImageName: images.CalicoBin(c.cc.KubernetesConfig.ImageRepository), diff --git a/pkg/minikube/cni/calico.yaml b/pkg/minikube/cni/calico.yaml index 9b3c99dd5e..4b344849b8 100644 --- a/pkg/minikube/cni/calico.yaml +++ b/pkg/minikube/cni/calico.yaml @@ -4550,6 +4550,8 @@ spec: # no effect. This should fall within `--cluster-cidr`. # - name: CALICO_IPV4POOL_CIDR # value: "192.168.0.0/16" + - name: CALICO_IPV4POOL_CIDR + value: {{ .PodCIDR }} # Disable file logging so `kubectl logs` works. - name: CALICO_DISABLE_FILE_LOGGING value: "true" diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index c3035192aa..963bd2da62 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -395,7 +395,7 @@ func (r *Containerd) CGroupDriver() (string, error) { if !ok { return "", errors.Wrapf(err, "config not map") } - cgroupManager := "cgroupfs" // default + cgroupManager := "systemd" // default: https://github.com/containerd/containerd/blob/main/docs/cri/config.md#cgroup-driver switch config["systemdCgroup"] { case false: cgroupManager = "cgroupfs" diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 33a861d559..50c415f728 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -707,7 +707,10 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri ExtraArguments: args, } - // TODO: remove once cri-dockerd is updated in future minikube release + // TODO (@prezha): remove once cri-dockerd is updated in future minikube release: + // deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.* + // deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.* + // note: https://github.com/Mirantis/cri-dockerd/blob/master/Makefile changed => also needs updating .mk files?! klog.Infof("replacing original cri-dockerd with v0.2.6-%s", runtime.GOARCH) if err := downloadCRIDockerdBinary(cr, "0.2.6", runtime.GOARCH); err != nil { klog.Warningf("unable to replace original cri-dockerd with v0.2.6-%s: %v", runtime.GOARCH, err) diff --git a/site/content/en/docs/faq/_index.md b/site/content/en/docs/faq/_index.md index 701da92a7d..3da7554e09 100644 --- a/site/content/en/docs/faq/_index.md +++ b/site/content/en/docs/faq/_index.md @@ -55,8 +55,8 @@ minikube addons enable auto-pause ## Docker Driver: How can I set minikube's cgroup manager? -By default minikube uses the `cgroupfs` cgroup manager for Kubernetes clusters. If you are on a system with a systemd cgroup manager, this could cause conflicts. -To use the `systemd` cgroup manager, run: +By default minikube uses the `systemd` cgroup manager for Kubernetes clusters. If you are on a system with a cgroupfs cgroup manager, this could cause conflicts. +To force the `systemd` cgroup manager, run: ```bash minikube start --force-systemd=true diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index c30a07f6b8..e8435c3e3d 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -61,7 +61,7 @@ func TestStartStop(t *testing.T) { "--feature-gates", "ServerSideApply=true", "--network-plugin=cni", - "--extra-config=kubeadm.pod-network-cidr=192.168.111.111/16", + "--extra-config=kubeadm.pod-network-cidr=10.42.0.0/16", }}, {"default-k8s-diff-port", constants.DefaultKubernetesVersion, []string{ "--apiserver-port=8444", From 167d90f54865e76e3e887adc212b406cab2d08f1 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Sun, 18 Dec 2022 04:35:22 +0000 Subject: [PATCH 19/44] improve log collection and update flannel manifest --- pkg/minikube/cni/flannel.yaml | 15 +- pkg/minikube/node/start.go | 2 +- test/integration/net_test.go | 388 +++++++++++++++++++++------------- 3 files changed, 254 insertions(+), 151 deletions(-) diff --git a/pkg/minikube/cni/flannel.yaml b/pkg/minikube/cni/flannel.yaml index 8b2d071697..378def674b 100644 --- a/pkg/minikube/cni/flannel.yaml +++ b/pkg/minikube/cni/flannel.yaml @@ -31,6 +31,13 @@ rules: - nodes/status verbs: - patch +- apiGroups: + - "networking.k8s.io" + resources: + - clustercidrs + verbs: + - list + - watch --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -123,8 +130,8 @@ spec: serviceAccountName: flannel initContainers: - name: install-cni-plugin - #image: flannelcni/flannel-cni-plugin:v1.1.0 for ppc64le and mips64le (dockerhub limitations may apply) - image: docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.0 + #image: flannelcni/flannel-cni-plugin:v1.1.2 #for ppc64le and mips64le (dockerhub limitations may apply) + image: docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.2 command: - cp args: @@ -135,7 +142,7 @@ spec: - name: cni-plugin mountPath: /opt/cni/bin - name: install-cni - #image: flannelcni/flannel:v0.20.2 for ppc64le and mips64le (dockerhub limitations may apply) + #image: flannelcni/flannel:v0.20.2 #for ppc64le and mips64le (dockerhub limitations may apply) image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2 command: - cp @@ -150,7 +157,7 @@ spec: mountPath: /etc/kube-flannel/ containers: - name: kube-flannel - #image: flannelcni/flannel:v0.20.2 for ppc64le and mips64le (dockerhub limitations may apply) + #image: flannelcni/flannel:v0.20.2 #for ppc64le and mips64le (dockerhub limitations may apply) image: docker.io/rancher/mirrored-flannelcni-flannel:v0.20.2 command: - /opt/bin/flanneld diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 20a17dc381..da994b9225 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -441,7 +441,7 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k // if cni is used, ensure all default CNI(s) are disabled on every node start if err := cni.DisableAllBridgeCNIs(runner, cc); err != nil { - klog.Errorf("unable to disable default CNI(s): %v", err) + klog.Errorf("unable to disable preinstalled bridge CNI(s): %v", err) } if kv.GTE(semver.MustParse("1.24.0-alpha.2")) { diff --git a/test/integration/net_test.go b/test/integration/net_test.go index e24087c6d8..f94e9bcf8e 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -76,8 +76,10 @@ func TestNetworkPlugins(t *testing.T) { t.Run(tc.name, func(t *testing.T) { profile := tc.name + suffix - ctx, cancel := context.WithTimeout(context.Background(), Minutes(40)) + ctx, cancel := context.WithTimeout(context.Background(), Minutes(90)) defer CleanupWithLogs(t, profile, cancel) + // collect debug logs + defer debugLogs(t, profile) if ContainerRuntime() != "docker" && tc.name == "false" { // CNI is required for current container runtime @@ -100,7 +102,6 @@ func TestNetworkPlugins(t *testing.T) { t.Run("Start", func(t *testing.T) { _, err := Run(t, exec.CommandContext(ctx, Target(), startArgs...)) if err != nil { - t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed start: %v", err) } }) @@ -108,7 +109,6 @@ func TestNetworkPlugins(t *testing.T) { if !t.Failed() && tc.podLabel != "" { t.Run("ControllerPod", func(t *testing.T) { if _, err := PodWait(ctx, t, profile, tc.namespace, tc.podLabel, Minutes(10)); err != nil { - t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed waiting for %s labeled pod: %v", tc.podLabel, err) } }) @@ -124,7 +124,6 @@ func TestNetworkPlugins(t *testing.T) { rr, err = Run(t, exec.CommandContext(ctx, Target(), "ssh", "-p", profile, "pgrep -a kubelet")) } if err != nil { - t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("ssh failed: %v", err) } out := rr.Stdout.String() @@ -145,7 +144,6 @@ func TestNetworkPlugins(t *testing.T) { client, err := kapi.Client(profile) if err != nil { - t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed to get Kubernetes client for %s: %v", profile, err) } @@ -154,7 +152,6 @@ func TestNetworkPlugins(t *testing.T) { } if _, err := PodWait(ctx, t, profile, "default", "app=netcat", Minutes(15)); err != nil { - t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) t.Fatalf("failed waiting for netcat pod: %v", err) } }) @@ -205,10 +202,6 @@ func TestNetworkPlugins(t *testing.T) { }) } - if t.Failed() { - t.Logf(">>> debugLogs:\n%s\n<<<", debugLogs(profile)) - } - t.Logf("%q test finished in %s, failed=%v", tc.name, time.Since(start), t.Failed()) }) } @@ -278,177 +271,120 @@ func verifyKubeletFlagsOutput(t *testing.T, k8sVersion, kubeletPlugin, out strin } // debug logs for dns and other network issues -func debugLogs(profile string) string { +func debugLogs(t *testing.T, profile string) { + t.Helper() + + start := time.Now() + var output strings.Builder + output.WriteString(fmt.Sprintf("<<< debugLogs: %s [pass: %v] head >>>\n\n", profile, !t.Failed())) - cmd := exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-type=a", "kubernetes.default") - out, _ := cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: nslookup type A kubernetes.default:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-debug", "kubernetes.default") - out, _ = cmd.CombinedOutput() + // basic nslookup + cmd := exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-timeout=5", "kubernetes.default") + out, err := cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> netcat: nslookup kubernetes.default:\n%s\n", out)) + // skip some checks if no issues or lower-level connectivity issues + if err == nil && !strings.Contains(string(out), "10.96.0.1") || err != nil && !strings.Contains(string(out), ";; connection timed out; no servers could be reached") { // for both nslookup and dig + // nslookup trace search + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-timeout=5", "-debug", "-type=a", "kubernetes.default") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: nslookup debug kubernetes.default a-records:\n%s\n", out)) - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-debug", "kubernetes.default.svc.cluster.local") + // dig trace search udp + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "+timeout=5", "+search", "+showsearch", "kubernetes.default") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: dig search kubernetes.default:\n%s\n", out)) + // dig trace direct udp + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "+timeout=5", "@10.96.0.10", "kubernetes.default.svc.cluster.local") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: dig @10.96.0.10 kubernetes.default.svc.cluster.local udp/53:\n%s\n", out)) + // dig trace direct tcp + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "+timeout=5", "@10.96.0.10", "+tcp", "kubernetes.default.svc.cluster.local") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> netcat: dig @10.96.0.10 kubernetes.default.svc.cluster.local tcp/53:\n%s\n", out)) + } + + // check udp connectivity + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nc", "-w", "5", "-z", "-n", "-v", "-u", "10.96.0.10", "53") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: nslookup kubernetes.default.svc.cluster.local:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "kubernetes.default") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: dig kubernetes.default:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "kubernetes.default.svc.cluster.local") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: dig kubernetes.default.svc.cluster.local:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "@10.96.0.10", "kubernetes.default") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: dig @10.96.0.10 kubernetes.default:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "dig", "@10.96.0.10", "kubernetes.default.svc.cluster.local") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: dig @10.96.0.10 kubernetes.default.svc.cluster.local:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "ping", "-c", "1", "-w", "1", "kubernetes.default") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: ping kubernetes.default:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "ping", "-c", "1", "-w", "1", "kubernetes.default.svc.cluster.local") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: ping kubernetes.default.svc.cluster.local:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nc", "-z", "-w", "5", "-v", "10.96.0.10", "53") + output.WriteString(fmt.Sprintf("\n>>> netcat: nc 10.96.0.10 udp/53:\n%s\n", out)) + // check tcp connectivity + cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nc", "-w", "5", "-z", "-n", "-v", "10.96.0.10", "53") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> netcat: nc 10.96.0.10 tcp/53:\n%s\n", out)) - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nc", "-z", "-w", "5", "-u", "-v", "10.96.0.10", "53") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> netcat: nc 10.96.0.10 udp/53:\n%s\n", out)) - + // pod's dns env cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "cat", "/etc/nsswitch.conf") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> netcat: /etc/nsswitch.conf:\n%s\n", out)) - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "cat", "/etc/hosts") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> netcat: /etc/hosts:\n%s\n", out)) - cmd = exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "cat", "/etc/resolv.conf") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> netcat: /etc/resolv.conf:\n%s\n", out)) + // "host's" dns env cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/nsswitch.conf") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/nsswitch.conf:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/hosts") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/hosts:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/resolv.conf") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/resolv.conf:\n%s\n", out)) - cmd = exec.Command("kubectl", "config", "view") + // k8s resources overview + cmd = exec.Command("kubectl", "--context", profile, "get", "node,svc,ep,ds,deploy,pods", "-A", "-owide") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: kubectl config:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "get", "cm", "-A", "-oyaml") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: cms:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "get", "node", "-A", "-owide") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: nodes:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "get", "svc", "-A", "-owide") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: svcs:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "get", "ep", "-A", "-owide") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: eps:\n%s\n", out)) - - cmd = exec.Command("kubectl", "--context", profile, "get", "pods", "-A", "-owide") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: pods:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> k8s: nodes, services, endpoints, daemon sets, deployments and pods, :\n%s\n", out)) + // crictl pods overview cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo crictl pods") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: crictl pods:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf") + // crictl containers overview + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo crictl ps --all") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /etc/systemd/system/kubelet.service.d/10-kubeadm.conf:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> host: crictl containers:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/kubernetes/kubelet.conf") + cmd = exec.Command("kubectl", "--context", profile, "describe", "deployment", "-n", "default", "--selector=app=netcat") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /etc/kubernetes/kubelet.conf:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> k8s: describe netcat deployment:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /var/lib/kubelet/config.yaml") + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-n", "default", "--selector=app=netcat") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /var/lib/kubelet/config.yaml:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> k8s: describe netcat pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "-n", "default", "--selector=app=netcat", "--tail=-1") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: netcat logs:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "deployment", "-n", "kube-system", "--selector=k8s-app=kube-dns") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe coredns deployment:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-n", "kube-system", "--selector=k8s-app=kube-dns") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe coredns pods:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "-n", "kube-system", "--selector=k8s-app=kube-dns", "--tail=-1") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: coredns logs:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-n", "kube-system", "--selector=component=kube-apiserver") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe api server pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "-n", "kube-system", "--selector=component=kube-apiserver", "--tail=-1") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: api server logs:\n%s\n", out)) cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo find /etc/cni -type f -exec sh -c 'echo {}; cat {}' \\;") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /etc/cni:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status docker | cat") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: docker daemon:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/docker/daemon.json") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /etc/docker/daemon.json:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo docker system info") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: docker system info:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status cri-docker | cat") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: cri daemon:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/cri-docker.service.d/10-cni.conf") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /etc/systemd/system/cri-docker.service.d/10-cni.conf:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /usr/lib/systemd/system/cri-docker.service") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /usr/lib/systemd/system/cri-docker.service:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cri-dockerd --version") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: cri-dockerd version:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status containerd | cat") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: containerd daemon:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /lib/systemd/system/containerd.service") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /lib/systemd/system/containerd.service:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/containerd/config.toml") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /etc/containerd/config.toml:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo containerd config dump") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: containerd config dump:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status crio | cat") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: crio daemon:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo find /etc/crio -type f -exec sh -c 'echo {}; cat {}' \\;") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /etc/crio:\n%s\n", out)) - - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo crio config") - out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: crio config:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo ip a s") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: ip a s:\n%s\n", out)) @@ -461,25 +397,185 @@ func debugLogs(profile string) string { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: iptables-save:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo iptables -t nat -L") + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo iptables -t nat -L -n -v") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: iptables table nat:\n%s\n", out)) - cmd = exec.Command("kubectl", "--context", profile, "-n", "kube-system", "logs", "--selector=k8s-app=kube-proxy", "--tail=-1") + if strings.Contains(profile, "flannel") { + cmd = exec.Command("kubectl", "--context", profile, "describe", "ds", "-A", "--selector=app=flannel") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe flannel daemon set:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=app=flannel") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe flannel pod(s):\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /run/flannel/subnet.env") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /run/flannel/subnet.env:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/kube-flannel/cni-conf.json") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/kube-flannel/cni-conf.json:\n%s\n", out)) + } + + if strings.Contains(profile, "calico") { + cmd = exec.Command("kubectl", "--context", profile, "describe", "ds", "-A", "--selector=k8s-app=calico-node") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe calico daemon set:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=k8s-app=calico-node") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe calico daemon set pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "deploy", "-A", "--selector=k8s-app=calico-kube-controllers") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe calico deployment:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=k8s-app=calico-kube-controllers") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe calico deployment pod(s):\n%s\n", out)) + } + + if strings.Contains(profile, "cilium") { + cmd = exec.Command("kubectl", "--context", profile, "describe", "ds", "-A", "--selector=k8s-app=cilium") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe cilium daemon set:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=k8s-app=cilium") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe cilium daemon set pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "deploy", "-A", "--selector=name=cilium-operator") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe cilium deployment:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=name=cilium-operator") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe cilium deployment pod(s):\n%s\n", out)) + } + + if strings.Contains(profile, "kindnet") { + cmd = exec.Command("kubectl", "--context", profile, "describe", "ds", "-A", "--selector=app=kindnet") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe kindnet daemon set:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=app=kindnet") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe kindnet pod(s):\n%s\n", out)) + } + + cmd = exec.Command("kubectl", "--context", profile, "describe", "ds", "-n", "kube-system", "--selector=k8s-app=kube-proxy") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe kube-proxy daemon set:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-n", "kube-system", "--selector=k8s-app=kube-proxy") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: describe kube-proxy pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "-n", "kube-system", "--selector=k8s-app=kube-proxy", "--tail=-1") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: kube-proxy logs:\n%s\n", out)) - cmd = exec.Command("kubectl", "--context", profile, "-n", "kube-system", "logs", "--selector=k8s-app=kube-dns", "--tail=-1") + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status kubelet --all --full --no-pager") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> k8s: coredns logs:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> host: kubelet daemon status:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo journalctl -xeu kubelet --all --no-pager") + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl cat kubelet --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: kubelet daemon config:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo journalctl -xeu kubelet --all --full --no-pager") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: kubelet logs:\n%s\n", out)) - cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /run/flannel/subnet.env") + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/kubernetes/kubelet.conf") out, _ = cmd.CombinedOutput() - output.WriteString(fmt.Sprintf("\n>>> host: /run/flannel/subnet.env:\n%s\n", out)) + output.WriteString(fmt.Sprintf("\n>>> host: /etc/kubernetes/kubelet.conf:\n%s\n", out)) - return output.String() + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /var/lib/kubelet/config.yaml") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /var/lib/kubelet/config.yaml:\n%s\n", out)) + + cmd = exec.Command("kubectl", "config", "view") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: kubectl config:\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "get", "cm", "-A", "-oyaml") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: cms:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status docker --all --full --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: docker daemon status:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl cat docker --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: docker daemon config:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/docker/daemon.json") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/docker/daemon.json:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo docker system info") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: docker system info:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status cri-docker --all --full --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: cri-docker daemon status:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl cat cri-docker --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: cri-docker daemon config:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/systemd/system/cri-docker.service.d/10-cni.conf") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/systemd/system/cri-docker.service.d/10-cni.conf:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /usr/lib/systemd/system/cri-docker.service") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /usr/lib/systemd/system/cri-docker.service:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cri-dockerd --version") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: cri-dockerd version:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status containerd --all --full --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: containerd daemon status:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl cat containerd --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: containerd daemon config:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /lib/systemd/system/containerd.service") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /lib/systemd/system/containerd.service:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /etc/containerd/config.toml") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/containerd/config.toml:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo containerd config dump") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: containerd config dump:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl status crio --all --full --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: crio daemon status:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo systemctl cat crio --no-pager") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: crio daemon config:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo find /etc/crio -type f -exec sh -c 'echo {}; cat {}' \\;") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: /etc/crio:\n%s\n", out)) + + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo crio config") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> host: crio config:\n%s\n", out)) + + t.Logf("%s\n>>> debugLogs: %s [pass: %v] took: %v <<<\n\n", output.String(), profile, !t.Failed(), time.Since(start)) } From 9531b379736c55907a927ce8d07b6d444a0f5787 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 19 Dec 2022 02:58:31 +0000 Subject: [PATCH 20/44] fix subnet reservation --- pkg/network/network.go | 54 +++++++++---------------------------- pkg/network/network_test.go | 4 ++- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/pkg/network/network.go b/pkg/network/network.go index bdd1c9a275..a018f987ec 100644 --- a/pkg/network/network.go +++ b/pkg/network/network.go @@ -20,17 +20,16 @@ import ( "encoding/binary" "fmt" "net" - "sync" "time" + "github.com/juju/mutex/v2" "k8s.io/klog/v2" + "k8s.io/minikube/pkg/util/lock" ) const defaultReservationPeriod = 1 * time.Minute var ( - reservedSubnets = sync.Map{} - // valid private network subnets (RFC1918) privateSubnets = []net.IPNet{ // 10.0.0.0/8 @@ -51,11 +50,6 @@ var ( } ) -// reservation of free private subnet is held for defined reservation period from createdAt time. -type reservation struct { - createdAt time.Time -} - // Parameters contains main network parameters. type Parameters struct { IP string // IP address of network @@ -67,6 +61,7 @@ type Parameters struct { ClientMax string // last IP address before broadcast Broadcast string // last IP address Interface + reservation mutex.Releaser // subnet reservation has lifespan of the process: "If a process dies while the mutex is held, the mutex is automatically released." } // Interface contains main network interface parameters. @@ -238,7 +233,8 @@ func FreeSubnet(startSubnet string, step, tries int) (*Parameters, error) { return nil, err } if !taken { - if ok := reserveSubnet(subnet, defaultReservationPeriod); ok { + if reservation, err := reserveSubnet(subnet, defaultReservationPeriod); err == nil { + n.reservation = reservation klog.Infof("using free private subnet %s: %+v", n.CIDR, n) return n, nil } @@ -261,37 +257,13 @@ func FreeSubnet(startSubnet string, step, tries int) (*Parameters, error) { return nil, fmt.Errorf("no free private network subnets found with given parameters (start: %q, step: %d, tries: %d)", startSubnet, step, tries) } -// reserveSubnet returns if subnet was successfully reserved for given period: -// - false, if it already has unexpired reservation -// - true, if new reservation was created or expired one renewed -// uses sync.Map to manage reservations thread-safe -var reserveSubnet = func(subnet string, period time.Duration) bool { - // put nil reservation{} Map value for subnet Map key - // to block other processes from concurrently changing this subnet - r, loaded := reservedSubnets.LoadOrStore(subnet, nil) - // check if there was previously issued reservation - if loaded { - // back off if previous reservation was already set to 'nil' - // as then other process is already managing this subnet concurrently - if r == nil { - klog.Infof("backing off reserving subnet %s (other process is managing it!): %+v", subnet, &reservedSubnets) - return false - } - // check if previous reservation expired - createdAt := r.(reservation).createdAt - if time.Since(createdAt) < period { - // unexpired reservation: restore original createdAt value - reservedSubnets.Store(subnet, reservation{createdAt: createdAt}) - klog.Infof("skipping subnet %s that has unexpired reservation: %+v", subnet, &reservedSubnets) - return false - } - // expired reservation: renew setting createdAt to now - reservedSubnets.Store(subnet, reservation{createdAt: time.Now()}) - klog.Infof("reusing subnet %s that has expired reservation: %+v", subnet, &reservedSubnets) - return true +// reserveSubnet returns releaser if subnet was successfully reserved for given period, creating lock for subnet to avoid race condition between multiple minikube instances (especially white testing in parallel). +var reserveSubnet = func(subnet string, period time.Duration) (mutex.Releaser, error) { + spec := lock.PathMutexSpec(subnet) + spec.Timeout = 1 * time.Millisecond // practically: just check, don't wait + reservation, err := mutex.Acquire(spec) + if err != nil { + return nil, err } - // new reservation - klog.Infof("reserving subnet %s for %v: %+v", subnet, period, &reservedSubnets) - reservedSubnets.Store(subnet, reservation{createdAt: time.Now()}) - return true + return reservation, nil } diff --git a/pkg/network/network_test.go b/pkg/network/network_test.go index 9bff64d09c..466cb1e61d 100644 --- a/pkg/network/network_test.go +++ b/pkg/network/network_test.go @@ -20,6 +20,8 @@ import ( "strings" "testing" "time" + + "github.com/juju/mutex/v2" ) func TestIsSubnetPrivate(t *testing.T) { @@ -49,7 +51,7 @@ func TestIsSubnetPrivate(t *testing.T) { } func TestFreeSubnet(t *testing.T) { - reserveSubnet = func(subnet string, period time.Duration) bool { return true } + reserveSubnet = func(subnet string, period time.Duration) (mutex.Releaser, error) { return nil, nil } t.Run("NoRetriesSuccess", func(t *testing.T) { startingSubnet := "192.168.0.0" From 735ac02aacee61177baad9eb0c260e4a15fe4735 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 19 Dec 2022 20:32:23 +0000 Subject: [PATCH 21/44] get container logs --- .../bootstrapper/bsutil/kverify/api_server.go | 2 +- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 3 +- pkg/minikube/node/start.go | 5 +- test/integration/net_test.go | 48 +++++++++++++++++++ 4 files changed, 54 insertions(+), 4 deletions(-) diff --git a/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go b/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go index 7b40227e3f..2af2f19136 100644 --- a/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go +++ b/pkg/minikube/bootstrapper/bsutil/kverify/api_server.go @@ -149,7 +149,7 @@ func APIServerVersionMatch(client *kubernetes.Clientset, expected string) error // by container runtime restart for example and there is a gap before it comes back func WaitForAPIServerStatus(cr command.Runner, to time.Duration, hostname string, port int) (state.State, error) { var st state.State - err := wait.PollImmediate(200*time.Millisecond, to, func() (bool, error) { + err := wait.PollImmediate(500*time.Millisecond, to, func() (bool, error) { var err error st, err = APIServerStatus(cr, hostname, port) if st == state.Stopped { diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index 61f02224f8..095c72cfe8 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -596,7 +596,8 @@ func (k *Bootstrapper) needsReconfigure(conf string, hostname string, port int, } // cruntime.Enable() may restart kube-apiserver but does not wait for it to return back - apiStatusTimeout := 3000 * time.Millisecond + // could take five-ish seconds, so hopefully 10 seconds is sufficient to wait for api server to come back up + apiStatusTimeout := 10 * time.Second st, err := kverify.WaitForAPIServerStatus(k.c, apiStatusTimeout, hostname, port) if err != nil { klog.Infof("needs reconfigure: apiserver error: %v", err) diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index da994b9225..cb30a2ce6d 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -480,8 +480,9 @@ func forceSystemd(kv semver.Version) bool { if viper.IsSet("force-systemd") { return viper.GetBool("force-systemd") } - if env := os.Getenv(constants.MinikubeForceSystemdEnv); env != "" { - return env == "true" + env := os.Getenv(constants.MinikubeForceSystemdEnv) + if force, err := strconv.ParseBool(env); env != "" && err == nil { + return force } return kv.GTE(semver.Version{Major: 1, Minor: 22}) } diff --git a/test/integration/net_test.go b/test/integration/net_test.go index f94e9bcf8e..3cc1b55a2b 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -410,6 +410,14 @@ func debugLogs(t *testing.T, profile string) { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe flannel pod(s):\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-flannel", "--selector=app=flannel", "--all-containers", "--prefix", "--ignore-errors") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: flannel container(s) logs (current):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-flannel", "--selector=app=flannel", "--all-containers", "--prefix", "--ignore-errors", "--previous") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: flannel container(s) logs (previous):\n%s\n", out)) + cmd = exec.Command(Target(), "ssh", "-p", profile, "sudo cat /run/flannel/subnet.env") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: /run/flannel/subnet.env:\n%s\n", out)) @@ -428,6 +436,14 @@ func debugLogs(t *testing.T, profile string) { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe calico daemon set pod(s):\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=k8s-app=calico-node", "--all-containers", "--prefix", "--ignore-errors") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: calico daemon set container(s) logs (current):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=k8s-app=calico-node", "--all-containers", "--prefix", "--ignore-errors", "--previous") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: calico daemon set container(s) logs (previous):\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "describe", "deploy", "-A", "--selector=k8s-app=calico-kube-controllers") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe calico deployment:\n%s\n", out)) @@ -435,6 +451,14 @@ func debugLogs(t *testing.T, profile string) { cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=k8s-app=calico-kube-controllers") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe calico deployment pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=k8s-app=calico-kube-controllers", "--all-containers", "--prefix", "--ignore-errors") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: calico deployment container(s) logs (current):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=k8s-app=calico-kube-controllers", "--all-containers", "--prefix", "--ignore-errors", "--previous") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: calico deployment container(s) logs (previous):\n%s\n", out)) } if strings.Contains(profile, "cilium") { @@ -446,6 +470,14 @@ func debugLogs(t *testing.T, profile string) { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe cilium daemon set pod(s):\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=k8s-app=cilium", "--all-containers", "--prefix", "--ignore-errors") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: cilium daemon set container(s) logs (current):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=k8s-app=cilium", "--all-containers", "--prefix", "--ignore-errors", "--previous") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: cilium daemon set container(s) logs (previous):\n%s\n", out)) + cmd = exec.Command("kubectl", "--context", profile, "describe", "deploy", "-A", "--selector=name=cilium-operator") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe cilium deployment:\n%s\n", out)) @@ -453,6 +485,14 @@ func debugLogs(t *testing.T, profile string) { cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=name=cilium-operator") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe cilium deployment pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=name=cilium-operator", "--all-containers", "--prefix", "--ignore-errors") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: cilium deployment container(s) logs (current):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=name=cilium-operator", "--all-containers", "--prefix", "--ignore-errors", "--previous") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: cilium deployment container(s) logs (previous):\n%s\n", out)) } if strings.Contains(profile, "kindnet") { @@ -463,6 +503,14 @@ func debugLogs(t *testing.T, profile string) { cmd = exec.Command("kubectl", "--context", profile, "describe", "pods", "-A", "--selector=app=kindnet") out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> k8s: describe kindnet pod(s):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=app=kindnet", "--all-containers", "--prefix", "--ignore-errors") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: kindnet container(s) logs (current):\n%s\n", out)) + + cmd = exec.Command("kubectl", "--context", profile, "logs", "--namespace=kube-system", "--selector=app=kindnet", "--all-containers", "--prefix", "--ignore-errors", "--previous") + out, _ = cmd.CombinedOutput() + output.WriteString(fmt.Sprintf("\n>>> k8s: kindnet container(s) logs (previous):\n%s\n", out)) } cmd = exec.Command("kubectl", "--context", profile, "describe", "ds", "-n", "kube-system", "--selector=k8s-app=kube-proxy") From e59d6217a82ceccec53fc064e831ab4894b4ac26 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 26 Dec 2022 06:06:31 +0000 Subject: [PATCH 22/44] autoconfigure cni and cri with proper cgroup driver --- .../containerd-bin-aarch64/containerd.service | 2 +- .../package/containerd-bin/containerd.service | 2 +- hack/preload-images/generate.go | 4 +- pkg/minikube/cni/cni.go | 98 +++++++++++++----- pkg/minikube/config/types.go | 2 + pkg/minikube/constants/constants.go | 7 ++ pkg/minikube/cruntime/containerd.go | 48 +++++++-- pkg/minikube/cruntime/crio.go | 20 ++-- pkg/minikube/cruntime/cruntime.go | 26 ++++- pkg/minikube/cruntime/cruntime_test.go | 3 +- pkg/minikube/cruntime/docker.go | 99 +++++++------------ pkg/minikube/detect/detect.go | 49 +++++++++ pkg/minikube/node/start.go | 72 +++++++++++--- test/integration/net_test.go | 20 ++-- 14 files changed, 320 insertions(+), 132 deletions(-) diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service index c4e4331630..97758f26bb 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service @@ -9,7 +9,7 @@ EnvironmentFile=-/etc/sysconfig/containerd EnvironmentFile=-/etc/sysconfig/containerd.minikube EnvironmentFile=/var/run/minikube/env Environment=GOTRACEBACK=crash -ExecStartPre=-/sbin/modprobe overlay +ExecStartPre=/sbin/modprobe overlay ExecStart=/usr/bin/containerd \ $CONTAINERD_OPTIONS \ $CONTAINERD_MINIKUBE_OPTIONS \ diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service index c4e4331630..97758f26bb 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service @@ -9,7 +9,7 @@ EnvironmentFile=-/etc/sysconfig/containerd EnvironmentFile=-/etc/sysconfig/containerd.minikube EnvironmentFile=/var/run/minikube/env Environment=GOTRACEBACK=crash -ExecStartPre=-/sbin/modprobe overlay +ExecStartPre=/sbin/modprobe overlay ExecStart=/usr/bin/containerd \ $CONTAINERD_OPTIONS \ $CONTAINERD_MINIKUBE_OPTIONS \ diff --git a/hack/preload-images/generate.go b/hack/preload-images/generate.go index 0744d3fa1f..92e455e1ea 100644 --- a/hack/preload-images/generate.go +++ b/hack/preload-images/generate.go @@ -31,6 +31,7 @@ import ( "k8s.io/minikube/pkg/minikube/command" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/cruntime" + "k8s.io/minikube/pkg/minikube/detect" "k8s.io/minikube/pkg/minikube/localpath" "k8s.io/minikube/pkg/minikube/sysinit" "k8s.io/minikube/pkg/util" @@ -93,7 +94,8 @@ func generateTarball(kubernetesVersion, containerRuntime, tarballFilename string if err != nil { return errors.Wrap(err, "failed create new runtime") } - if err := cr.Enable(true, false, false); err != nil { + + if err := cr.Enable(true, detect.CgroupDriver(), false); err != nil { return errors.Wrap(err, "enable container runtime") } diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index 26857e645a..d6222cbe03 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -20,6 +20,7 @@ package cni import ( "context" "fmt" + "net" "os/exec" "path" "path/filepath" @@ -34,7 +35,6 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/driver" - "k8s.io/minikube/pkg/minikube/sysinit" "k8s.io/minikube/pkg/minikube/vmpath" ) @@ -176,10 +176,6 @@ func manifestAsset(b []byte) assets.CopyableFile { // applyManifest applies a CNI manifest func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) error { - if err := NameLoopback(r); err != nil { - klog.Warningf("unable to name loopback interface in applyManifest: %v", err) - } - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() @@ -198,12 +194,12 @@ func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) err return nil } -// NameLoopback ensures loopback has a name in its config file in /etc/cni/net.d -// cri-o is leaving it out atm (https://github.com/cri-o/cri-o/pull/6273) +// ConfigureLoopback ensures loopback has expected version ("1.0.0") and valid name ("loopback") in its config file in /etc/cni/net.d +// cri-o is leaving name out atm (https://github.com/cri-o/cri-o/pull/6273) // avoid errors like: // Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "..." network for pod "...": networkPlugin cni failed to set up pod "..." network: missing network name:, // failed to clean up sandbox container "..." network for pod "...": networkPlugin cni failed to teardown pod "..." network: missing network name] -func NameLoopback(r Runner) error { +func ConfigureLoopback(r Runner) error { loopback := "/etc/cni/net.d/*loopback.conf*" // usually: 200-loopback.conf // turn { "cniVersion": "0.3.1", "type": "loopback" } // into { "cniVersion": "0.3.1", "name": "loopback", "type": "loopback" } @@ -213,38 +209,90 @@ func NameLoopback(r Runner) error { } if _, err := r.RunCmd(exec.Command( "sudo", "find", filepath.Dir(loopback), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(loopback), "-exec", "sh", "-c", - `grep -q loopback {} && ( grep -q name {} || sudo sed -i '/"type": "loopback"/i \ \ \ \ "name": "loopback",' {} )`, ";")); err != nil { + `grep -q loopback {} && ( grep -q name {} || sudo sed -i '/"type": "loopback"/i \ \ \ \ "name": "loopback",' {} ) && sudo sed -i 's|"cniVersion": ".*"|"cniVersion": "1.0.0"|g' {}`, ";")); err != nil { return fmt.Errorf("unable to patch loopback config %q: %v", loopback, err) } return nil } -// DisableBridgeCNIs disables all default bridge CNIs on a node (designated by runner) by changing extension to "mk_disabled" of *bridge* config file(s) found in /etc/cni/net.d. -// It's usually called before deploying new CNI or on restarts, to avoid conflicts and flip-flopping of pods' ip addresses. +// ConfigureDefaultBridgeCNIs configures all default bridge CNIs on a node (designated by runner). +// If network plugin is set (could be, eg "cni" or "kubenet"), it will disable all default bridges by changing extension to "mk_disabled" of *bridge* config file(s) found in /etc/cni/net.d to avoid conflicts. +// Otherwise, it will change ip address range to match DefaultPodCIDR in all *bridge* config file(s) found in /etc/cni/net.d. +// It's usually called before deploying new CNI and on node restarts, to avoid conflicts and flip-flopping of pods' ip addresses. +// It is caller's responsibility to restart container runtime for these changes to take effect. // ref: https://github.com/containernetworking/cni/blob/main/libcni/conf.go -func DisableAllBridgeCNIs(r Runner, cc config.ClusterConfig) error { +// ref: https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/troubleshooting-cni-plugin-related-errors/ +func ConfigureDefaultBridgeCNIs(r Runner, networkPlugin string) error { + if networkPlugin != "" { + return disableAllBridgeCNIs(r) + } + + return configureAllBridgeCNIs(r, DefaultPodCIDR) +} + +func disableAllBridgeCNIs(r Runner) error { path := "/etc/cni/net.d" + out, err := r.RunCmd(exec.Command( - "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*.mk_disabled", "-printf", "%p|", "-exec", "sh", "-c", + "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", `sudo mv {} {}.mk_disabled`, ";")) if err != nil { return fmt.Errorf("failed to disable all bridge cni configs in %q: %v", path, err) } - configs := strings.Trim(out.Stdout.String(), "|") + configs := strings.Trim(out.Stdout.String(), ", ") if len(configs) == 0 { - klog.Infof("no bridge cni config found in %q - nothing to disable", configs, path) + klog.Infof("no bridge cni configs found in %q - nothing to disable", configs, path) return nil } - svc := cc.KubernetesConfig.ContainerRuntime - klog.Infof("disabled [%s] bridge cni config(s) in %q, now restarting selected %q container runtime", configs, path, svc) - - if svc == "cri-o" { - svc = "crio" - } - if err := sysinit.New(r).Restart(svc); err != nil { - klog.Warningf("failed to restart %q container runtime service in %q: %v", svc, cc.Name, err) - return err - } + klog.Infof("disabled [%s] bridge cni config(s)", configs) + + return nil +} + +func configureAllBridgeCNIs(r Runner, cidr string) error { + path := "/etc/cni/net.d" + configs := "" + + // non-podman configs: + out, err := r.RunCmd(exec.Command( + "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", + // remove ipv6 entries to avoid "failed to set bridge addr: could not add IP address to \"cni0\": permission denied" + // ref: https://github.com/cri-o/cri-o/issues/3555 + // then also remove trailing comma after ipv4 elements, if any + // ie, this will transform from, eg: + // from: "ranges": [ [{ "subnet": "10.85.0.0/16" }], [{ "subnet": "1100:200::/24" }] ] + // to: "ranges": [ [{ "subnet": "10.244.0.0/16" }] ] + // getting something similar to https://github.com/cri-o/cri-o/blob/main/contrib/cni/11-crio-ipv4-bridge.conflist + fmt.Sprintf(`sudo sed -i -r -e '/"dst": ".*:.*"/d' -e 's|^(.*)"dst": (.*)[,*]$|\1"dst": \2|g' -e '/"subnet": ".*:.*"/d' -e 's|^(.*)"subnet": ".*"(.*)[,*]$|\1"subnet": "%s"\2|g' {}`, cidr), ";")) + if err != nil { + klog.Errorf("failed to configure non-podman bridge cni configs in %q: %v", path, err) + } else { + configs = out.Stdout.String() + } + + // podman config(s): + // ref: https://github.com/containers/podman/blob/main/cni/87-podman-bridge.conflist + ip, ipnet, err := net.ParseCIDR(cidr) + if err != nil || ip.To4() == nil { + klog.Errorf("cidr %q is not valid ipv4 address: %v", cidr, err) + } else { + gateway := ip.Mask(ipnet.Mask) + gateway[3]++ + out, err = r.RunCmd(exec.Command( + "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", + fmt.Sprintf(`sudo sed -i -r -e 's|^(.*)"subnet": ".*"(.*)$|\1"subnet": "%s"\2|g' -e 's|^(.*)"gateway": ".*"(.*)$|\1"gateway": "%s"\2|g' {}`, cidr, gateway), ";")) + if err != nil { + klog.Errorf("failed to configure podman bridge cni configs in %q: %v", path, err) + } else { + configs += out.Stdout.String() + } + } + + if len(strings.Trim(configs, ", ")) == 0 { + klog.Infof("no bridge cni configs found in %q - nothing to configure", configs, path) + return nil + } + klog.Infof("configured [%s] bridge cni config(s)", configs) return nil } diff --git a/pkg/minikube/config/types.go b/pkg/minikube/config/types.go index 10e6ef8a8a..ec0d1abb65 100644 --- a/pkg/minikube/config/types.go +++ b/pkg/minikube/config/types.go @@ -115,6 +115,7 @@ type KubernetesConfig struct { APIServerNames []string APIServerIPs []net.IP DNSDomain string + CgroupDriver string ContainerRuntime string CRISocket string NetworkPlugin string @@ -144,6 +145,7 @@ type Node struct { IP string Port int KubernetesVersion string + CgroupDriver string ContainerRuntime string ControlPlane bool Worker bool diff --git a/pkg/minikube/constants/constants.go b/pkg/minikube/constants/constants.go index ff5d33da5f..ec614208d6 100644 --- a/pkg/minikube/constants/constants.go +++ b/pkg/minikube/constants/constants.go @@ -54,6 +54,7 @@ const ( SSHPort = 22 // RegistryAddonPort os the default registry addon port RegistryAddonPort = 5000 + // Containerd is the default name and spelling for the containerd container runtime Containerd = "containerd" // CRIO is the default name and spelling for the cri-o container runtime @@ -63,6 +64,12 @@ const ( // DefaultContainerRuntime is our default container runtime DefaultContainerRuntime = "" + // cgroup drivers + DefaultCgroupDriver = "systemd" + CgroupfsCgroupDriver = "cgroupfs" + SystemdCgroupDriver = "systemd" + UnknownCgroupDriver = "" + // APIServerName is the default API server name APIServerName = "minikubeCA" // ClusterDNSDomain is the default DNS domain diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 963bd2da62..7778365e24 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -26,6 +26,7 @@ import ( "os" "os/exec" "path" + "runtime" "strings" "time" @@ -37,6 +38,7 @@ import ( "k8s.io/minikube/pkg/minikube/cni" "k8s.io/minikube/pkg/minikube/command" "k8s.io/minikube/pkg/minikube/config" + "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/download" "k8s.io/minikube/pkg/minikube/style" "k8s.io/minikube/pkg/minikube/sysinit" @@ -127,18 +129,36 @@ func (r *Containerd) Available() error { } // generateContainerdConfig sets up /etc/containerd/config.toml & /etc/containerd/containerd.conf.d/02-containerd.conf -func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semver.Version, forceSystemd bool, insecureRegistry []string, inUserNamespace bool) error { +func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semver.Version, cgroupDriver string, insecureRegistry []string, inUserNamespace bool) error { pauseImage := images.Pause(kv, imageRepository) - if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*sandbox_image = .*$|sandbox_image = \"%s\"|' -i %s", pauseImage, containerdConfigFile))); err != nil { + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)sandbox_image = .*$|\1sandbox_image = %q|' %s`, pauseImage, containerdConfigFile))); err != nil { return errors.Wrap(err, "update sandbox_image") } - if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*restrict_oom_score_adj = .*$|restrict_oom_score_adj = %t|' -i %s", inUserNamespace, containerdConfigFile))); err != nil { + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)restrict_oom_score_adj = .*$|\1restrict_oom_score_adj = %t|' %s`, inUserNamespace, containerdConfigFile))); err != nil { return errors.Wrap(err, "update restrict_oom_score_adj") } - if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*SystemdCgroup = .*$|SystemdCgroup = %t|' -i %s", forceSystemd, containerdConfigFile))); err != nil { - return errors.Wrap(err, "update SystemdCgroup") + // configure cgroup driver + if cgroupDriver != constants.UnknownCgroupDriver { + klog.Infof("configuring containerd to use %q as cgroup driver...", cgroupDriver) + useSystemd := cgroupDriver == constants.SystemdCgroupDriver + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)SystemdCgroup = .*$|\1SystemdCgroup = %t|g' %s`, useSystemd, containerdConfigFile))); err != nil { + return errors.Wrap(err, "configuring SystemdCgroup") + } } - if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*conf_dir = .*$|conf_dir = \"%s\"|' -i %s", cni.DefaultConfDir, containerdConfigFile))); err != nil { + // handle deprecated features + // ref: https://github.com/containerd/containerd/blob/main/RELEASES.md#deprecated-features + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|"io.containerd.runtime.v1.linux"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { + return errors.Wrap(err, "configuring io.containerd.runtime version") + } + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|"io.containerd.runc.v1"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { + return errors.Wrap(err, "configuring io.containerd.runc version") + } + // ensure conf_dir is using '/etc/cni/net.d' + // TODO (@prezha): this should be removed (ie, not needed) once we remove "hardcoded" '/etc/cni/net.mk' folder in minikube distro + if _, err := cr.RunCmd(exec.Command("sh", "-c", `sudo rm -rf /etc/cni/net.mk`)); err != nil { + return fmt.Errorf("unable to remove /etc/cni/net.mk directory: %v", err) + } + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)conf_dir = .*$|\1conf_dir = %q|g' %s`, cni.DefaultConfDir, containerdConfigFile))); err != nil { return errors.Wrap(err, "update conf_dir") } @@ -176,7 +196,7 @@ func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semve // Enable idempotently enables containerd on a host // It is also called by docker.Enable() - if bound to containerd, to enforce proper containerd configuration completed by service restart. -func (r *Containerd) Enable(disOthers, forceSystemd, inUserNamespace bool) error { +func (r *Containerd) Enable(disOthers bool, cgroupDriver string, inUserNamespace bool) error { if inUserNamespace { if err := CheckKernelCompatibility(r.Runner, 5, 11); err != nil { // For using overlayfs @@ -195,13 +215,25 @@ func (r *Containerd) Enable(disOthers, forceSystemd, inUserNamespace bool) error if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil { return err } - if err := generateContainerdConfig(r.Runner, r.ImageRepository, r.KubernetesVersion, forceSystemd, r.InsecureRegistry, inUserNamespace); err != nil { + + if err := generateContainerdConfig(r.Runner, r.ImageRepository, r.KubernetesVersion, cgroupDriver, r.InsecureRegistry, inUserNamespace); err != nil { return err } if err := enableIPForwarding(r.Runner); err != nil { return err } + // TODO (@prezha): remove this hack after proper version update in minikube release + // ref: https://github.com/containerd/containerd/blob/main/RELEASES.md#kubernetes-support + targetVersion := "1.6.14" + currentVersion, err := r.Version() + if err == nil && semver.MustParse(targetVersion).GT(semver.MustParse(currentVersion)) { + klog.Infof("replacing original containerd with v%s-%s-%s", targetVersion, runtime.GOOS, runtime.GOARCH) + if err := updateContainerdBinary(r.Runner, targetVersion, runtime.GOOS, runtime.GOARCH); err != nil { + klog.Warningf("unable to replace original containerd with v%s-%s-%s: %v", targetVersion, runtime.GOOS, runtime.GOARCH, err) + } + } + // Otherwise, containerd will fail API requests with 'Unimplemented' return r.Init.Restart("containerd") } diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index f616814dfd..b3d40cc920 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -34,6 +34,7 @@ import ( "k8s.io/minikube/pkg/minikube/cni" "k8s.io/minikube/pkg/minikube/command" "k8s.io/minikube/pkg/minikube/config" + "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/download" "k8s.io/minikube/pkg/minikube/style" "k8s.io/minikube/pkg/minikube/sysinit" @@ -72,10 +73,15 @@ func generateCRIOConfig(cr CommandRunner, imageRepository string, kv semver.Vers return nil } -func (r *CRIO) forceSystemd() error { - c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*cgroup_manager = .*$|cgroup_manager = \"systemd\"|' -i %s", crioConfigFile)) +func (r *CRIO) setCGroup(driver string) error { + if driver == constants.UnknownCgroupDriver { + return fmt.Errorf("unable to configure cri-o to use unknown cgroup driver") + } + + klog.Infof("configuring cri-o to use %q as cgroup driver...", driver) + c := exec.Command("/bin/bash", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)cgroup_manager = .*$|\1cgroup_manager = %q|' %s`, driver, crioConfigFile)) if _, err := r.Runner.RunCmd(c); err != nil { - return errors.Wrap(err, "force systemd") + return errors.Wrap(err, "configuring cgroup_manager") } return nil @@ -185,7 +191,7 @@ Environment="_CRIO_ROOTLESS=1" } // Enable idempotently enables CRIO on a host -func (r *CRIO) Enable(disOthers, forceSystemd, inUserNamespace bool) error { +func (r *CRIO) Enable(disOthers bool, cgroupDriver string, inUserNamespace bool) error { if disOthers { if err := disableOthers(r, r.Runner); err != nil { klog.Warningf("disableOthers: %v", err) @@ -200,10 +206,8 @@ func (r *CRIO) Enable(disOthers, forceSystemd, inUserNamespace bool) error { if err := enableIPForwarding(r.Runner); err != nil { return err } - if forceSystemd { - if err := r.forceSystemd(); err != nil { - return err - } + if err := r.setCGroup(cgroupDriver); err != nil { + return err } if inUserNamespace { if err := CheckKernelCompatibility(r.Runner, 5, 11); err != nil { diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index 4b4017a71e..20a6069b9c 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -81,7 +81,7 @@ type Manager interface { // Version retrieves the current version of this runtime Version() (string, error) // Enable idempotently enables this runtime on a host - Enable(bool, bool, bool) error + Enable(bool, string, bool) error // Disable idempotently disables this runtime on a host Disable() error // Active returns whether or not a runtime is active on a host @@ -351,3 +351,27 @@ func ConfigureNetworkPlugin(r Manager, cr CommandRunner, networkPlugin string) e } return dockerConfigureNetworkPlugin(*dm, cr, networkPlugin) } + +// updateCRIDockerdBinary updates cri-dockerd to version +func updateCRIDockerdBinary(cr CommandRunner, version, arch string) error { + curl := fmt.Sprintf("curl -sSfL https://github.com/Mirantis/cri-dockerd/releases/download/v%s/cri-dockerd-%s.%s.tgz | tar -xz -C /tmp", version, version, arch) + if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { + return fmt.Errorf("unable to download cri-dockerd version %s: %v", version, err) + } + if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/tmp/cri-dockerd/cri-dockerd", "/usr/bin/cri-dockerd")); err != nil { + return fmt.Errorf("unable to install cri-dockerd version %s: %v", version, err) + } + return nil +} + +// updateContainerdBinary updates containerd to version +func updateContainerdBinary(cr CommandRunner, version, os, arch string) error { + curl := fmt.Sprintf("curl -sSfL https://github.com/containerd/containerd/releases/download/v%s/containerd-%s-%s-%s.tar.gz | tar -xz -C /tmp", version, version, os, arch) + if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { + return fmt.Errorf("unable to download containerd version %s: %v", version, err) + } + if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", "mv /tmp/bin/* /usr/bin/")); err != nil { // note: has to run in subshell because of wildcard! + return fmt.Errorf("unable to install containerd version %s: %v", version, err) + } + return nil +} diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index 5dc65fb11c..2ae447a453 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -30,6 +30,7 @@ import ( "k8s.io/klog/v2" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/command" + "k8s.io/minikube/pkg/minikube/constants" ) func TestName(t *testing.T) { @@ -699,7 +700,7 @@ func TestEnable(t *testing.T) { if err != nil { t.Fatalf("New(%s): %v", tc.runtime, err) } - err = cr.Enable(true, false, false) + err = cr.Enable(true, constants.CgroupfsCgroupDriver, false) if err != nil { t.Errorf("%s disable unexpected error: %v", tc.runtime, err) } diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 50c415f728..f9ac91aaed 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -34,9 +34,9 @@ import ( "k8s.io/klog/v2" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/bootstrapper/images" - "k8s.io/minikube/pkg/minikube/cni" "k8s.io/minikube/pkg/minikube/command" "k8s.io/minikube/pkg/minikube/config" + "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/docker" "k8s.io/minikube/pkg/minikube/download" "k8s.io/minikube/pkg/minikube/image" @@ -127,7 +127,7 @@ func (r *Docker) Active() bool { } // Enable idempotently enables Docker on a host -func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error { +func (r *Docker) Enable(disOthers bool, cgroupDriver string, inUserNamespace bool) error { if inUserNamespace { return errors.New("inUserNamespace must not be true for docker") } @@ -137,14 +137,6 @@ func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error { klog.Warningf("disableOthers: %v", err) } } - // check if containerd is still alive (hopefully because being being bound to docker), and if so: ensure it's configured properly by calling its Enable() method - cdr, errCdR := New(Config{Type: "containerd", Runner: r.Runner}) - if errCdR == nil && cdr.Active() { - errCdR = cdr.Enable(false, forceSystemd, inUserNamespace) - } - if errCdR != nil { - klog.Warningf("cannot ensure containerd (as bound to docker) is configured properly and reloaded - cluster might be unstable: %v", errCdR) - } if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil { return err @@ -158,10 +150,8 @@ func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error { klog.ErrorS(err, "Failed to enable", "service", "docker.socket") } - if forceSystemd { - if err := r.forceSystemd(); err != nil { - return err - } + if err := r.setCGroup(cgroupDriver); err != nil { + return err } if err := r.Init.Restart("docker"); err != nil { @@ -169,6 +159,16 @@ func (r *Docker) Enable(disOthers, forceSystemd, inUserNamespace bool) error { } if r.CRIService != "" { + // TODO (@prezha): remove this hack after proper version update in minikube release + // deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.* + // deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.* + // note: https://github.com/Mirantis/cri-dockerd/blob/master/Makefile changed => also needs updating .mk files?! + targetVersion := "0.2.6" + klog.Infof("replacing original cri-dockerd with v%s-%s", targetVersion, runtime.GOARCH) + if err := updateCRIDockerdBinary(r.Runner, targetVersion, runtime.GOARCH); err != nil { + klog.Warningf("unable to replace original cri-dockerd with v%s-%s: %v", targetVersion, runtime.GOARCH, err) + } + if err := r.Init.Enable(r.CRIService); err != nil { return err } @@ -515,18 +515,23 @@ func (r *Docker) SystemLogCmd(len int) string { return fmt.Sprintf("sudo journalctl -u docker -n %d", len) } -// ForceSystemd forces the docker daemon to use systemd as cgroup manager -func (r *Docker) forceSystemd() error { - klog.Infof("Forcing docker to use systemd as cgroup manager...") - daemonConfig := `{ -"exec-opts": ["native.cgroupdriver=systemd"], +// setCGroup configures the docker daemon to use driver as cgroup manager +// ref: https://docs.docker.com/engine/reference/commandline/dockerd/#options-for-the-runtime +func (r *Docker) setCGroup(driver string) error { + if driver == constants.UnknownCgroupDriver { + return fmt.Errorf("unable to configure docker to use unknown cgroup driver") + } + + klog.Infof("configuring docker to use %q as cgroup driver...", driver) + daemonConfig := fmt.Sprintf(`{ +"exec-opts": ["native.cgroupdriver=%s"], "log-driver": "json-file", "log-opts": { "max-size": "100m" }, "storage-driver": "overlay2" } -` +`, driver) ma := assets.NewMemoryAsset([]byte(daemonConfig), "/etc/docker", "daemon.json", "0644") return r.Runner.Copy(ma) } @@ -680,25 +685,18 @@ const ( ) func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin string) error { + // $ cri-dockerd --version + // cri-dockerd 0.2.6 (d8accf7) + // $ cri-dockerd --help | grep -i cni + // --cni-bin-dir string A comma-separated list of full paths of directories in which to search for CNI plugin binaries. (default "/opt/cni/bin") + // --cni-cache-dir string The full path of the directory in which CNI should store cache files. (default "/var/lib/cni/cache") + // --cni-conf-dir string The full path of the directory in which to search for CNI config files (default "/etc/cni/net.d") + // --network-plugin string The name of the network plugin to be invoked for various events in kubelet/pod lifecycle. (default "cni") + args := " --hairpin-mode=hairpin-veth" + // if network plugin is not selected - use default "cni" if networkPlugin == "" { - // no-op plugin - return nil + networkPlugin = "cni" } - - if err := cni.NameLoopback(r.Runner); err != nil { - klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) - } - - args := "" - // The CNI configuration is handled by CRI in 1.24+ - // ref: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#installation - if networkPlugin == "cni" && r.KubernetesVersion.GTE(semver.MustParse("1.24.0-alpha.2")) { - args += " --cni-bin-dir=" + CNIBinDir - args += " --cni-cache-dir=" + CNICacheDir - args += " --cni-conf-dir=" + cni.DefaultConfDir - } - args += " --hairpin-mode=hairpin-veth" - opts := struct { NetworkPlugin string ExtraArguments string @@ -707,15 +705,6 @@ func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin stri ExtraArguments: args, } - // TODO (@prezha): remove once cri-dockerd is updated in future minikube release: - // deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.* - // deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.* - // note: https://github.com/Mirantis/cri-dockerd/blob/master/Makefile changed => also needs updating .mk files?! - klog.Infof("replacing original cri-dockerd with v0.2.6-%s", runtime.GOARCH) - if err := downloadCRIDockerdBinary(cr, "0.2.6", runtime.GOARCH); err != nil { - klog.Warningf("unable to replace original cri-dockerd with v0.2.6-%s: %v", runtime.GOARCH, err) - } - const CRIDockerServiceConfFile = "/etc/systemd/system/cri-docker.service.d/10-cni.conf" var CRIDockerServiceConfTemplate = template.Must(template.New("criDockerServiceConfTemplate").Parse(`[Service] ExecStart= @@ -736,21 +725,3 @@ ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plug } return r.Init.Restart("cri-docker") } - -// download cri-dockerd version -func downloadCRIDockerdBinary(cr CommandRunner, version, arch string) error { - curl := fmt.Sprintf("curl -sSfL https://github.com/Mirantis/cri-dockerd/releases/download/v%s/cri-dockerd-%s.%s.tgz | tar -xz -C /tmp", version, version, arch) - if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { - return fmt.Errorf("unable to download new cri-dockerd: %v", err) - } - if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/usr/bin/cri-dockerd", "/usr/bin/cri-dockerd-org")); err != nil { - return fmt.Errorf("unable to backup org cri-dockerd: %v", err) - } - if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/tmp/cri-dockerd/cri-dockerd", "/usr/bin/cri-dockerd")); err != nil { - if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/usr/bin/cri-dockerd", "/usr/bin/cri-dockerd-org")); err != nil { - return fmt.Errorf("unable to install new cri-dockerd and restore org cri-dockerd - it's broken!: %v", err) - } - return fmt.Errorf("unable to install new cri-dockerd: %v", err) - } - return nil -} diff --git a/pkg/minikube/detect/detect.go b/pkg/minikube/detect/detect.go index 74b5dc5bd7..622b2caab7 100644 --- a/pkg/minikube/detect/detect.go +++ b/pkg/minikube/detect/detect.go @@ -28,7 +28,9 @@ import ( "github.com/klauspost/cpuid" "github.com/spf13/viper" "golang.org/x/sys/cpu" + "golang.org/x/sys/unix" "k8s.io/klog/v2" + "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/localpath" ) @@ -147,3 +149,50 @@ func SocketVMNetInstalled() bool { } return false } + +// CgroupDriver returns detected cgroup driver as configured on host os. +// If unable to detect, it will return constants.DefaultCgroupDriver instead. +func CgroupDriver() string { + switch cgroupVersion() { + case "v1": + klog.Infof("detected %q cgroup driver on host os", constants.CgroupfsCgroupDriver) + return constants.CgroupfsCgroupDriver + case "v2": + klog.Infof("detected %q cgroup driver on host os", constants.SystemdCgroupDriver) + return constants.SystemdCgroupDriver + default: + klog.Warningf("unable to detect host's os cgroup driver - will continue and try with %q as per default, but things might break", constants.DefaultCgroupDriver) + return constants.DefaultCgroupDriver // try with default rather than just give up + } +} + +// cgroupVersion returns cgroup version as set on the linux OS host machine (where minikube runs). +// Possible options are: "v1", "v2" or "" (unknown). +// ref: https://kubernetes.io/docs/concepts/architecture/cgroups/#check-cgroup-version +// ref: https://man7.org/linux/man-pages/man7/cgroups.7.html +func cgroupVersion() string { + if runtime.GOOS != "linux" { + return "" + } + + // check '/sys/fs/cgroup' or '/sys/fs/cgroup/unified' type + var stat unix.Statfs_t + if err := unix.Statfs("/sys/fs/cgroup", &stat); err != nil { + return "" + } + // fallback, but could be misleading + if stat.Type != unix.TMPFS_MAGIC && stat.Type != unix.CGROUP_SUPER_MAGIC && stat.Type != unix.CGROUP2_SUPER_MAGIC { + if err := unix.Statfs("/sys/fs/cgroup/unified", &stat); err != nil { + return "" + } + } + + switch stat.Type { + case unix.TMPFS_MAGIC, unix.CGROUP_SUPER_MAGIC: // tmpfs, cgroupfs + return "v1" + case unix.CGROUP2_SUPER_MAGIC: // cgroup2fs + return "v2" + default: + return "" + } +} diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index cb30a2ce6d..ae93b5cc5c 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -50,6 +50,7 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/cruntime" + "k8s.io/minikube/pkg/minikube/detect" "k8s.io/minikube/pkg/minikube/driver" "k8s.io/minikube/pkg/minikube/exit" "k8s.io/minikube/pkg/minikube/kubeconfig" @@ -439,8 +440,14 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k } } - // if cni is used, ensure all default CNI(s) are disabled on every node start - if err := cni.DisableAllBridgeCNIs(runner, cc); err != nil { + // ensure loopback is properly configured + if err := cni.ConfigureLoopback(runner); err != nil { + klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) + } + + // ensure all default CNI(s) are properly configured on each and every node (re)start + // make sure container runtime is restarted afterwards for these changes to take effect + if err := cni.ConfigureDefaultBridgeCNIs(runner, cc.KubernetesConfig.NetworkPlugin); err != nil { klog.Errorf("unable to disable preinstalled bridge CNI(s): %v", err) } @@ -451,7 +458,24 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k } inUserNamespace := strings.Contains(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true") - err = cr.Enable(disableOthers, forceSystemd(kv), inUserNamespace) + // for docker container runtime: ensure containerd is properly configured by calling Enable(), as docker could be bound to containerd + // it will also "soft" start containerd, but it will not disable others; docker will disable containerd if not used in the next step + if co.Type == "docker" { + containerd, err := cruntime.New(cruntime.Config{ + Type: "containerd", + Socket: "", // use default + Runner: co.Runner, + ImageRepository: co.ImageRepository, + KubernetesVersion: co.KubernetesVersion, + InsecureRegistry: co.InsecureRegistry}) + if err == nil { + err = containerd.Enable(false, cgroupDriver(cc), inUserNamespace) // do not disableOthers, as it's not primary cr + } + if err != nil { + klog.Warningf("cannot ensure containerd is configured properly and reloaded for docker - cluster might be unstable: %v", err) + } + } + err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace) if err != nil { exit.Error(reason.RuntimeEnable, "Failed to enable container runtime", err) } @@ -471,20 +495,40 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k return cr } -func forceSystemd(kv semver.Version) bool { - // starting from k8s v1.22: "kubeadm clusters should be using the systemd driver" - // ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.22.md#no-really-you-must-read-this-before-you-upgrade - // ref: https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-drivers - // ref: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/configure-cgroup-driver/ - // still, respect user preference, if present - if viper.IsSet("force-systemd") { - return viper.GetBool("force-systemd") +// cgroupDriver returns cgroup driver that should be used to further configure container runtime, node(s) and cluster. +// It is based on: +// - (forced) user preference (set via flags or env), if present, or +// - existing k8s cluster config, if present, or +// - host os config detection, if possible, or +// - constants.DefaultCgroupDriver, otherwise. +// Possible mappings are: "v1" (legacy) cgroups => "cgroupfs", "v2" (unified) cgroups => "systemd" and "" (unknown) cgroups => constants.DefaultCgroupDriver. +// Note: starting from k8s v1.22, "kubeadm clusters should be using the systemd driver": +// ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.22.md#no-really-you-must-read-this-before-you-upgrade +// ref: https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-drivers +// ref: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/configure-cgroup-driver/ +func cgroupDriver(cc config.ClusterConfig) string { + klog.Info("detecting cgroup driver to use...") + + // check flags for user preference + if viper.GetBool("force-systemd") { + klog.Infof("using %q cgroup driver as enforced via flags", constants.SystemdCgroupDriver) + return constants.SystemdCgroupDriver } + + // check env for user preference env := os.Getenv(constants.MinikubeForceSystemdEnv) - if force, err := strconv.ParseBool(env); env != "" && err == nil { - return force + if force, err := strconv.ParseBool(env); env != "" && err == nil && force { + klog.Infof("using %q cgroup driver as enforced via env", constants.SystemdCgroupDriver) + return constants.SystemdCgroupDriver } - return kv.GTE(semver.Version{Major: 1, Minor: 22}) + + // check current cluster config + if cc.KubernetesConfig.CgroupDriver != "" { + klog.Infof("using %q cgroup driver from existing cluster config", cc.KubernetesConfig.CgroupDriver) + return cc.KubernetesConfig.CgroupDriver + } + + return detect.CgroupDriver() } func pathExists(runner cruntime.CommandRunner, path string) (bool, error) { diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 3cc1b55a2b..7183f5b56b 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -57,14 +57,13 @@ func TestNetworkPlugins(t *testing.T) { namespace string hairpin bool }{ - // for containerd and crio runtimes kindnet CNI is used by default and hairpin is enabled - {"auto", []string{}, "", "", "", ContainerRuntime() != "docker"}, + {"auto", []string{}, "", "", "", true}, {"kubenet", []string{"--network-plugin=kubenet"}, "kubenet", "", "", true}, {"bridge", []string{"--cni=bridge"}, "cni", "", "", true}, {"enable-default-cni", []string{"--enable-default-cni=true"}, "cni", "", "", true}, {"flannel", []string{"--cni=flannel"}, "cni", "app=flannel", "kube-flannel", true}, {"kindnet", []string{"--cni=kindnet"}, "cni", "app=kindnet", "kube-system", true}, - {"false", []string{"--cni=false"}, "", "", "", false}, + {"false", []string{"--cni=false"}, "", "", "", true}, {"custom-flannel", []string{fmt.Sprintf("--cni=%s", filepath.Join(*testdataDir, "kube-flannel.yaml"))}, "cni", "", "kube-flannel", true}, {"calico", []string{"--cni=calico"}, "cni", "k8s-app=calico-node", "kube-system", true}, {"cilium", []string{"--cni=cilium"}, "cni", "k8s-app=cilium", "kube-system", true}, @@ -93,10 +92,19 @@ func TestNetworkPlugins(t *testing.T) { t.Skipf("Skipping the test as %s container runtimes requires CNI", ContainerRuntime()) } + // (current) cilium is known to mess up the system when interfering with other network tests, so we disable it for now - probably needs updating? + // hint: most probably the problem is in combination of: containerd + (outdated) cgroup_v1(cgroupfs) + (outdated) cilium, on systemd it should work + // unfortunately, cilium changed how cni is deployed and does not provide manifests anymore (since v1.9) so that we can "just update" ours + // ref: https://docs.cilium.io/en/stable/gettingstarted/k8s-install-default/ + // ref: https://docs.cilium.io/en/stable/gettingstarted/k8s-install-kubeadm/ + if tc.name == "cilium" { + t.Skip("Skipping the test as it's interfering with other tests and is outdated") + } + start := time.Now() MaybeParallel(t) - startArgs := append([]string{"start", "-p", profile, "--memory=3072", "--alsologtostderr", "--wait=true", "--wait-timeout=20m"}, tc.args...) + startArgs := append([]string{"start", "-p", profile, "--memory=3072", "--alsologtostderr", "--wait=true", "--wait-timeout=15m"}, tc.args...) startArgs = append(startArgs, StartArgs()...) t.Run("Start", func(t *testing.T) { @@ -157,10 +165,6 @@ func TestNetworkPlugins(t *testing.T) { }) } - if strings.Contains(tc.name, "weave") { - t.Skipf("skipping remaining tests for weave, as results can be unpredictable") - } - if !t.Failed() { t.Run("DNS", func(t *testing.T) { var rr *RunResult From 2a00282410ba700de1fe485e9eed40bec3e3b518 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 26 Dec 2022 07:28:33 +0000 Subject: [PATCH 23/44] work around non-linux builds for cgroups detection --- pkg/minikube/detect/detect.go | 32 -------------- pkg/minikube/detect/detect_linux.go | 56 +++++++++++++++++++++++++ pkg/minikube/detect/detect_non_linux.go | 24 +++++++++++ 3 files changed, 80 insertions(+), 32 deletions(-) create mode 100644 pkg/minikube/detect/detect_linux.go create mode 100644 pkg/minikube/detect/detect_non_linux.go diff --git a/pkg/minikube/detect/detect.go b/pkg/minikube/detect/detect.go index 622b2caab7..d301b9e491 100644 --- a/pkg/minikube/detect/detect.go +++ b/pkg/minikube/detect/detect.go @@ -28,7 +28,6 @@ import ( "github.com/klauspost/cpuid" "github.com/spf13/viper" "golang.org/x/sys/cpu" - "golang.org/x/sys/unix" "k8s.io/klog/v2" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/localpath" @@ -165,34 +164,3 @@ func CgroupDriver() string { return constants.DefaultCgroupDriver // try with default rather than just give up } } - -// cgroupVersion returns cgroup version as set on the linux OS host machine (where minikube runs). -// Possible options are: "v1", "v2" or "" (unknown). -// ref: https://kubernetes.io/docs/concepts/architecture/cgroups/#check-cgroup-version -// ref: https://man7.org/linux/man-pages/man7/cgroups.7.html -func cgroupVersion() string { - if runtime.GOOS != "linux" { - return "" - } - - // check '/sys/fs/cgroup' or '/sys/fs/cgroup/unified' type - var stat unix.Statfs_t - if err := unix.Statfs("/sys/fs/cgroup", &stat); err != nil { - return "" - } - // fallback, but could be misleading - if stat.Type != unix.TMPFS_MAGIC && stat.Type != unix.CGROUP_SUPER_MAGIC && stat.Type != unix.CGROUP2_SUPER_MAGIC { - if err := unix.Statfs("/sys/fs/cgroup/unified", &stat); err != nil { - return "" - } - } - - switch stat.Type { - case unix.TMPFS_MAGIC, unix.CGROUP_SUPER_MAGIC: // tmpfs, cgroupfs - return "v1" - case unix.CGROUP2_SUPER_MAGIC: // cgroup2fs - return "v2" - default: - return "" - } -} diff --git a/pkg/minikube/detect/detect_linux.go b/pkg/minikube/detect/detect_linux.go new file mode 100644 index 0000000000..4774ee688c --- /dev/null +++ b/pkg/minikube/detect/detect_linux.go @@ -0,0 +1,56 @@ +//go:build linux + +/* +Copyright 2022 The Kubernetes Authors All rights reserved. + +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 detect + +import ( + "runtime" + + "golang.org/x/sys/unix" +) + +// cgroupVersion returns cgroup version as set on the linux OS host machine (where minikube runs). +// Possible options are: "v1", "v2" or "" (unknown). +// ref: https://kubernetes.io/docs/concepts/architecture/cgroups/#check-cgroup-version +// ref: https://man7.org/linux/man-pages/man7/cgroups.7.html +func cgroupVersion() string { + if runtime.GOOS != "linux" { + return "" + } + + // check '/sys/fs/cgroup' or '/sys/fs/cgroup/unified' type + var stat unix.Statfs_t + if err := unix.Statfs("/sys/fs/cgroup", &stat); err != nil { + return "" + } + // fallback, but could be misleading + if stat.Type != unix.TMPFS_MAGIC && stat.Type != unix.CGROUP_SUPER_MAGIC && stat.Type != unix.CGROUP2_SUPER_MAGIC { + if err := unix.Statfs("/sys/fs/cgroup/unified", &stat); err != nil { + return "" + } + } + + switch stat.Type { + case unix.TMPFS_MAGIC, unix.CGROUP_SUPER_MAGIC: // tmpfs, cgroupfs + return "v1" + case unix.CGROUP2_SUPER_MAGIC: // cgroup2fs + return "v2" + default: + return "" + } +} diff --git a/pkg/minikube/detect/detect_non_linux.go b/pkg/minikube/detect/detect_non_linux.go new file mode 100644 index 0000000000..ab2f0eb704 --- /dev/null +++ b/pkg/minikube/detect/detect_non_linux.go @@ -0,0 +1,24 @@ +//go:build !linux + +/* +Copyright 2022 The Kubernetes Authors All rights reserved. + +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 detect + +// cgroupVersion returns cgroups v1 for non-linux OS host machine (where minikube runs). +func cgroupVersion() string { + return "v1" +} From 51464691f79f290c8d3b7de5c85257ab76fc5cc8 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 26 Dec 2022 14:39:51 +0000 Subject: [PATCH 24/44] gotcha --- pkg/minikube/detect/{detect_non_linux.go => detect_nonlinux.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pkg/minikube/detect/{detect_non_linux.go => detect_nonlinux.go} (100%) diff --git a/pkg/minikube/detect/detect_non_linux.go b/pkg/minikube/detect/detect_nonlinux.go similarity index 100% rename from pkg/minikube/detect/detect_non_linux.go rename to pkg/minikube/detect/detect_nonlinux.go From f3b3d4e07c3072f46196abc88a3c7c3174119f79 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 27 Dec 2022 04:27:48 +0000 Subject: [PATCH 25/44] try to fix couple of more things --- pkg/minikube/cni/cni.go | 10 +++---- pkg/minikube/cruntime/containerd.go | 1 + pkg/minikube/cruntime/cri.go | 6 ++++- pkg/minikube/node/start.go | 40 ++++++++++++++-------------- test/integration/addons_test.go | 10 ++++++- test/integration/json_output_test.go | 13 ++++++++- test/integration/preload_test.go | 2 +- 7 files changed, 53 insertions(+), 29 deletions(-) diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index d6222cbe03..0b28b599db 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -197,8 +197,9 @@ func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) err // ConfigureLoopback ensures loopback has expected version ("1.0.0") and valid name ("loopback") in its config file in /etc/cni/net.d // cri-o is leaving name out atm (https://github.com/cri-o/cri-o/pull/6273) // avoid errors like: -// Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "..." network for pod "...": networkPlugin cni failed to set up pod "..." network: missing network name:, -// failed to clean up sandbox container "..." network for pod "...": networkPlugin cni failed to teardown pod "..." network: missing network name] +// - Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "..." network for pod "...": networkPlugin cni failed to set up pod "..." network: missing network name:, +// - failed to clean up sandbox container "..." network for pod "...": networkPlugin cni failed to teardown pod "..." network: missing network name] +// It is caller's responsibility to restart container runtime for these changes to take effect. func ConfigureLoopback(r Runner) error { loopback := "/etc/cni/net.d/*loopback.conf*" // usually: 200-loopback.conf // turn { "cniVersion": "0.3.1", "type": "loopback" } @@ -226,7 +227,6 @@ func ConfigureDefaultBridgeCNIs(r Runner, networkPlugin string) error { if networkPlugin != "" { return disableAllBridgeCNIs(r) } - return configureAllBridgeCNIs(r, DefaultPodCIDR) } @@ -241,7 +241,7 @@ func disableAllBridgeCNIs(r Runner) error { } configs := strings.Trim(out.Stdout.String(), ", ") if len(configs) == 0 { - klog.Infof("no bridge cni configs found in %q - nothing to disable", configs, path) + klog.Infof("no bridge cni configs found in %q - nothing to disable", path) return nil } klog.Infof("disabled [%s] bridge cni config(s)", configs) @@ -289,7 +289,7 @@ func configureAllBridgeCNIs(r Runner, cidr string) error { } if len(strings.Trim(configs, ", ")) == 0 { - klog.Infof("no bridge cni configs found in %q - nothing to configure", configs, path) + klog.Infof("no bridge cni configs found in %q - nothing to configure", path) return nil } klog.Infof("configured [%s] bridge cni config(s)", configs) diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 7778365e24..279863bf9e 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -229,6 +229,7 @@ func (r *Containerd) Enable(disOthers bool, cgroupDriver string, inUserNamespace currentVersion, err := r.Version() if err == nil && semver.MustParse(targetVersion).GT(semver.MustParse(currentVersion)) { klog.Infof("replacing original containerd with v%s-%s-%s", targetVersion, runtime.GOOS, runtime.GOARCH) + r.Init.ForceStop("containerd") if err := updateContainerdBinary(r.Runner, targetVersion, runtime.GOOS, runtime.GOARCH); err != nil { klog.Warningf("unable to replace original containerd with v%s-%s-%s: %v", targetVersion, runtime.GOOS, runtime.GOARCH, err) } diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index f1f3c11ccc..10d668a446 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -232,7 +232,11 @@ func stopCRIContainers(cr CommandRunner, ids []string) error { klog.Infof("Stopping containers: %s", ids) crictl := getCrictlPath(cr) - args := append([]string{crictl, "stop"}, ids...) + // bring crictl stop timeout on pair with docker: + // - docker stop --help => -t, --time int Seconds to wait for stop before killing it (default 10) + // - crictl stop --help => --timeout value, -t value Seconds to wait to kill the container after a graceful stop is requested (default: 0) + // to prevent "stuck" containers blocking ports (eg, "[ERROR Port-2379|2380]: Port 2379|2380 is in use" for etcd during "live" k8s upgrade) + args := append([]string{crictl, "stop", "--timeout", "10"}, ids...) c := exec.Command("sudo", args...) if _, err := cr.RunCmd(c); err != nil { return errors.Wrap(err, "crictl") diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index ae93b5cc5c..2589927c46 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -418,9 +418,21 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k exit.Error(reason.InternalRuntime, "Failed runtime", err) } - disableOthers := true - if driver.BareMetal(cc.Driver) { - disableOthers = false + // ensure loopback is properly configured + // make sure container runtime is restarted afterwards for these changes to take effect + if err := cni.ConfigureLoopback(runner); err != nil { + klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) + } + // ensure all default CNI(s) are properly configured on each and every node (re)start + // make sure container runtime is restarted afterwards for these changes to take effect + if err := cni.ConfigureDefaultBridgeCNIs(runner, cc.KubernetesConfig.NetworkPlugin); err != nil { + klog.Errorf("unable to disable preinstalled bridge CNI(s): %v", err) + } + + if kv.GTE(semver.MustParse("1.24.0-alpha.2")) { + if err := cruntime.ConfigureNetworkPlugin(cr, runner, cc.KubernetesConfig.NetworkPlugin); err != nil { + exit.Error(reason.RuntimeEnable, "Failed to configure network plugin", err) + } } // Preload is overly invasive for bare metal, and caching is not meaningful. @@ -440,23 +452,6 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k } } - // ensure loopback is properly configured - if err := cni.ConfigureLoopback(runner); err != nil { - klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) - } - - // ensure all default CNI(s) are properly configured on each and every node (re)start - // make sure container runtime is restarted afterwards for these changes to take effect - if err := cni.ConfigureDefaultBridgeCNIs(runner, cc.KubernetesConfig.NetworkPlugin); err != nil { - klog.Errorf("unable to disable preinstalled bridge CNI(s): %v", err) - } - - if kv.GTE(semver.MustParse("1.24.0-alpha.2")) { - if err := cruntime.ConfigureNetworkPlugin(cr, runner, cc.KubernetesConfig.NetworkPlugin); err != nil { - exit.Error(reason.RuntimeEnable, "Failed to configure network plugin", err) - } - } - inUserNamespace := strings.Contains(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true") // for docker container runtime: ensure containerd is properly configured by calling Enable(), as docker could be bound to containerd // it will also "soft" start containerd, but it will not disable others; docker will disable containerd if not used in the next step @@ -475,6 +470,11 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k klog.Warningf("cannot ensure containerd is configured properly and reloaded for docker - cluster might be unstable: %v", err) } } + + disableOthers := true + if driver.BareMetal(cc.Driver) { + disableOthers = false + } err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace) if err != nil { exit.Error(reason.RuntimeEnable, "Failed to enable container runtime", err) diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 88e1434a6d..cf99951dc9 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -38,6 +38,7 @@ import ( "github.com/blang/semver/v4" retryablehttp "github.com/hashicorp/go-retryablehttp" "k8s.io/minikube/pkg/kapi" + "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/detect" "k8s.io/minikube/pkg/util/retry" ) @@ -68,7 +69,14 @@ func TestAddons(t *testing.T) { } // MOCK_GOOGLE_TOKEN forces the gcp-auth webhook to use a mock token instead of trying to get a valid one from the credentials. - t.Setenv("MOCK_GOOGLE_TOKEN", "true") + os.Setenv("MOCK_GOOGLE_TOKEN", "true") + + // for some reason, (Docker_Cloud_Shell) sets 'MINIKUBE_FORCE_SYSTEMD=true' while having cgroupfs set in docker (and probably os itself), which might make it unstable and occasionaly fail: + // - I1226 15:05:24.834294 11286 out.go:177] - MINIKUBE_FORCE_SYSTEMD=true + // - I1226 15:05:25.070037 11286 info.go:266] docker info: {... CgroupDriver:cgroupfs ...} + // ref: https://storage.googleapis.com/minikube-builds/logs/15463/27154/Docker_Cloud_Shell.html + // so we override that here to let minikube auto-detect appropriate cgroup driver + os.Setenv(constants.MinikubeForceSystemdEnv, "") args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=volumesnapshots", "--addons=csi-hostpath-driver", "--addons=gcp-auth", "--addons=cloud-spanner"}, StartArgs()...) if !NoneDriver() { // none driver does not support ingress diff --git a/test/integration/json_output_test.go b/test/integration/json_output_test.go index 0f4e53debb..03e7d1691c 100644 --- a/test/integration/json_output_test.go +++ b/test/integration/json_output_test.go @@ -120,7 +120,7 @@ func validateDistinctCurrentSteps(ctx context.Context, t *testing.T, ces []*clou // validateIncreasingCurrentSteps verifies that for a successful minikube start, 'current step' should be increasing func validateIncreasingCurrentSteps(ctx context.Context, t *testing.T, ces []*cloudEvent) { step := -1 - for _, ce := range ces { + for i, ce := range ces { currentStep, exists := ce.data["currentstep"] if !exists || ce.Type() != "io.k8s.sigs.minikube.step" { continue @@ -130,6 +130,17 @@ func validateIncreasingCurrentSteps(ctx context.Context, t *testing.T, ces []*cl t.Fatalf("current step is not an integer: %v\n%v", currentStep, ce) } if cs <= step { + // check if steps are mixed because of goroutines complete in unusual order, but still ok + // eg, "Enabling Addons" (goroutine) might complete before or after "Verifying Kubernetes" finishes + if i > 0 { + prev := ces[i-1].data["name"] + cur := ce.data["name"] + if cur == "Verifying Kubernetes" && prev == "Enabling Addons" { + t.Logf("unusual order of steps, might be ok: %q event came before %q", prev, cur) + step = cs + continue + } + } t.Fatalf("current step is not in increasing order: %v", ces) } step = cs diff --git a/test/integration/preload_test.go b/test/integration/preload_test.go index 956e4666e6..1c7d3c2f1b 100644 --- a/test/integration/preload_test.go +++ b/test/integration/preload_test.go @@ -78,6 +78,6 @@ func TestPreload(t *testing.T) { t.Fatalf("%s failed: %v", rr.Command(), err) } if !strings.Contains(rr.Output(), image) { - t.Fatalf("Expected to find %s in output of `docker images`, instead got %s", image, rr.Output()) + t.Fatalf("Expected to find %s in image list output, instead got %s", image, rr.Output()) } } From fd549f396dbd39385baefe88dcead0ccf99f1bff Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 28 Dec 2022 00:51:45 +0000 Subject: [PATCH 26/44] fix default cni selection for cri-docker(d) --- pkg/minikube/cni/cni.go | 14 ++++++++++++++ pkg/minikube/cruntime/containerd.go | 2 +- pkg/minikube/cruntime/cri.go | 2 +- pkg/minikube/cruntime/cruntime_test.go | 2 +- pkg/minikube/node/start.go | 11 +++++------ test/integration/addons_test.go | 2 +- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index 0b28b599db..e342cf956f 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -27,6 +27,7 @@ import ( "strings" "time" + "github.com/blang/semver/v4" "github.com/pkg/errors" "k8s.io/klog/v2" "k8s.io/minikube/pkg/kapi" @@ -36,6 +37,7 @@ import ( "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/driver" "k8s.io/minikube/pkg/minikube/vmpath" + "k8s.io/minikube/pkg/util" ) const ( @@ -160,6 +162,18 @@ func chooseDefault(cc config.ClusterConfig) Manager { return Bridge{cc: cc} } + // for docker container runtime and k8s v1.24+ where dockershim and kubenet were removed, we fallback to bridge cni for cri-docker(d) + // ref: https://github.com/Mirantis/cri-dockerd#important + // ref: https://github.com/Mirantis/cri-dockerd#to-use-with-kubernetes + // note: currently, default cni that we "distribute" (in /etc/cni/net.d) is based on cri-o bridge, and + // because it does not currently use portmap plugin, we pick "our" bridge instead (cri-o one will be disabled automatically) + // ref: https://github.com/cri-o/cri-o/blob/f317b267ddef21aee5ffc92d890a77112b006815/contrib/cni/10-crio-bridge.conflist + kv, err := util.ParseKubernetesVersion(cc.KubernetesConfig.KubernetesVersion) + if err == nil && kv.GTE(semver.MustParse("1.24.0-alpha.2")) { + klog.Infof("%q driver + %s runtime found, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) + return Bridge{cc: cc} + } + klog.Infof("CNI unnecessary in this configuration, recommending no CNI") return Disabled{cc: cc} } diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 279863bf9e..87abed297b 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -229,7 +229,7 @@ func (r *Containerd) Enable(disOthers bool, cgroupDriver string, inUserNamespace currentVersion, err := r.Version() if err == nil && semver.MustParse(targetVersion).GT(semver.MustParse(currentVersion)) { klog.Infof("replacing original containerd with v%s-%s-%s", targetVersion, runtime.GOOS, runtime.GOARCH) - r.Init.ForceStop("containerd") + _ = r.Init.ForceStop("containerd") if err := updateContainerdBinary(r.Runner, targetVersion, runtime.GOOS, runtime.GOARCH); err != nil { klog.Warningf("unable to replace original containerd with v%s-%s-%s: %v", targetVersion, runtime.GOOS, runtime.GOARCH, err) } diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index 10d668a446..19e34acae7 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -236,7 +236,7 @@ func stopCRIContainers(cr CommandRunner, ids []string) error { // - docker stop --help => -t, --time int Seconds to wait for stop before killing it (default 10) // - crictl stop --help => --timeout value, -t value Seconds to wait to kill the container after a graceful stop is requested (default: 0) // to prevent "stuck" containers blocking ports (eg, "[ERROR Port-2379|2380]: Port 2379|2380 is in use" for etcd during "live" k8s upgrade) - args := append([]string{crictl, "stop", "--timeout", "10"}, ids...) + args := append([]string{crictl, "stop", "--timeout=10"}, ids...) c := exec.Command("sudo", args...) if _, err := cr.RunCmd(c); err != nil { return errors.Wrap(err, "crictl") diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index 2ae447a453..d089379f6d 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -460,7 +460,7 @@ func (f *FakeRunner) crictl(args []string, _ bool) (string, error) { return strings.Join(ids, "\n"), nil } case "stop": - for _, id := range args[1:] { + for _, id := range args[2:] { f.t.Logf("fake crictl: Stopping id %q", id) if f.containers[id] == "" { return "", fmt.Errorf("no such container") diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 2589927c46..bc09c19537 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -423,17 +423,16 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k if err := cni.ConfigureLoopback(runner); err != nil { klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) } - // ensure all default CNI(s) are properly configured on each and every node (re)start - // make sure container runtime is restarted afterwards for these changes to take effect - if err := cni.ConfigureDefaultBridgeCNIs(runner, cc.KubernetesConfig.NetworkPlugin); err != nil { - klog.Errorf("unable to disable preinstalled bridge CNI(s): %v", err) - } - if kv.GTE(semver.MustParse("1.24.0-alpha.2")) { if err := cruntime.ConfigureNetworkPlugin(cr, runner, cc.KubernetesConfig.NetworkPlugin); err != nil { exit.Error(reason.RuntimeEnable, "Failed to configure network plugin", err) } } + // ensure all default CNI(s) are properly configured on each and every node (re)start + // make sure container runtime is restarted afterwards for these changes to take effect + if err := cni.ConfigureDefaultBridgeCNIs(runner, cc.KubernetesConfig.NetworkPlugin); err != nil { + klog.Errorf("unable to disable preinstalled bridge CNI(s): %v", err) + } // Preload is overly invasive for bare metal, and caching is not meaningful. // KIC handles preload elsewhere. diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index cf99951dc9..0ea15aab9f 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -71,7 +71,7 @@ func TestAddons(t *testing.T) { // MOCK_GOOGLE_TOKEN forces the gcp-auth webhook to use a mock token instead of trying to get a valid one from the credentials. os.Setenv("MOCK_GOOGLE_TOKEN", "true") - // for some reason, (Docker_Cloud_Shell) sets 'MINIKUBE_FORCE_SYSTEMD=true' while having cgroupfs set in docker (and probably os itself), which might make it unstable and occasionaly fail: + // for some reason, (Docker_Cloud_Shell) sets 'MINIKUBE_FORCE_SYSTEMD=true' while having cgroupfs set in docker (and probably os itself), which might make it unstable and occasionally fail: // - I1226 15:05:24.834294 11286 out.go:177] - MINIKUBE_FORCE_SYSTEMD=true // - I1226 15:05:25.070037 11286 info.go:266] docker info: {... CgroupDriver:cgroupfs ...} // ref: https://storage.googleapis.com/minikube-builds/logs/15463/27154/Docker_Cloud_Shell.html From 1274f311795a3049e2bf1b42863463cd0e61762b Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 28 Dec 2022 19:47:34 +0000 Subject: [PATCH 27/44] fix TestBinaryUpgrade on Docker_Linux_containerd and skip GCPAuth on GCE --- pkg/minikube/cni/cni.go | 2 +- pkg/minikube/cruntime/containerd.go | 2 +- pkg/minikube/cruntime/cri.go | 4 ++-- pkg/minikube/cruntime/crio.go | 2 +- pkg/minikube/cruntime/cruntime_test.go | 2 +- test/integration/addons_test.go | 1 + test/integration/version_upgrade_test.go | 16 +++++++++++++++- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index e342cf956f..50ca39b880 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -170,7 +170,7 @@ func chooseDefault(cc config.ClusterConfig) Manager { // ref: https://github.com/cri-o/cri-o/blob/f317b267ddef21aee5ffc92d890a77112b006815/contrib/cni/10-crio-bridge.conflist kv, err := util.ParseKubernetesVersion(cc.KubernetesConfig.KubernetesVersion) if err == nil && kv.GTE(semver.MustParse("1.24.0-alpha.2")) { - klog.Infof("%q driver + %s runtime found, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) + klog.Infof("%q driver + %s runtime found on kunernetes v1.24+, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) return Bridge{cc: cc} } diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 87abed297b..68cb307861 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -533,7 +533,7 @@ func (r *Containerd) Preload(cc config.ClusterConfig) error { if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil { return errors.Wrapf(err, "extracting tarball: %s", rr.Output()) } - klog.Infof("Took %f seconds t extract the tarball", time.Since(t).Seconds()) + klog.Infof("Took %f seconds to extract the tarball", time.Since(t).Seconds()) // remove the tarball in the VM if err := r.Runner.Remove(fa); err != nil { diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index 19e34acae7..8d0c355f60 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -190,7 +190,7 @@ func killCRIContainers(cr CommandRunner, ids []string) error { klog.Infof("Killing containers: %s", ids) crictl := getCrictlPath(cr) - args := append([]string{crictl, "rm"}, ids...) + args := append([]string{crictl, "rm", "--force"}, ids...) c := exec.Command("sudo", args...) if _, err := cr.RunCmd(c); err != nil { return errors.Wrap(err, "crictl") @@ -235,7 +235,7 @@ func stopCRIContainers(cr CommandRunner, ids []string) error { // bring crictl stop timeout on pair with docker: // - docker stop --help => -t, --time int Seconds to wait for stop before killing it (default 10) // - crictl stop --help => --timeout value, -t value Seconds to wait to kill the container after a graceful stop is requested (default: 0) - // to prevent "stuck" containers blocking ports (eg, "[ERROR Port-2379|2380]: Port 2379|2380 is in use" for etcd during "live" k8s upgrade) + // to prevent "stuck" containers blocking ports (eg, "[ERROR Port-2379|2380]: Port 2379|2380 is in use" for etcd during "hot" k8s upgrade) args := append([]string{crictl, "stop", "--timeout=10"}, ids...) c := exec.Command("sudo", args...) if _, err := cr.RunCmd(c); err != nil { diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index b3d40cc920..53a653300a 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -449,7 +449,7 @@ func (r *CRIO) Preload(cc config.ClusterConfig) error { if rr, err := r.Runner.RunCmd(exec.Command("sudo", "tar", "-I", "lz4", "-C", "/var", "-xf", dest)); err != nil { return errors.Wrapf(err, "extracting tarball: %s", rr.Output()) } - klog.Infof("Took %f seconds t extract the tarball", time.Since(t).Seconds()) + klog.Infof("Took %f seconds to extract the tarball", time.Since(t).Seconds()) // remove the tarball in the VM if err := r.Runner.Remove(fa); err != nil { diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index d089379f6d..b289457230 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -468,7 +468,7 @@ func (f *FakeRunner) crictl(args []string, _ bool) (string, error) { delete(f.containers, id) } case "rm": - for _, id := range args[1:] { + for _, id := range args[2:] { f.t.Logf("fake crictl: Removing id %q", id) if f.containers[id] == "" { return "", fmt.Errorf("no such container") diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 0ea15aab9f..0ff7971c2b 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -742,6 +742,7 @@ func validateGCPAuthAddon(ctx context.Context, t *testing.T, profile string) { // If we're on GCE, we have proper credentials and can test the registry secrets with an artifact registry image if detect.IsOnGCE() && !detect.IsCloudShell() { + t.Skip("skipping GCPAuth addon test until 'Permission \"artifactregistry.repositories.downloadArtifacts\" denied on resource \"projects/k8s-minikube/locations/us/repositories/test-artifacts\" (or it may not exist)' issue is resolved") os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") os.Unsetenv("GOOGLE_CLOUD_PROJECT") args := []string{"-p", profile, "addons", "enable", "gcp-auth"} diff --git a/test/integration/version_upgrade_test.go b/test/integration/version_upgrade_test.go index 8187f58411..5783b7c6f1 100644 --- a/test/integration/version_upgrade_test.go +++ b/test/integration/version_upgrade_test.go @@ -28,6 +28,7 @@ import ( "time" "k8s.io/minikube/pkg/minikube/constants" + "k8s.io/minikube/pkg/minikube/detect" "k8s.io/minikube/pkg/util/retry" "github.com/docker/machine/libmachine/state" @@ -71,8 +72,11 @@ func legacyVersion() string { } // the version containerd in ISO was upgraded to 1.4.2 // we need it to use runc.v2 plugin + // also, to avoid "getting the runtime version failed: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService" error + // we need minikube v1.21+ + // ref: https://containerd.io/releases/#kubernetes-support if ContainerRuntime() == "containerd" { - version = "v1.16.0" + version = "v1.22.0" } return version } @@ -89,6 +93,11 @@ func TestRunningBinaryUpgrade(t *testing.T) { t.Skipf("Skipping, test does not make sense with --base-image") } + if detect.CgroupDriver() == constants.SystemdCgroupDriver { + // will block containerd on systemd user machine with "failed to create containerd task: cgroups: cgroup mountpoint does not exist: unknown" error + t.Skipf("skipping, test is not stable on system with systemd cgroups driver and legacy minikube version") + } + MaybeParallel(t) profile := UniqueProfileName("running-upgrade") ctx, cancel := context.WithTimeout(context.Background(), Minutes(55)) @@ -147,6 +156,11 @@ func TestStoppedBinaryUpgrade(t *testing.T) { t.Skipf("Skipping, test does not make sense with --base-image") } + if detect.CgroupDriver() == constants.SystemdCgroupDriver { + // will block containerd on systemd user machine with "failed to create containerd task: cgroups: cgroup mountpoint does not exist: unknown" error + t.Skipf("skipping, test is not stable on system with systemd cgroups driver and legacy minikube version") + } + MaybeParallel(t) profile := UniqueProfileName("stopped-upgrade") ctx, cancel := context.WithTimeout(context.Background(), Minutes(55)) From 818a7d9b337f28503739774fc5b42162b43640f2 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 4 Jan 2023 21:02:48 +0000 Subject: [PATCH 28/44] fix remaining tests and ready for k8s-1.26.0 --- .../config.toml.default | 9 +---- .../containerd-bin-aarch64/containerd-bin.mk | 2 +- .../containerd-bin/config.toml.default | 9 +---- pkg/minikube/bootstrapper/kubeadm/kubeadm.go | 2 +- pkg/minikube/cni/cni.go | 2 +- pkg/minikube/cruntime/containerd.go | 14 +++++--- pkg/minikube/cruntime/cruntime.go | 6 ++++ pkg/minikube/cruntime/cruntime_test.go | 2 +- pkg/minikube/cruntime/docker.go | 35 +++++++++++++------ pkg/minikube/node/start.go | 12 +++++++ site/content/en/docs/faq/_index.md | 2 +- test/integration/addons_test.go | 7 +++- .../testdata/netcat-deployment-nomaster.yaml | 3 +- test/integration/version_upgrade_test.go | 17 ++------- 14 files changed, 70 insertions(+), 52 deletions(-) diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default index 54a396a435..067beddbc2 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default @@ -56,7 +56,6 @@ oom_score = 0 selinux_category_range = 1024 sandbox_image = "k8s.gcr.io/pause:3.2" stats_collect_period = 10 - systemd_cgroup = false enable_tls_streaming = false max_container_log_line_size = 16384 disable_cgroup = false @@ -75,7 +74,7 @@ oom_score = 0 disable_snapshot_annotations = true discard_unpacked_layers = false [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "" + runtime_type = "io.containerd.runc.v2" runtime_engine = "" runtime_root = "" privileged_without_host_devices = false @@ -114,12 +113,6 @@ oom_score = 0 content_sharing_policy = "shared" [plugins."io.containerd.monitor.v1.cgroups"] no_prometheus = false - [plugins."io.containerd.runtime.v1.linux"] - shim = "containerd-shim" - runtime = "runc" - runtime_root = "" - no_shim = false - shim_debug = false [plugins."io.containerd.runtime.v2.task"] platforms = ["linux/amd64"] [plugins."io.containerd.service.v1.diff-service"] diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk index 8e3be0a3a3..b7bd04b523 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd-bin.mk @@ -14,7 +14,7 @@ CONTAINERD_BIN_AARCH64_ENV = \ CGO_ENABLED=1 \ GO111MODULE=off \ GOPATH="$(CONTAINERD_BIN_AARCH64_GOPATH)" \ - GOBIN="$(CONTAINERD_BIN_AARCH64_GOPATH)/bin" \ + GOBIN="$(CONTAINERD_BIN_AARCH64_GOPATH)/bin" \ PATH=$(CONTAINERD_BIN_AARCH64_GOPATH)/bin:$(BR_PATH) \ GOARCH=arm64 diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default index 54a396a435..067beddbc2 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default @@ -56,7 +56,6 @@ oom_score = 0 selinux_category_range = 1024 sandbox_image = "k8s.gcr.io/pause:3.2" stats_collect_period = 10 - systemd_cgroup = false enable_tls_streaming = false max_container_log_line_size = 16384 disable_cgroup = false @@ -75,7 +74,7 @@ oom_score = 0 disable_snapshot_annotations = true discard_unpacked_layers = false [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "" + runtime_type = "io.containerd.runc.v2" runtime_engine = "" runtime_root = "" privileged_without_host_devices = false @@ -114,12 +113,6 @@ oom_score = 0 content_sharing_policy = "shared" [plugins."io.containerd.monitor.v1.cgroups"] no_prometheus = false - [plugins."io.containerd.runtime.v1.linux"] - shim = "containerd-shim" - runtime = "runc" - runtime_root = "" - no_shim = false - shim_debug = false [plugins."io.containerd.runtime.v2.task"] platforms = ["linux/amd64"] [plugins."io.containerd.service.v1.diff-service"] diff --git a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go index 095c72cfe8..c6a51a186f 100644 --- a/pkg/minikube/bootstrapper/kubeadm/kubeadm.go +++ b/pkg/minikube/bootstrapper/kubeadm/kubeadm.go @@ -1113,7 +1113,7 @@ func (k *Bootstrapper) elevateKubeSystemPrivileges(cfg config.ClusterConfig) err // stopKubeSystem stops all the containers in the kube-system to prevent #8740 when doing hot upgrade func (k *Bootstrapper) stopKubeSystem(cfg config.ClusterConfig) error { klog.Info("stopping kube-system containers ...") - cr, err := cruntime.New(cruntime.Config{Type: cfg.KubernetesConfig.ContainerRuntime, Runner: k.c}) + cr, err := cruntime.New(cruntime.Config{Type: cfg.KubernetesConfig.ContainerRuntime, Socket: cfg.KubernetesConfig.CRISocket, Runner: k.c}) if err != nil { return errors.Wrap(err, "new cruntime") } diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index 50ca39b880..25fcf9f9e0 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -170,7 +170,7 @@ func chooseDefault(cc config.ClusterConfig) Manager { // ref: https://github.com/cri-o/cri-o/blob/f317b267ddef21aee5ffc92d890a77112b006815/contrib/cni/10-crio-bridge.conflist kv, err := util.ParseKubernetesVersion(cc.KubernetesConfig.KubernetesVersion) if err == nil && kv.GTE(semver.MustParse("1.24.0-alpha.2")) { - klog.Infof("%q driver + %s runtime found on kunernetes v1.24+, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) + klog.Infof("%q driver + %q container runtime found on kunernetes v1.24+, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) return Bridge{cc: cc} } diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 68cb307861..a2d983515b 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -145,16 +145,22 @@ func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semve return errors.Wrap(err, "configuring SystemdCgroup") } } - // handle deprecated features + // handle deprecated/removed features // ref: https://github.com/containerd/containerd/blob/main/RELEASES.md#deprecated-features - if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|"io.containerd.runtime.v1.linux"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|"io.containerd.runtime.v1.linux"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "configuring io.containerd.runtime version") } - if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|"io.containerd.runc.v1"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { + // avoid containerd v1.6.14 "failed to load plugin io.containerd.grpc.v1.cri" error="invalid plugin config: `systemd_cgroup` only works for runtime io.containerd.runtime.v1.linux" error + // that then leads to crictl "getting the runtime version: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService" error + // ref: https://github.com/containerd/containerd/issues/4203 + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i '/systemd_cgroup/d' %s`, containerdConfigFile))); err != nil { + return errors.Wrap(err, "removing deprecated systemd_cgroup param") + } + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|"io.containerd.runc.v1"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "configuring io.containerd.runc version") } // ensure conf_dir is using '/etc/cni/net.d' - // TODO (@prezha): this should be removed (ie, not needed) once we remove "hardcoded" '/etc/cni/net.mk' folder in minikube distro + // we might still want to try removing '/etc/cni/net.mk' in case of upgrade from previous minikube version that had/used it if _, err := cr.RunCmd(exec.Command("sh", "-c", `sudo rm -rf /etc/cni/net.mk`)); err != nil { return fmt.Errorf("unable to remove /etc/cni/net.mk directory: %v", err) } diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index 20a6069b9c..bf3f692bf6 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -358,6 +358,9 @@ func updateCRIDockerdBinary(cr CommandRunner, version, arch string) error { if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { return fmt.Errorf("unable to download cri-dockerd version %s: %v", version, err) } + if _, err := cr.RunCmd(exec.Command("sudo", "chmod", "a+x", "/tmp/cri-dockerd/cri-dockerd")); err != nil { + return fmt.Errorf("unable to chmod cri-dockerd version %s: %v", version, err) + } if _, err := cr.RunCmd(exec.Command("sudo", "mv", "/tmp/cri-dockerd/cri-dockerd", "/usr/bin/cri-dockerd")); err != nil { return fmt.Errorf("unable to install cri-dockerd version %s: %v", version, err) } @@ -370,6 +373,9 @@ func updateContainerdBinary(cr CommandRunner, version, os, arch string) error { if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { return fmt.Errorf("unable to download containerd version %s: %v", version, err) } + if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", "chmod a+x /tmp/bin/*")); err != nil { // note: has to run in subshell because of wildcard! + return fmt.Errorf("unable to chmod containerd version %s: %v", version, err) + } if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", "mv /tmp/bin/* /usr/bin/")); err != nil { // note: has to run in subshell because of wildcard! return fmt.Errorf("unable to install containerd version %s: %v", version, err) } diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index b289457230..1348060390 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -629,7 +629,7 @@ func TestDisable(t *testing.T) { runtime string want []string }{ - {"docker", []string{"sudo", "systemctl", "stop", "-f", "docker.socket", "sudo", "systemctl", "stop", "-f", "docker.service", + {"docker", []string{"sudo", "systemctl", "stop", "-f", "cri-docker.socket", "sudo", "systemctl", "stop", "-f", "cri-docker.service", "sudo", "systemctl", "disable", "cri-docker.socket", "sudo", "systemctl", "mask", "cri-docker.service", "sudo", "systemctl", "stop", "-f", "docker.socket", "sudo", "systemctl", "stop", "-f", "docker.service", "sudo", "systemctl", "disable", "docker.socket", "sudo", "systemctl", "mask", "docker.service"}}, {"crio", []string{"sudo", "systemctl", "stop", "-f", "crio"}}, {"containerd", []string{"sudo", "systemctl", "stop", "-f", "containerd"}}, diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index f9ac91aaed..9ae3ea18f4 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -163,12 +163,18 @@ func (r *Docker) Enable(disOthers bool, cgroupDriver string, inUserNamespace boo // deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.* // deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.* // note: https://github.com/Mirantis/cri-dockerd/blob/master/Makefile changed => also needs updating .mk files?! - targetVersion := "0.2.6" + targetVersion := "0.3.0" klog.Infof("replacing original cri-dockerd with v%s-%s", targetVersion, runtime.GOARCH) if err := updateCRIDockerdBinary(r.Runner, targetVersion, runtime.GOARCH); err != nil { klog.Warningf("unable to replace original cri-dockerd with v%s-%s: %v", targetVersion, runtime.GOARCH, err) } + if err := r.Init.Enable("cri-docker.socket"); err != nil { + return err + } + if err := r.Init.Unmask(r.CRIService); err != nil { + return err + } if err := r.Init.Enable(r.CRIService); err != nil { return err } @@ -187,25 +193,34 @@ func (r *Docker) Restart() error { // Disable idempotently disables Docker on a host func (r *Docker) Disable() error { - if r.CRIService != "" { - if err := r.Init.Stop(r.CRIService); err != nil { - return err - } - if err := r.Init.Disable(r.CRIService); err != nil { - return err - } + // even if r.CRIService is undefined, it might still be available, so try to disable it and just warn then fallthrough if unsuccessful + klog.Info("disabling cri-docker service (if available) ...") + criSocket := "cri-docker.socket" + criService := "cri-docker.service" + if err := r.Init.ForceStop(criSocket); err != nil { + klog.Warningf("Failed to stop socket %q (might be ok): %v", criSocket, err) } + if err := r.Init.ForceStop(criService); err != nil { + klog.Warningf("Failed to stop service %q (might be ok): %v", criService, err) + } + if err := r.Init.Disable(criSocket); err != nil { + klog.Warningf("Failed to disable socket %q (might be ok): %v", criSocket, err) + } + if err := r.Init.Mask(criService); err != nil { + klog.Warningf("Failed to mask service %q (might be ok): %v", criService, err) + } + klog.Info("disabling docker service ...") // because #10373 if err := r.Init.ForceStop("docker.socket"); err != nil { - klog.ErrorS(err, "Failed to stop", "service", "docker.socket") + klog.ErrorS(err, "Failed to stop", "socket", "docker.socket") } if err := r.Init.ForceStop("docker.service"); err != nil { klog.ErrorS(err, "Failed to stop", "service", "docker.service") return err } if err := r.Init.Disable("docker.socket"); err != nil { - klog.ErrorS(err, "Failed to disable", "service", "docker.socket") + klog.ErrorS(err, "Failed to disable", "socket", "docker.socket") } return r.Init.Mask("docker.service") } diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index bc09c19537..8f33f0f331 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -527,6 +527,18 @@ func cgroupDriver(cc config.ClusterConfig) string { return cc.KubernetesConfig.CgroupDriver } + // vm driver uses iso that boots with cgroupfs cgroup driver by default atm (keep in sync!) + if driver.IsVM(cc.Driver) { + return constants.CgroupfsCgroupDriver + } + + // for "remote baremetal", we assume cgroupfs and user can "force-systemd" with flag to override + // potential improvement: use systemd as default (in line with k8s) and allow user to override it with new flag (eg, "cgroup-driver", that would replace "force-systemd") + if driver.IsSSH(cc.Driver) { + return constants.CgroupfsCgroupDriver + } + + // in all other cases - try to detect and use what's on user's machine return detect.CgroupDriver() } diff --git a/site/content/en/docs/faq/_index.md b/site/content/en/docs/faq/_index.md index 3da7554e09..1f5227b51a 100644 --- a/site/content/en/docs/faq/_index.md +++ b/site/content/en/docs/faq/_index.md @@ -55,7 +55,7 @@ minikube addons enable auto-pause ## Docker Driver: How can I set minikube's cgroup manager? -By default minikube uses the `systemd` cgroup manager for Kubernetes clusters. If you are on a system with a cgroupfs cgroup manager, this could cause conflicts. +minikube will try to auto-detect your system's cgroups driver/manager and configure all other components accordingly so that there are no conflicts. To force the `systemd` cgroup manager, run: ```bash diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 0ff7971c2b..04d18caf8f 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -742,7 +742,12 @@ func validateGCPAuthAddon(ctx context.Context, t *testing.T, profile string) { // If we're on GCE, we have proper credentials and can test the registry secrets with an artifact registry image if detect.IsOnGCE() && !detect.IsCloudShell() { - t.Skip("skipping GCPAuth addon test until 'Permission \"artifactregistry.repositories.downloadArtifacts\" denied on resource \"projects/k8s-minikube/locations/us/repositories/test-artifacts\" (or it may not exist)' issue is resolved") + // "Setting the environment variable MOCK_GOOGLE_TOKEN to true will prevent using the google application credentials to fetch the token used for the image pull secret. Instead the token will be mocked." + // ref: https://github.com/GoogleContainerTools/gcp-auth-webhook#gcp-auth-webhook + os.Unsetenv("MOCK_GOOGLE_TOKEN") + // re-set MOCK_GOOGLE_TOKEN once we're done + defer os.Setenv("MOCK_GOOGLE_TOKEN", "true") + os.Unsetenv("GOOGLE_APPLICATION_CREDENTIALS") os.Unsetenv("GOOGLE_CLOUD_PROJECT") args := []string{"-p", profile, "addons", "enable", "gcp-auth"} diff --git a/test/integration/testdata/netcat-deployment-nomaster.yaml b/test/integration/testdata/netcat-deployment-nomaster.yaml index 6bc8f37f73..607c65af12 100644 --- a/test/integration/testdata/netcat-deployment-nomaster.yaml +++ b/test/integration/testdata/netcat-deployment-nomaster.yaml @@ -17,7 +17,8 @@ spec: containers: # dnsutils is easier to debug DNS issues with than the standard busybox image - name: dnsutils - image: k8s.gcr.io/e2e-test-images/agnhost:2.32 + # https://github.com/kubernetes/kubernetes/blob/master/test/images/agnhost/README.md + image: registry.k8s.io/e2e-test-images/agnhost:2.40 command: ["/bin/sh", "-c", "while true; do echo hello | nc -l -p 8080; done"] affinity: diff --git a/test/integration/version_upgrade_test.go b/test/integration/version_upgrade_test.go index 5783b7c6f1..079e0eb779 100644 --- a/test/integration/version_upgrade_test.go +++ b/test/integration/version_upgrade_test.go @@ -28,7 +28,6 @@ import ( "time" "k8s.io/minikube/pkg/minikube/constants" - "k8s.io/minikube/pkg/minikube/detect" "k8s.io/minikube/pkg/util/retry" "github.com/docker/machine/libmachine/state" @@ -72,9 +71,7 @@ func legacyVersion() string { } // the version containerd in ISO was upgraded to 1.4.2 // we need it to use runc.v2 plugin - // also, to avoid "getting the runtime version failed: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService" error - // we need minikube v1.21+ - // ref: https://containerd.io/releases/#kubernetes-support + // note: Test*BinaryUpgrade require minikube v1.22+ to satisfy newer containerd config structure if ContainerRuntime() == "containerd" { version = "v1.22.0" } @@ -93,11 +90,6 @@ func TestRunningBinaryUpgrade(t *testing.T) { t.Skipf("Skipping, test does not make sense with --base-image") } - if detect.CgroupDriver() == constants.SystemdCgroupDriver { - // will block containerd on systemd user machine with "failed to create containerd task: cgroups: cgroup mountpoint does not exist: unknown" error - t.Skipf("skipping, test is not stable on system with systemd cgroups driver and legacy minikube version") - } - MaybeParallel(t) profile := UniqueProfileName("running-upgrade") ctx, cancel := context.WithTimeout(context.Background(), Minutes(55)) @@ -129,8 +121,8 @@ func TestRunningBinaryUpgrade(t *testing.T) { if err != nil { t.Fatalf("failed to create temp file for legacy kubeconfig %v", err) } - defer os.Remove(legacyKubeConfig.Name()) // clean up + legacyEnv = append(legacyEnv, fmt.Sprintf("KUBECONFIG=%s", legacyKubeConfig.Name())) c.Env = legacyEnv rr, err = Run(t, c) @@ -156,11 +148,6 @@ func TestStoppedBinaryUpgrade(t *testing.T) { t.Skipf("Skipping, test does not make sense with --base-image") } - if detect.CgroupDriver() == constants.SystemdCgroupDriver { - // will block containerd on systemd user machine with "failed to create containerd task: cgroups: cgroup mountpoint does not exist: unknown" error - t.Skipf("skipping, test is not stable on system with systemd cgroups driver and legacy minikube version") - } - MaybeParallel(t) profile := UniqueProfileName("stopped-upgrade") ctx, cancel := context.WithTimeout(context.Background(), Minutes(55)) From f040f001991af192337eac6ea6d01a5fc1d3d5bc Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Thu, 5 Jan 2023 00:52:57 +0000 Subject: [PATCH 29/44] tweak tests --- test/integration/addons_test.go | 3 ++- test/integration/main_test.go | 8 ++++++++ test/integration/preload_test.go | 10 +++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 04d18caf8f..f40a4f93cb 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -741,7 +741,8 @@ func validateGCPAuthAddon(ctx context.Context, t *testing.T, profile string) { } // If we're on GCE, we have proper credentials and can test the registry secrets with an artifact registry image - if detect.IsOnGCE() && !detect.IsCloudShell() { + if detect.IsOnGCE() && !detect.IsCloudShell() && !VMDriver() { + t.Skip("skipping GCPAuth addon test until 'Permission \"artifactregistry.repositories.downloadArtifacts\" denied on resource \"projects/k8s-minikube/locations/us/repositories/test-artifacts\" (or it may not exist)' issue is resolved") // "Setting the environment variable MOCK_GOOGLE_TOKEN to true will prevent using the google application credentials to fetch the token used for the image pull secret. Instead the token will be mocked." // ref: https://github.com/GoogleContainerTools/gcp-auth-webhook#gcp-auth-webhook os.Unsetenv("MOCK_GOOGLE_TOKEN") diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 2fe79de386..7f87cd01ba 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -154,6 +154,14 @@ func KicDriver() bool { return DockerDriver() || PodmanDriver() } +// VMDriver checks if the driver is a VM +func VMDriver() bool { + if KicDriver() || NoneDriver() { + return false + } + return true +} + // ContainerRuntime returns the name of a specific container runtime if it was specified func ContainerRuntime() string { flag := "--container-runtime=" diff --git a/test/integration/preload_test.go b/test/integration/preload_test.go index 1c7d3c2f1b..325d9ba3a5 100644 --- a/test/integration/preload_test.go +++ b/test/integration/preload_test.go @@ -59,11 +59,15 @@ func TestPreload(t *testing.T) { t.Fatalf("%s failed: %v", rr.Command(), err) } - // Restart minikube with v1.24.6, which has a preloaded tarball + // stop the cluster + rr, err = Run(t, exec.CommandContext(ctx, Target(), "stop", "-p", profile)) + if err != nil { + t.Fatalf("%s failed: %v", rr.Command(), err) + } + + // re-start the cluster and check if image is preserved startArgs = []string{"start", "-p", profile, "--memory=2200", "--alsologtostderr", "-v=1", "--wait=true"} startArgs = append(startArgs, StartArgs()...) - k8sVersion = "v1.24.6" - startArgs = append(startArgs, fmt.Sprintf("--kubernetes-version=%s", k8sVersion)) rr, err = Run(t, exec.CommandContext(ctx, Target(), startArgs...)) if err != nil { t.Fatalf("%s failed: %v", rr.Command(), err) From 6c98afcdbd72e4a901e3869740602347bb6725e4 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Mon, 9 Jan 2023 02:23:07 +0000 Subject: [PATCH 30/44] cleanup and containerd systemd cgroup issue workaround --- .../containerd-bin-aarch64/config.toml | 5 +- .../config.toml.default | 9 ++- .../containerd-bin-aarch64/containerd.service | 1 + .../cri-dockerd-aarch64/cri-dockerd.mk | 5 +- .../x86_64/package/containerd-bin/config.toml | 5 +- .../containerd-bin/config.toml.default | 9 ++- .../package/containerd-bin/containerd.service | 1 + .../x86_64/package/cri-dockerd/cri-dockerd.mk | 3 - deploy/kicbase/containerd.toml | 5 +- hack/update/cri_dockerd/update_cri_dockerd.sh | 3 +- pkg/drivers/kic/oci/network_create.go | 2 +- pkg/kapi/kapi.go | 14 +---- pkg/minikube/bootstrapper/bsutil/kubeadm.go | 6 ++ .../bootstrapper/bsutil/kubeadm_test.go | 2 +- .../testdata/v1.19/containerd-api-port.yaml | 2 +- .../v1.19/containerd-pod-network-cidr.yaml | 2 +- .../bsutil/testdata/v1.19/containerd.yaml | 2 +- .../testdata/v1.20/containerd-api-port.yaml | 2 +- .../v1.20/containerd-pod-network-cidr.yaml | 2 +- .../bsutil/testdata/v1.20/containerd.yaml | 2 +- .../testdata/v1.21/containerd-api-port.yaml | 2 +- .../v1.21/containerd-pod-network-cidr.yaml | 2 +- .../bsutil/testdata/v1.21/containerd.yaml | 2 +- .../testdata/v1.22/containerd-api-port.yaml | 2 +- .../v1.22/containerd-pod-network-cidr.yaml | 2 +- .../bsutil/testdata/v1.22/containerd.yaml | 2 +- .../testdata/v1.23/containerd-api-port.yaml | 2 +- .../v1.23/containerd-pod-network-cidr.yaml | 2 +- .../bsutil/testdata/v1.23/containerd.yaml | 2 +- .../testdata/v1.24/containerd-api-port.yaml | 2 +- .../v1.24/containerd-pod-network-cidr.yaml | 2 +- .../bsutil/testdata/v1.24/containerd.yaml | 2 +- .../testdata/v1.25/containerd-api-port.yaml | 2 +- .../v1.25/containerd-pod-network-cidr.yaml | 2 +- .../bsutil/testdata/v1.25/containerd.yaml | 2 +- pkg/minikube/cni/bridge.go | 5 -- pkg/minikube/cni/calico.go | 16 ----- pkg/minikube/cni/cilium.go | 16 ----- pkg/minikube/cni/cni.go | 9 +-- pkg/minikube/cni/custom.go | 5 -- pkg/minikube/cni/disabled.go | 5 -- pkg/minikube/cni/flannel.go | 16 ----- pkg/minikube/cni/kindnet.go | 16 ----- pkg/minikube/config/types.go | 2 - pkg/minikube/cruntime/containerd.go | 48 ++++++++++---- pkg/minikube/detect/detect.go | 1 + pkg/minikube/node/start.go | 62 +++---------------- site/content/en/docs/faq/_index.md | 3 +- test/integration/helpers_test.go | 11 +--- 49 files changed, 109 insertions(+), 218 deletions(-) diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml index 953a3bd101..12b0d42eb7 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml @@ -40,8 +40,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd] discard_unpacked_layers = true snapshotter = "overlayfs" - [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "io.containerd.runc.v2" + default_runtime_name = "runc" [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime] runtime_type = "" runtime_engine = "" @@ -50,7 +49,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - SystemdCgroup = true + SystemdCgroup = false [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default index 067beddbc2..54a396a435 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default @@ -56,6 +56,7 @@ oom_score = 0 selinux_category_range = 1024 sandbox_image = "k8s.gcr.io/pause:3.2" stats_collect_period = 10 + systemd_cgroup = false enable_tls_streaming = false max_container_log_line_size = 16384 disable_cgroup = false @@ -74,7 +75,7 @@ oom_score = 0 disable_snapshot_annotations = true discard_unpacked_layers = false [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "io.containerd.runc.v2" + runtime_type = "" runtime_engine = "" runtime_root = "" privileged_without_host_devices = false @@ -113,6 +114,12 @@ oom_score = 0 content_sharing_policy = "shared" [plugins."io.containerd.monitor.v1.cgroups"] no_prometheus = false + [plugins."io.containerd.runtime.v1.linux"] + shim = "containerd-shim" + runtime = "runc" + runtime_root = "" + no_shim = false + shim_debug = false [plugins."io.containerd.runtime.v2.task"] platforms = ["linux/amd64"] [plugins."io.containerd.service.v1.diff-service"] diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service index 97758f26bb..282f34725b 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service +++ b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/containerd.service @@ -15,6 +15,7 @@ ExecStart=/usr/bin/containerd \ $CONTAINERD_MINIKUBE_OPTIONS \ --root ${PERSISTENT_DIR}/var/lib/containerd TasksMax=8192 +# ref: https://github.com/containerd/containerd/blob/main/docs/ops.md#systemd Delegate=yes KillMode=process LimitNOFILE=1048576 diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk b/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk index 91e4fd1e8c..4f7ee9ef50 100644 --- a/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk +++ b/deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk @@ -4,9 +4,6 @@ # ################################################################################ -# If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change -# This uses the static make target at the top level Makefile, since that builds everything, then picks out the arm64 binary - # As of 2022-06-09 CRI_DOCKERD_AARCH64_VER = 0.2.2 CRI_DOCKERD_AARCH64_REV = 0737013 @@ -27,6 +24,8 @@ CRI_DOCKERD_AARCH64_ENV = \ CRI_DOCKERD_AARCH64_COMPILE_SRC = $(CRI_DOCKERD_AARCH64_GOPATH)/src/github.com/Mirantis/cri-dockerd CRI_DOCKERD_AARCH64_BUILDFLAGS = "-ldflags '-X github.com/Mirantis/cri-dockerd/version.Version=$(CRI_DOCKERD_AARCH64_VER) -X github.com/Mirantis/cri-dockerd/version.GitCommit=$(CRI_DOCKERD_AARCH64_REV)'" +# If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change +# This uses the static make target at the top level Makefile, since that builds everything, then picks out the arm64 binary define CRI_DOCKERD_AARCH64_BUILD_CMDS $(CRI_DOCKERD_AARCH64_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) LDFLAGS=$(CRI_DOCKERD_AARCH64_BUILDFLAGS) GO_VERSION=$(GO_VERSION) -C $(@D) VERSION=$(CRI_DOCKERD_AARCH64_VER) REVISION=$(CRI_DOCKERD_AARCH64_REV) static endef diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml index 953a3bd101..12b0d42eb7 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml @@ -40,8 +40,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd] discard_unpacked_layers = true snapshotter = "overlayfs" - [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "io.containerd.runc.v2" + default_runtime_name = "runc" [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime] runtime_type = "" runtime_engine = "" @@ -50,7 +49,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - SystemdCgroup = true + SystemdCgroup = false [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default index 067beddbc2..54a396a435 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default @@ -56,6 +56,7 @@ oom_score = 0 selinux_category_range = 1024 sandbox_image = "k8s.gcr.io/pause:3.2" stats_collect_period = 10 + systemd_cgroup = false enable_tls_streaming = false max_container_log_line_size = 16384 disable_cgroup = false @@ -74,7 +75,7 @@ oom_score = 0 disable_snapshot_annotations = true discard_unpacked_layers = false [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "io.containerd.runc.v2" + runtime_type = "" runtime_engine = "" runtime_root = "" privileged_without_host_devices = false @@ -113,6 +114,12 @@ oom_score = 0 content_sharing_policy = "shared" [plugins."io.containerd.monitor.v1.cgroups"] no_prometheus = false + [plugins."io.containerd.runtime.v1.linux"] + shim = "containerd-shim" + runtime = "runc" + runtime_root = "" + no_shim = false + shim_debug = false [plugins."io.containerd.runtime.v2.task"] platforms = ["linux/amd64"] [plugins."io.containerd.service.v1.diff-service"] diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service index 97758f26bb..282f34725b 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service +++ b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/containerd.service @@ -15,6 +15,7 @@ ExecStart=/usr/bin/containerd \ $CONTAINERD_MINIKUBE_OPTIONS \ --root ${PERSISTENT_DIR}/var/lib/containerd TasksMax=8192 +# ref: https://github.com/containerd/containerd/blob/main/docs/ops.md#systemd Delegate=yes KillMode=process LimitNOFILE=1048576 diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk b/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk index 280828575d..5502a2b9b8 100644 --- a/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk +++ b/deploy/iso/minikube-iso/arch/x86_64/package/cri-dockerd/cri-dockerd.mk @@ -4,9 +4,6 @@ # ################################################################################ -# If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change -# This uses the static make target at the top level Makefile, since that builds everything, then picks out the amd64 binary - # As of 2022-06-09 CRI_DOCKERD_VER = 0.2.2 CRI_DOCKERD_REV = 0737013 diff --git a/deploy/kicbase/containerd.toml b/deploy/kicbase/containerd.toml index 953a3bd101..12b0d42eb7 100644 --- a/deploy/kicbase/containerd.toml +++ b/deploy/kicbase/containerd.toml @@ -40,8 +40,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd] discard_unpacked_layers = true snapshotter = "overlayfs" - [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "io.containerd.runc.v2" + default_runtime_name = "runc" [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime] runtime_type = "" runtime_engine = "" @@ -50,7 +49,7 @@ oom_score = 0 [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] runtime_type = "io.containerd.runc.v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - SystemdCgroup = true + SystemdCgroup = false [plugins."io.containerd.grpc.v1.cri".cni] bin_dir = "/opt/cni/bin" diff --git a/hack/update/cri_dockerd/update_cri_dockerd.sh b/hack/update/cri_dockerd/update_cri_dockerd.sh index d48ecbf8d1..bf42db6de6 100755 --- a/hack/update/cri_dockerd/update_cri_dockerd.sh +++ b/hack/update/cri_dockerd/update_cri_dockerd.sh @@ -35,8 +35,7 @@ git checkout $version for (( i=0; i < ${#archarray[*]}; i++ )) do arch=${archarray[i]#"linux/"} - # If https://github.com/Mirantis/cri-dockerd/blob/master/packaging/Makefile changes, then this will almost certainly need to change - env GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build -ldflags "-X github.com/Mirantis/cri-dockerd/cmd/version.GitCommit=${version:0:7}" -o cri-dockerd-$arch + env GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build -ldflags "-X github.com/Mirantis/cri-dockerd/version.GitCommit=${version:0:7}" -o cri-dockerd-$arch gsutil cp cri-dockerd-$arch gs://kicbase-artifacts/cri-dockerd/$version/$arch/cri-dockerd done diff --git a/pkg/drivers/kic/oci/network_create.go b/pkg/drivers/kic/oci/network_create.go index dc764ecff7..aa7adfcf69 100644 --- a/pkg/drivers/kic/oci/network_create.go +++ b/pkg/drivers/kic/oci/network_create.go @@ -137,7 +137,7 @@ func tryCreateDockerNetwork(ociBin string, subnet *network.Parameters, mtu int, rr, err := runCmd(exec.Command(ociBin, args...)) if err != nil { - klog.Errorf("failed to create %s network %s %s with gateway %s and MTU of %d: %v", ociBin, name, subnet.CIDR, subnet.Gateway, mtu, err) + klog.Errorf("failed to create %s network %s %s with gateway %s and mtu of %d: %v", ociBin, name, subnet.CIDR, subnet.Gateway, mtu, err) // Pool overlaps with other one on this address space if strings.Contains(rr.Output(), "Pool overlaps") { return nil, ErrNetworkSubnetTaken diff --git a/pkg/kapi/kapi.go b/pkg/kapi/kapi.go index d3391f7051..3de7f0dd25 100644 --- a/pkg/kapi/kapi.go +++ b/pkg/kapi/kapi.go @@ -69,7 +69,7 @@ func Client(context string) (*kubernetes.Clientset, error) { return kubernetes.NewForConfig(c) } -// WaitForPods waits for all matching pods to become Ready or finish successfully and at least one matching pod exists. +// WaitForPods waits for all matching pods to become Running or finish successfully and at least one matching pod exists. func WaitForPods(c kubernetes.Interface, ns string, selector string, timeOut ...time.Duration) error { start := time.Now() klog.Infof("Waiting for pod with label %q in ns %q ...", selector, ns) @@ -93,19 +93,9 @@ func WaitForPods(c kubernetes.Interface, ns string, selector string, timeOut ... for _, pod := range pods.Items { if pod.Status.Phase != core.PodRunning && pod.Status.Phase != core.PodSucceeded { - klog.Infof("waiting for pod %q, current phase: %s", selector, pod.Status.Phase) + klog.Infof("waiting for pod %q, current state: %s: [%v]\n", selector, pod.Status.Phase, err) return false, nil } - if pod.Status.Phase == core.PodRunning { - for _, c := range pod.Status.Conditions { - if c.Type == core.PodReady { - if c.Status != core.ConditionTrue { - klog.Infof("waiting for pod %q, current phase/status: %s/%s:%s\n", selector, pod.Status.Phase, core.PodReady, c.Status) - return false, nil - } - } - } - } } return true, nil } diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm.go b/pkg/minikube/bootstrapper/bsutil/kubeadm.go index decd753fac..7c39f1e791 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm.go @@ -68,6 +68,12 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana } return nil, errors.Wrap(err, "getting cgroup driver") } + // TODO: investigate why containerd (v1.6.15) does not work with k8s (v1.25.3) when both are set to use systemd cgroup driver + // for the time being, the workaround is to configure kubelet to use cgroupfs when containerd is using systemd + // note: pkg/minikube/bootstrapper/bsutil/kubeadm_test.go::TestGenerateKubeadmYAML also extects this override (for now) + if r.Name() == constants.Containerd && cgroupDriver == constants.SystemdCgroupDriver { + cgroupDriver = constants.CgroupfsCgroupDriver + } componentOpts, err := createExtraComponentConfig(k8s.ExtraOptions, version, componentFeatureArgs, cp) if err != nil { diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go b/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go index a8201baacf..0efb5317d1 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go @@ -212,7 +212,7 @@ func TestGenerateKubeadmYAML(t *testing.T) { fcr.SetCommandToOutput(map[string]string{ "docker info --format {{.CgroupDriver}}": "systemd\n", "crio config": "cgroup_manager = \"systemd\"\n", - "sudo crictl info": "{\"config\": {\"systemdCgroup\": true}}", + "sudo crictl info": "{\"config\": {\"containerd\": {\"runtimes\": {\"runc\": {\"options\": {\"SystemdCgroup\": true}}}}}}", }) tests := []struct { name string diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml index 3e83c315dc..fb571e6a3f 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-api-port.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml index a3aeff370a..3a5b21779c 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd-pod-network-cidr.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml index 33fbd96c8c..c7f58af531 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.19/containerd.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml index f3206df7ed..a14004cea0 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-api-port.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml index 683ae434da..ae78c83e2a 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd-pod-network-cidr.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml index dbe8756d95..08daa24180 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.20/containerd.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml index 9c67aa0d29..09b0971170 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-api-port.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml index 79d5b2d411..057a947793 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd-pod-network-cidr.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml index bfcaa98467..34c8142fd6 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.21/containerd.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml index 88198f3a5b..03378418da 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-api-port.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml index 42a3f48168..fc0fde88d5 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd-pod-network-cidr.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml index ceebe37e37..cfbdaed96e 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.22/containerd.yaml @@ -51,7 +51,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml index 7b46b2fcd5..baa211c625 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-api-port.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml index 0b14634f79..a0604056ec 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd-pod-network-cidr.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml index 0700426ea5..4ca004be58 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.23/containerd.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml index 9c1f32e2e4..070746c3f5 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-api-port.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml index b91a260532..d984ac1ae0 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd-pod-network-cidr.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml index 9df6aaa449..6bd3c29cff 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.24/containerd.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml index cd57de3e0f..7d8426cec9 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-api-port.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml index 744eb4a75a..51898a2f39 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd-pod-network-cidr.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml index 9ef1d535b7..9a4ebdf597 100644 --- a/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml +++ b/pkg/minikube/bootstrapper/bsutil/testdata/v1.25/containerd.yaml @@ -49,7 +49,7 @@ kind: KubeletConfiguration authentication: x509: clientCAFile: /var/lib/minikube/certs/ca.crt -cgroupDriver: systemd +cgroupDriver: cgroupfs hairpinMode: hairpin-veth runtimeRequestTimeout: 15m clusterDomain: "cluster.local" diff --git a/pkg/minikube/cni/bridge.go b/pkg/minikube/cni/bridge.go index 063d769401..48a0acb6fe 100644 --- a/pkg/minikube/cni/bridge.go +++ b/pkg/minikube/cni/bridge.go @@ -108,8 +108,3 @@ func (c Bridge) Apply(r Runner) error { func (c Bridge) CIDR() string { return DefaultPodCIDR } - -// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). -func (c Bridge) Ready() bool { - return true -} diff --git a/pkg/minikube/cni/calico.go b/pkg/minikube/cni/calico.go index 0105266d25..6f7b55c4b7 100644 --- a/pkg/minikube/cni/calico.go +++ b/pkg/minikube/cni/calico.go @@ -19,7 +19,6 @@ package cni import ( "bytes" "fmt" - "time" // goembed needs this _ "embed" @@ -27,9 +26,6 @@ import ( "github.com/blang/semver/v4" "github.com/pkg/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog/v2" - "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/bootstrapper/images" "k8s.io/minikube/pkg/minikube/config" @@ -98,15 +94,3 @@ func (c Calico) CIDR() string { // Calico docs specify 192.168.0.0/16 - but we do this for compatibility with other CNI's. return DefaultPodCIDR } - -// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). -// Calico uses k8s-app=calico-node and k8s-app=calico-kube-controllers labels. -func (c Calico) Ready() bool { - client, err := kapi.Client(c.cc.Name) - if err != nil { - klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) - return false - } - - return kapi.WaitForPods(client, meta.NamespaceAll, "k8s-app in (calico-node, calico-kube-controllers)", 10*time.Millisecond) == nil -} diff --git a/pkg/minikube/cni/cilium.go b/pkg/minikube/cni/cilium.go index 9a0c861deb..ddfcb288e4 100644 --- a/pkg/minikube/cni/cilium.go +++ b/pkg/minikube/cni/cilium.go @@ -20,12 +20,9 @@ import ( "bytes" "os/exec" "text/template" - "time" "github.com/pkg/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" - "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/config" ) @@ -865,16 +862,3 @@ func (c Cilium) Apply(r Runner) error { return applyManifest(c.cc, r, manifestAsset(ciliumCfg)) } - -// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). -// Cilium uses k8s-app=cilium and name=cilium-operator labels. -func (c Cilium) Ready() bool { - client, err := kapi.Client(c.cc.Name) - if err != nil { - klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) - return false - } - - return kapi.WaitForPods(client, meta.NamespaceAll, "k8s-app=cilium", 10*time.Millisecond) == nil && - kapi.WaitForPods(client, meta.NamespaceAll, "name=cilium-operator", 10*time.Millisecond) == nil -} diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index 25fcf9f9e0..a6dfc3ea69 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -72,9 +72,6 @@ type Manager interface { // String representation String() string - - // Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). - Ready() bool } // tmplInputs are inputs to CNI templates @@ -155,10 +152,10 @@ func chooseDefault(cc config.ClusterConfig) Manager { if cc.KubernetesConfig.ContainerRuntime != constants.Docker { if driver.IsKIC(cc.Driver) { - klog.Infof("%q driver + %s runtime found, recommending kindnet", cc.Driver, cc.KubernetesConfig.ContainerRuntime) + klog.Infof("%q driver + %q runtime found, recommending kindnet", cc.Driver, cc.KubernetesConfig.ContainerRuntime) return KindNet{cc: cc} } - klog.Infof("%q driver + %s runtime found, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) + klog.Infof("%q driver + %q runtime found, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) return Bridge{cc: cc} } @@ -170,7 +167,7 @@ func chooseDefault(cc config.ClusterConfig) Manager { // ref: https://github.com/cri-o/cri-o/blob/f317b267ddef21aee5ffc92d890a77112b006815/contrib/cni/10-crio-bridge.conflist kv, err := util.ParseKubernetesVersion(cc.KubernetesConfig.KubernetesVersion) if err == nil && kv.GTE(semver.MustParse("1.24.0-alpha.2")) { - klog.Infof("%q driver + %q container runtime found on kunernetes v1.24+, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) + klog.Infof("%q driver + %q container runtime found on kubernetes v1.24+, recommending bridge", cc.Driver, cc.KubernetesConfig.ContainerRuntime) return Bridge{cc: cc} } diff --git a/pkg/minikube/cni/custom.go b/pkg/minikube/cni/custom.go index fd3012eb36..b70dfbf9e6 100644 --- a/pkg/minikube/cni/custom.go +++ b/pkg/minikube/cni/custom.go @@ -69,8 +69,3 @@ func (c Custom) Apply(r Runner) error { func (c Custom) CIDR() string { return DefaultPodCIDR } - -// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). -func (c Custom) Ready() bool { - return true -} diff --git a/pkg/minikube/cni/disabled.go b/pkg/minikube/cni/disabled.go index 5196b821b8..5c273ef121 100644 --- a/pkg/minikube/cni/disabled.go +++ b/pkg/minikube/cni/disabled.go @@ -51,8 +51,3 @@ func (c Disabled) CIDR() string { // Even without any CNI we want our nodes to have spec.PodCIDR set. return DefaultPodCIDR } - -// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). -func (c Disabled) Ready() bool { - return true -} diff --git a/pkg/minikube/cni/flannel.go b/pkg/minikube/cni/flannel.go index c1f3605a61..c906dafd46 100644 --- a/pkg/minikube/cni/flannel.go +++ b/pkg/minikube/cni/flannel.go @@ -21,12 +21,8 @@ import ( _ "embed" "os/exec" "text/template" - "time" "github.com/pkg/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog/v2" - "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/config" ) @@ -84,15 +80,3 @@ func (c Flannel) manifest() (assets.CopyableFile, error) { func (c Flannel) CIDR() string { return DefaultPodCIDR } - -// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). -// Flannel uses app=flannel label. -func (c Flannel) Ready() bool { - client, err := kapi.Client(c.cc.Name) - if err != nil { - klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) - return false - } - - return kapi.WaitForPods(client, meta.NamespaceAll, "app=flannel", 10*time.Millisecond) == nil -} diff --git a/pkg/minikube/cni/kindnet.go b/pkg/minikube/cni/kindnet.go index 3e99125009..fa30e14430 100644 --- a/pkg/minikube/cni/kindnet.go +++ b/pkg/minikube/cni/kindnet.go @@ -20,12 +20,8 @@ import ( "bytes" "os/exec" "text/template" - "time" "github.com/pkg/errors" - meta "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog/v2" - "k8s.io/minikube/pkg/kapi" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/bootstrapper/images" "k8s.io/minikube/pkg/minikube/config" @@ -199,15 +195,3 @@ func (c KindNet) Apply(r Runner) error { func (c KindNet) CIDR() string { return DefaultPodCIDR } - -// Ready returns if CNI is ready (eg, all required pods have Ready PodCondition). -// KindNet uses app=kindnet or k8s-app=kindnet label. -func (c KindNet) Ready() bool { - client, err := kapi.Client(c.cc.Name) - if err != nil { - klog.Errorf("unable to get k8s client for %s: %v", c.cc.Name, err) - return false - } - - return kapi.WaitForPods(client, meta.NamespaceAll, "app=kindnet", 10*time.Millisecond) == nil -} diff --git a/pkg/minikube/config/types.go b/pkg/minikube/config/types.go index ec0d1abb65..10e6ef8a8a 100644 --- a/pkg/minikube/config/types.go +++ b/pkg/minikube/config/types.go @@ -115,7 +115,6 @@ type KubernetesConfig struct { APIServerNames []string APIServerIPs []net.IP DNSDomain string - CgroupDriver string ContainerRuntime string CRISocket string NetworkPlugin string @@ -145,7 +144,6 @@ type Node struct { IP string Port int KubernetesVersion string - CgroupDriver string ContainerRuntime string ControlPlane bool Worker bool diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index a2d983515b..04cf62f816 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -150,12 +150,14 @@ func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semve if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|"io.containerd.runtime.v1.linux"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "configuring io.containerd.runtime version") } - // avoid containerd v1.6.14 "failed to load plugin io.containerd.grpc.v1.cri" error="invalid plugin config: `systemd_cgroup` only works for runtime io.containerd.runtime.v1.linux" error + // avoid containerd v1.6.14+ "failed to load plugin io.containerd.grpc.v1.cri" error="invalid plugin config: `systemd_cgroup` only works for runtime io.containerd.runtime.v1.linux" error // that then leads to crictl "getting the runtime version: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService" error // ref: https://github.com/containerd/containerd/issues/4203 if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i '/systemd_cgroup/d' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "removing deprecated systemd_cgroup param") } + // "runtime_type" has to be specified and it should be "io.containerd.runc.v2" + // ref: https://github.com/containerd/containerd/issues/6964#issuecomment-1132378279 if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|"io.containerd.runc.v1"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "configuring io.containerd.runc version") } @@ -231,7 +233,7 @@ func (r *Containerd) Enable(disOthers bool, cgroupDriver string, inUserNamespace // TODO (@prezha): remove this hack after proper version update in minikube release // ref: https://github.com/containerd/containerd/blob/main/RELEASES.md#kubernetes-support - targetVersion := "1.6.14" + targetVersion := "1.6.15" currentVersion, err := r.Version() if err == nil && semver.MustParse(targetVersion).GT(semver.MustParse(currentVersion)) { klog.Infof("replacing original containerd with v%s-%s-%s", targetVersion, runtime.GOOS, runtime.GOARCH) @@ -427,21 +429,41 @@ func (r *Containerd) CGroupDriver() (string, error) { if err != nil { return "", err } - if info["config"] == nil { - return "", errors.Wrapf(err, "missing config") + + // crictl also returns default ('false') value for "systemdCgroup" - deprecated "systemd_cgroup" config param that is now irrelevant + // ref: https://github.com/containerd/containerd/blob/5e7baa2eb3dab4c4365dd63c05ed8b3fa94b9271/pkg/cri/config/config.go#L277-L280 + // ref: https://github.com/containerd/containerd/issues/4574#issuecomment-1298727099 + // so, we try to extract runc's "SystemdCgroup" option that we care about + // ref: https://github.com/containerd/containerd/issues/4203#issuecomment-651532765 + j, err := json.Marshal(info) + if err != nil { + return "", fmt.Errorf("marshalling: %v", err) } - config, ok := info["config"].(map[string]interface{}) - if !ok { - return "", errors.Wrapf(err, "config not map") + s := struct { + Config struct { + Containerd struct { + Runtimes struct { + Runc struct { + Options struct { + SystemdCgroup bool `json:"SystemdCgroup"` + } `json:"options"` + } `json:"runc"` + } `json:"runtimes"` + } `json:"containerd"` + } `json:"config"` + }{} + if err := json.Unmarshal(j, &s); err != nil { + return "", fmt.Errorf("unmarshalling: %v", err) } - cgroupManager := "systemd" // default: https://github.com/containerd/containerd/blob/main/docs/cri/config.md#cgroup-driver - switch config["systemdCgroup"] { - case false: - cgroupManager = "cgroupfs" + // note: if "path" does not exists, SystemdCgroup will evaluate to false as 'default' value for bool => constants.CgroupfsCgroupDriver + switch s.Config.Containerd.Runtimes.Runc.Options.SystemdCgroup { case true: - cgroupManager = "systemd" + return constants.SystemdCgroupDriver, nil + case false: + return constants.CgroupfsCgroupDriver, nil + default: + return constants.DefaultCgroupDriver, nil } - return cgroupManager, nil } // KubeletOptions returns kubelet options for a containerd diff --git a/pkg/minikube/detect/detect.go b/pkg/minikube/detect/detect.go index d301b9e491..5bb51753e3 100644 --- a/pkg/minikube/detect/detect.go +++ b/pkg/minikube/detect/detect.go @@ -151,6 +151,7 @@ func SocketVMNetInstalled() bool { // CgroupDriver returns detected cgroup driver as configured on host os. // If unable to detect, it will return constants.DefaultCgroupDriver instead. +// ref: https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-drivers func CgroupDriver() string { switch cgroupVersion() { case "v1": diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 8f33f0f331..19b175e080 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -91,7 +91,7 @@ type Starter struct { } // Start spins up a guest and starts the Kubernetes node. -func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { //nolint to temporary suppress cyclomatic complexity 31 of func `Start` is high (> 30) +func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { var wg sync.WaitGroup stopk8s, err := handleNoKubernetes(starter) if err != nil { @@ -211,26 +211,16 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { //no } } - timeout := viper.GetDuration(waitTimeout) - delay := time.Duration(0) if !starter.Cfg.DisableOptimizations { - cm, err := cni.New(starter.Cfg) - if err != nil { - klog.Warning("unable to create cni manager - will skip waiting for cni to become ready") - } else if !cm.Ready() { - // wait for cni to become ready up to half of the total waitTimeout - if delay, err = waitCNIReady(cm, timeout/2); err != nil { - klog.Warningf("%s cni did not appear ready after %s (will continue): %v", cm.String(), delay, err) - } - } - // scale coredns to 1 replica + // Scale down CoreDNS from default 2 to 1 replica. if err := kapi.ScaleDeployment(starter.Cfg.Name, meta.NamespaceSystem, kconst.CoreDNSDeploymentName, 1); err != nil { - klog.Errorf("unable to scale deployment %q in namespace %q to 1 replica: %v", kconst.CoreDNSDeploymentName, meta.NamespaceSystem, err) + klog.Errorf("Unable to scale down deployment %q in namespace %q to 1 replica: %v", kconst.CoreDNSDeploymentName, meta.NamespaceSystem, err) } } - klog.Infof("Will wait %s for node %+v", timeout-delay, starter.Node) - if err := bs.WaitForNode(*starter.Cfg, *starter.Node, timeout-delay); err != nil { - return nil, errors.Wrapf(err, "wait %s for node", timeout-delay) + + klog.Infof("Will wait %s for node %+v", viper.GetDuration(waitTimeout), starter.Node) + if err := bs.WaitForNode(*starter.Cfg, *starter.Node, viper.GetDuration(waitTimeout)); err != nil { + return nil, errors.Wrapf(err, "wait %s for node", viper.GetDuration(waitTimeout)) } klog.Infof("waiting for startup goroutines ...") @@ -240,20 +230,6 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { //no return kcs, config.Write(viper.GetString(config.ProfileName), starter.Cfg) } -func waitCNIReady(cm cni.Manager, wait time.Duration) (time.Duration, error) { - start := time.Now() - - klog.Infof("will wait %s for %s to become ready", wait, cm.String()) - - query := func() error { - if cm.Ready() { - return nil - } - return fmt.Errorf("%s cni not ready yet", cm.String()) - } - return time.Since(start), retry.Local(query, wait) -} - // handleNoKubernetes handles starting minikube without Kubernetes. func handleNoKubernetes(starter Starter) (bool, error) { // Do not bootstrap cluster if --no-kubernetes. @@ -295,19 +271,6 @@ func handleAPIServer(starter Starter, cr cruntime.Manager, hostIP net.IP) (*kube return nil, bs, errors.Wrap(err, "Failed kubeconfig update") } - if !starter.Cfg.DisableOptimizations && starter.Cfg.KubernetesConfig.NetworkPlugin == "cni" { - // CoreDNS needs CNI to be Ready - scale down to 0 replica if not, so we don't "count" this into waiting time for CoreDNS to come up and we don't hit max CrashLoopBackOff delay later (5 mins atm). - cnm, err := cni.New(starter.Cfg) - if err != nil { - klog.Warning("unable to create cni manager - will skip scaling corens down to 0") - } else if !cnm.Ready() { - klog.Infof("%s cni is not yet ready - will scale coredns down to 0 for now", cnm.String()) - if err := kapi.ScaleDeployment(starter.Cfg.Name, meta.NamespaceSystem, kconst.CoreDNSDeploymentName, 0); err != nil { - klog.Errorf("unable to scale coredns down to 0: %v", err) - } - } - } - // Not running this in a Go func can result in DNS answering taking up to 38 seconds, with the Go func it takes 6-10 seconds. go func() { // Inject {"host.minikube.internal": hostIP} record into CoreDNS. @@ -497,9 +460,8 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k // cgroupDriver returns cgroup driver that should be used to further configure container runtime, node(s) and cluster. // It is based on: // - (forced) user preference (set via flags or env), if present, or -// - existing k8s cluster config, if present, or -// - host os config detection, if possible, or -// - constants.DefaultCgroupDriver, otherwise. +// - default settings for vm or ssh driver, if user, or +// - host os config detection, if possible. // Possible mappings are: "v1" (legacy) cgroups => "cgroupfs", "v2" (unified) cgroups => "systemd" and "" (unknown) cgroups => constants.DefaultCgroupDriver. // Note: starting from k8s v1.22, "kubeadm clusters should be using the systemd driver": // ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.22.md#no-really-you-must-read-this-before-you-upgrade @@ -521,12 +483,6 @@ func cgroupDriver(cc config.ClusterConfig) string { return constants.SystemdCgroupDriver } - // check current cluster config - if cc.KubernetesConfig.CgroupDriver != "" { - klog.Infof("using %q cgroup driver from existing cluster config", cc.KubernetesConfig.CgroupDriver) - return cc.KubernetesConfig.CgroupDriver - } - // vm driver uses iso that boots with cgroupfs cgroup driver by default atm (keep in sync!) if driver.IsVM(cc.Driver) { return constants.CgroupfsCgroupDriver diff --git a/site/content/en/docs/faq/_index.md b/site/content/en/docs/faq/_index.md index 1f5227b51a..b65dc2520d 100644 --- a/site/content/en/docs/faq/_index.md +++ b/site/content/en/docs/faq/_index.md @@ -55,7 +55,8 @@ minikube addons enable auto-pause ## Docker Driver: How can I set minikube's cgroup manager? -minikube will try to auto-detect your system's cgroups driver/manager and configure all other components accordingly so that there are no conflicts. +For non-VM and non-SSH drivers, minikube will try to auto-detect your system's cgroups driver/manager and configure all other components accordingly. +For VM and SSH drivers, minikube will use cgroupfs cgroups driver/manager by default. To force the `systemd` cgroup manager, run: ```bash diff --git a/test/integration/helpers_test.go b/test/integration/helpers_test.go index 34d3cad78a..f01124961f 100644 --- a/test/integration/helpers_test.go +++ b/test/integration/helpers_test.go @@ -306,7 +306,7 @@ func podStatusMsg(pod core.Pod) string { return sb.String() } -// PodWait waits for pods to achieve a Ready state. +// PodWait waits for pods to achieve a running state. func PodWait(ctx context.Context, t *testing.T, profile string, ns string, selector string, timeout time.Duration) ([]string, error) { t.Helper() client, err := kapi.Client(profile) @@ -356,15 +356,6 @@ func PodWait(ctx context.Context, t *testing.T, profile string, ns string, selec podStart = time.Time{} return false, nil } - for _, c := range pod.Status.Conditions { - if c.Type == core.PodReady { - if c.Status != core.ConditionTrue { - t.Logf("%s: pod %q is not yet ready - current phase/status: %s/%s:%s\n", t.Name(), selector, pod.Status.Phase, core.PodReady, c.Status) - podStart = time.Time{} - return false, nil - } - } - } if podStart.IsZero() { podStart = time.Now() From f1b1724128e9bc76bcbf0d164f7bc90bd0661353 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 10 Jan 2023 05:37:25 +0000 Subject: [PATCH 31/44] address comments --- pkg/minikube/bootstrapper/bsutil/kubeadm.go | 2 +- .../bootstrapper/bsutil/kubeadm_test.go | 6 +-- pkg/minikube/cni/cni.go | 51 +++++++++---------- pkg/minikube/cruntime/crio.go | 2 +- test/integration/net_test.go | 5 +- 5 files changed, 31 insertions(+), 35 deletions(-) diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm.go b/pkg/minikube/bootstrapper/bsutil/kubeadm.go index 7c39f1e791..4854fc7734 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm.go @@ -71,7 +71,7 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana // TODO: investigate why containerd (v1.6.15) does not work with k8s (v1.25.3) when both are set to use systemd cgroup driver // for the time being, the workaround is to configure kubelet to use cgroupfs when containerd is using systemd // note: pkg/minikube/bootstrapper/bsutil/kubeadm_test.go::TestGenerateKubeadmYAML also extects this override (for now) - if r.Name() == constants.Containerd && cgroupDriver == constants.SystemdCgroupDriver { + if cc.KubernetesConfig.ContainerRuntime == constants.Containerd && cgroupDriver == constants.SystemdCgroupDriver { cgroupDriver = constants.CgroupfsCgroupDriver } diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go b/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go index 0efb5317d1..13dc81d807 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm_test.go @@ -221,13 +221,13 @@ func TestGenerateKubeadmYAML(t *testing.T) { cfg config.ClusterConfig }{ {"default", "docker", false, config.ClusterConfig{Name: "mk"}}, - {"containerd", "containerd", false, config.ClusterConfig{Name: "mk"}}, + {"containerd", "containerd", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ContainerRuntime: constants.Containerd}}}, {"crio", "crio", false, config.ClusterConfig{Name: "mk"}}, {"options", "docker", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOpts}}}, {"crio-options-gates", "crio", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOpts, FeatureGates: "a=b"}}}, {"unknown-component", "docker", true, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: config.ExtraOptionSlice{config.ExtraOption{Component: "not-a-real-component", Key: "killswitch", Value: "true"}}}}}, - {"containerd-api-port", "containerd", false, config.ClusterConfig{Name: "mk", Nodes: []config.Node{{Port: 12345}}}}, - {"containerd-pod-network-cidr", "containerd", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ExtraOptions: extraOptsPodCidr}}}, + {"containerd-api-port", "containerd", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ContainerRuntime: constants.Containerd}, Nodes: []config.Node{{Port: 12345}}}}, + {"containerd-pod-network-cidr", "containerd", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ContainerRuntime: constants.Containerd, ExtraOptions: extraOptsPodCidr}}}, {"image-repository", "docker", false, config.ClusterConfig{Name: "mk", KubernetesConfig: config.KubernetesConfig{ImageRepository: "test/repo"}}}, } for _, version := range versions { diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index a6dfc3ea69..4f3cb15a5b 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -228,12 +228,10 @@ func ConfigureLoopback(r Runner) error { } // ConfigureDefaultBridgeCNIs configures all default bridge CNIs on a node (designated by runner). -// If network plugin is set (could be, eg "cni" or "kubenet"), it will disable all default bridges by changing extension to "mk_disabled" of *bridge* config file(s) found in /etc/cni/net.d to avoid conflicts. -// Otherwise, it will change ip address range to match DefaultPodCIDR in all *bridge* config file(s) found in /etc/cni/net.d. +// If network plugin is set (could be, eg "cni" or "kubenet"), it will disable all default bridges to avoid conflicts. +// Otherwise, it will configure all default bridges to match DefaultPodCIDR subnet range. // It's usually called before deploying new CNI and on node restarts, to avoid conflicts and flip-flopping of pods' ip addresses. // It is caller's responsibility to restart container runtime for these changes to take effect. -// ref: https://github.com/containernetworking/cni/blob/main/libcni/conf.go -// ref: https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/troubleshooting-cni-plugin-related-errors/ func ConfigureDefaultBridgeCNIs(r Runner, networkPlugin string) error { if networkPlugin != "" { return disableAllBridgeCNIs(r) @@ -241,6 +239,7 @@ func ConfigureDefaultBridgeCNIs(r Runner, networkPlugin string) error { return configureAllBridgeCNIs(r, DefaultPodCIDR) } +// disableAllBridgeCNIs disables all bridge cnis by changing extension to "mk_disabled" of all *bridge* config file(s) found in default location (ie, /etc/cni/net.d). func disableAllBridgeCNIs(r Runner) error { path := "/etc/cni/net.d" @@ -252,21 +251,20 @@ func disableAllBridgeCNIs(r Runner) error { } configs := strings.Trim(out.Stdout.String(), ", ") if len(configs) == 0 { - klog.Infof("no bridge cni configs found in %q - nothing to disable", path) + klog.Infof("no active bridge cni configs found in %q - nothing to disable", path) return nil } klog.Infof("disabled [%s] bridge cni config(s)", configs) - return nil } +// configureAllBridgeCNIs configures all bridge cnis by changing ip address range to match DefaultPodCIDR in all *bridge* config file(s) found in default location (ie, /etc/cni/net.d). +// ref: https://github.com/containernetworking/cni/blob/main/libcni/conf.go +// ref: https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/troubleshooting-cni-plugin-related-errors/ func configureAllBridgeCNIs(r Runner, cidr string) error { - path := "/etc/cni/net.d" - configs := "" - // non-podman configs: out, err := r.RunCmd(exec.Command( - "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", + "sudo", "find", DefaultConfDir, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", // remove ipv6 entries to avoid "failed to set bridge addr: could not add IP address to \"cni0\": permission denied" // ref: https://github.com/cri-o/cri-o/issues/3555 // then also remove trailing comma after ipv4 elements, if any @@ -276,34 +274,31 @@ func configureAllBridgeCNIs(r Runner, cidr string) error { // getting something similar to https://github.com/cri-o/cri-o/blob/main/contrib/cni/11-crio-ipv4-bridge.conflist fmt.Sprintf(`sudo sed -i -r -e '/"dst": ".*:.*"/d' -e 's|^(.*)"dst": (.*)[,*]$|\1"dst": \2|g' -e '/"subnet": ".*:.*"/d' -e 's|^(.*)"subnet": ".*"(.*)[,*]$|\1"subnet": "%s"\2|g' {}`, cidr), ";")) if err != nil { - klog.Errorf("failed to configure non-podman bridge cni configs in %q: %v", path, err) - } else { - configs = out.Stdout.String() + return fmt.Errorf("failed to configure non-podman bridge cni configs in %q: %v", DefaultConfDir, err) } + configs := out.Stdout.String() // podman config(s): // ref: https://github.com/containers/podman/blob/main/cni/87-podman-bridge.conflist ip, ipnet, err := net.ParseCIDR(cidr) if err != nil || ip.To4() == nil { - klog.Errorf("cidr %q is not valid ipv4 address: %v", cidr, err) - } else { - gateway := ip.Mask(ipnet.Mask) - gateway[3]++ - out, err = r.RunCmd(exec.Command( - "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", - fmt.Sprintf(`sudo sed -i -r -e 's|^(.*)"subnet": ".*"(.*)$|\1"subnet": "%s"\2|g' -e 's|^(.*)"gateway": ".*"(.*)$|\1"gateway": "%s"\2|g' {}`, cidr, gateway), ";")) - if err != nil { - klog.Errorf("failed to configure podman bridge cni configs in %q: %v", path, err) - } else { - configs += out.Stdout.String() - } + return fmt.Errorf("cidr %q is not valid ipv4 address: %v", cidr, err) } + gateway := ip.Mask(ipnet.Mask) + gateway[3]++ + out, err = r.RunCmd(exec.Command( + "sudo", "find", DefaultConfDir, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", + fmt.Sprintf(`sudo sed -i -r -e 's|^(.*)"subnet": ".*"(.*)$|\1"subnet": "%s"\2|g' -e 's|^(.*)"gateway": ".*"(.*)$|\1"gateway": "%s"\2|g' {}`, cidr, gateway), ";")) + if err != nil { + return fmt.Errorf("failed to configure podman bridge cni configs in %q: %v", DefaultConfDir, err) + } + configs += out.Stdout.String() - if len(strings.Trim(configs, ", ")) == 0 { - klog.Infof("no bridge cni configs found in %q - nothing to configure", path) + configs = strings.Trim(configs, ", ") + if len(configs) == 0 { + klog.Infof("no active bridge cni configs found in %q - nothing to configure", DefaultConfDir) return nil } klog.Infof("configured [%s] bridge cni config(s)", configs) - return nil } diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 53a653300a..4439508dd9 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -79,7 +79,7 @@ func (r *CRIO) setCGroup(driver string) error { } klog.Infof("configuring cri-o to use %q as cgroup driver...", driver) - c := exec.Command("/bin/bash", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)cgroup_manager = .*$|\1cgroup_manager = %q|' %s`, driver, crioConfigFile)) + c := exec.Command("/bin/bash", "-c", fmt.Sprintf(`sudo sed -i 's|^.*cgroup_manager = .*$|cgroup_manager = %q|' %s`, driver, crioConfigFile)) if _, err := r.Runner.RunCmd(c); err != nil { return errors.Wrap(err, "configuring cgroup_manager") } diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 7183f5b56b..2083be10c2 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -281,7 +281,7 @@ func debugLogs(t *testing.T, profile string) { start := time.Now() var output strings.Builder - output.WriteString(fmt.Sprintf("<<< debugLogs: %s [pass: %v] head >>>\n\n", profile, !t.Failed())) + output.WriteString(fmt.Sprintf("----------------------- debugLogs start: %s [pass: %v] --------------------------------", profile, !t.Failed())) // basic nslookup cmd := exec.Command("kubectl", "--context", profile, "exec", "deployment/netcat", "--", "nslookup", "-timeout=5", "kubernetes.default") @@ -629,5 +629,6 @@ func debugLogs(t *testing.T, profile string) { out, _ = cmd.CombinedOutput() output.WriteString(fmt.Sprintf("\n>>> host: crio config:\n%s\n", out)) - t.Logf("%s\n>>> debugLogs: %s [pass: %v] took: %v <<<\n\n", output.String(), profile, !t.Failed(), time.Since(start)) + output.WriteString(fmt.Sprintf("----------------------- debugLogs end: %s [took: %v] --------------------------------", profile, time.Since(start))) + t.Logf("\n%s\n", output.String()) } From fbe2c19a6584682a839ec6a00aabf801f0a3b330 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 10 Jan 2023 22:15:17 +0000 Subject: [PATCH 32/44] Update test/integration/main_test.go Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com> --- test/integration/main_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 7f87cd01ba..480d1a7d34 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -156,10 +156,7 @@ func KicDriver() bool { // VMDriver checks if the driver is a VM func VMDriver() bool { - if KicDriver() || NoneDriver() { - return false - } - return true + return !KicDriver() && !NoneDriver() } // ContainerRuntime returns the name of a specific container runtime if it was specified From 7703fee08e68a870252ebd76698b2619f283b359 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 10 Jan 2023 22:16:51 +0000 Subject: [PATCH 33/44] Update pkg/network/network.go Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com> --- pkg/network/network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/network/network.go b/pkg/network/network.go index 47f1e2f8eb..3a0e289666 100644 --- a/pkg/network/network.go +++ b/pkg/network/network.go @@ -267,7 +267,7 @@ func ParseAddr(addr string) (net.IP, *net.IPNet, error) { return ip, network, err } -// reserveSubnet returns releaser if subnet was successfully reserved for given period, creating lock for subnet to avoid race condition between multiple minikube instances (especially white testing in parallel). +// reserveSubnet returns releaser if subnet was successfully reserved for given period, creating lock for subnet to avoid race condition between multiple minikube instances (especially while testing in parallel). var reserveSubnet = func(subnet string, period time.Duration) (mutex.Releaser, error) { spec := lock.PathMutexSpec(subnet) spec.Timeout = 1 * time.Millisecond // practically: just check, don't wait From da3af5aca7a07cdbee6db9f0c75aea09e029a629 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 10 Jan 2023 22:17:35 +0000 Subject: [PATCH 34/44] Update pkg/minikube/node/start.go Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com> --- pkg/minikube/node/start.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 19b175e080..1d817be324 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -433,10 +433,7 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k } } - disableOthers := true - if driver.BareMetal(cc.Driver) { - disableOthers = false - } + disableOthers := !driver.BareMetal(cc.Driver) err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace) if err != nil { exit.Error(reason.RuntimeEnable, "Failed to enable container runtime", err) From 4a8e7ad85a233e59cff2254d5cbd92aa50bed142 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 10 Jan 2023 22:43:05 +0000 Subject: [PATCH 35/44] address comments --- .../config.toml.default | 131 ------------------ .../containerd-bin/config.toml.default | 131 ------------------ pkg/kapi/kapi.go | 19 ++- 3 files changed, 8 insertions(+), 273 deletions(-) delete mode 100644 deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default delete mode 100644 deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default diff --git a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default b/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default deleted file mode 100644 index 54a396a435..0000000000 --- a/deploy/iso/minikube-iso/arch/aarch64/package/containerd-bin-aarch64/config.toml.default +++ /dev/null @@ -1,131 +0,0 @@ -version = 2 -root = "/var/lib/containerd" -state = "/run/containerd" -plugin_dir = "" -disabled_plugins = [] -required_plugins = [] -oom_score = 0 - -[grpc] - address = "/run/containerd/containerd.sock" - tcp_address = "" - tcp_tls_cert = "" - tcp_tls_key = "" - uid = 0 - gid = 0 - max_recv_message_size = 16777216 - max_send_message_size = 16777216 - -[ttrpc] - address = "" - uid = 0 - gid = 0 - -[debug] - address = "" - uid = 0 - gid = 0 - level = "" - -[metrics] - address = "" - grpc_histogram = false - -[cgroup] - path = "" - -[timeouts] - "io.containerd.timeout.shim.cleanup" = "5s" - "io.containerd.timeout.shim.load" = "5s" - "io.containerd.timeout.shim.shutdown" = "3s" - "io.containerd.timeout.task.state" = "2s" - -[plugins] - [plugins."io.containerd.gc.v1.scheduler"] - pause_threshold = 0.02 - deletion_threshold = 0 - mutation_threshold = 100 - schedule_delay = "0s" - startup_delay = "100ms" - [plugins."io.containerd.grpc.v1.cri"] - disable_tcp_service = true - stream_server_address = "127.0.0.1" - stream_server_port = "0" - stream_idle_timeout = "4h0m0s" - enable_selinux = false - selinux_category_range = 1024 - sandbox_image = "k8s.gcr.io/pause:3.2" - stats_collect_period = 10 - systemd_cgroup = false - enable_tls_streaming = false - max_container_log_line_size = 16384 - disable_cgroup = false - disable_apparmor = false - restrict_oom_score_adj = false - max_concurrent_downloads = 3 - disable_proc_mount = false - unset_seccomp_profile = "" - tolerate_missing_hugetlb_controller = true - disable_hugetlb_controller = true - ignore_image_defined_volumes = false - [plugins."io.containerd.grpc.v1.cri".containerd] - snapshotter = "overlayfs" - default_runtime_name = "runc" - no_pivot = false - disable_snapshot_annotations = true - discard_unpacked_layers = false - [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "" - runtime_engine = "" - runtime_root = "" - privileged_without_host_devices = false - base_runtime_spec = "" - [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime] - runtime_type = "" - runtime_engine = "" - runtime_root = "" - privileged_without_host_devices = false - base_runtime_spec = "" - [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] - [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] - runtime_type = "io.containerd.runc.v2" - runtime_engine = "" - runtime_root = "" - privileged_without_host_devices = false - base_runtime_spec = "" - [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - [plugins."io.containerd.grpc.v1.cri".cni] - bin_dir = "/opt/cni/bin" - conf_dir = "/etc/cni/net.d" - max_conf_num = 1 - conf_template = "" - [plugins."io.containerd.grpc.v1.cri".registry] - config_path = "/etc/containerd/certs.d" - [plugins."io.containerd.grpc.v1.cri".image_decryption] - key_model = "" - [plugins."io.containerd.grpc.v1.cri".x509_key_pair_streaming] - tls_cert_file = "" - tls_key_file = "" - [plugins."io.containerd.internal.v1.opt"] - path = "/opt/containerd" - [plugins."io.containerd.internal.v1.restart"] - interval = "10s" - [plugins."io.containerd.metadata.v1.bolt"] - content_sharing_policy = "shared" - [plugins."io.containerd.monitor.v1.cgroups"] - no_prometheus = false - [plugins."io.containerd.runtime.v1.linux"] - shim = "containerd-shim" - runtime = "runc" - runtime_root = "" - no_shim = false - shim_debug = false - [plugins."io.containerd.runtime.v2.task"] - platforms = ["linux/amd64"] - [plugins."io.containerd.service.v1.diff-service"] - default = ["walking"] - [plugins."io.containerd.snapshotter.v1.devmapper"] - root_path = "" - pool_name = "" - base_image_size = "" - async_remove = false diff --git a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default b/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default deleted file mode 100644 index 54a396a435..0000000000 --- a/deploy/iso/minikube-iso/arch/x86_64/package/containerd-bin/config.toml.default +++ /dev/null @@ -1,131 +0,0 @@ -version = 2 -root = "/var/lib/containerd" -state = "/run/containerd" -plugin_dir = "" -disabled_plugins = [] -required_plugins = [] -oom_score = 0 - -[grpc] - address = "/run/containerd/containerd.sock" - tcp_address = "" - tcp_tls_cert = "" - tcp_tls_key = "" - uid = 0 - gid = 0 - max_recv_message_size = 16777216 - max_send_message_size = 16777216 - -[ttrpc] - address = "" - uid = 0 - gid = 0 - -[debug] - address = "" - uid = 0 - gid = 0 - level = "" - -[metrics] - address = "" - grpc_histogram = false - -[cgroup] - path = "" - -[timeouts] - "io.containerd.timeout.shim.cleanup" = "5s" - "io.containerd.timeout.shim.load" = "5s" - "io.containerd.timeout.shim.shutdown" = "3s" - "io.containerd.timeout.task.state" = "2s" - -[plugins] - [plugins."io.containerd.gc.v1.scheduler"] - pause_threshold = 0.02 - deletion_threshold = 0 - mutation_threshold = 100 - schedule_delay = "0s" - startup_delay = "100ms" - [plugins."io.containerd.grpc.v1.cri"] - disable_tcp_service = true - stream_server_address = "127.0.0.1" - stream_server_port = "0" - stream_idle_timeout = "4h0m0s" - enable_selinux = false - selinux_category_range = 1024 - sandbox_image = "k8s.gcr.io/pause:3.2" - stats_collect_period = 10 - systemd_cgroup = false - enable_tls_streaming = false - max_container_log_line_size = 16384 - disable_cgroup = false - disable_apparmor = false - restrict_oom_score_adj = false - max_concurrent_downloads = 3 - disable_proc_mount = false - unset_seccomp_profile = "" - tolerate_missing_hugetlb_controller = true - disable_hugetlb_controller = true - ignore_image_defined_volumes = false - [plugins."io.containerd.grpc.v1.cri".containerd] - snapshotter = "overlayfs" - default_runtime_name = "runc" - no_pivot = false - disable_snapshot_annotations = true - discard_unpacked_layers = false - [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime] - runtime_type = "" - runtime_engine = "" - runtime_root = "" - privileged_without_host_devices = false - base_runtime_spec = "" - [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime] - runtime_type = "" - runtime_engine = "" - runtime_root = "" - privileged_without_host_devices = false - base_runtime_spec = "" - [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] - [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] - runtime_type = "io.containerd.runc.v2" - runtime_engine = "" - runtime_root = "" - privileged_without_host_devices = false - base_runtime_spec = "" - [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - [plugins."io.containerd.grpc.v1.cri".cni] - bin_dir = "/opt/cni/bin" - conf_dir = "/etc/cni/net.d" - max_conf_num = 1 - conf_template = "" - [plugins."io.containerd.grpc.v1.cri".registry] - config_path = "/etc/containerd/certs.d" - [plugins."io.containerd.grpc.v1.cri".image_decryption] - key_model = "" - [plugins."io.containerd.grpc.v1.cri".x509_key_pair_streaming] - tls_cert_file = "" - tls_key_file = "" - [plugins."io.containerd.internal.v1.opt"] - path = "/opt/containerd" - [plugins."io.containerd.internal.v1.restart"] - interval = "10s" - [plugins."io.containerd.metadata.v1.bolt"] - content_sharing_policy = "shared" - [plugins."io.containerd.monitor.v1.cgroups"] - no_prometheus = false - [plugins."io.containerd.runtime.v1.linux"] - shim = "containerd-shim" - runtime = "runc" - runtime_root = "" - no_shim = false - shim_debug = false - [plugins."io.containerd.runtime.v2.task"] - platforms = ["linux/amd64"] - [plugins."io.containerd.service.v1.diff-service"] - default = ["walking"] - [plugins."io.containerd.snapshotter.v1.devmapper"] - root_path = "" - pool_name = "" - base_image_size = "" - async_remove = false diff --git a/pkg/kapi/kapi.go b/pkg/kapi/kapi.go index 3de7f0dd25..4fd39e0ff5 100644 --- a/pkg/kapi/kapi.go +++ b/pkg/kapi/kapi.go @@ -222,22 +222,19 @@ func ScaleDeployment(kcontext, namespace, deploymentName string, replicas int) e err = wait.PollImmediate(kconst.APICallRetryInterval, ReasonableMutateTime, func() (bool, error) { scale, err := client.AppsV1().Deployments(namespace).GetScale(context.Background(), deploymentName, meta.GetOptions{}) if err != nil { - if IsRetryableAPIError(err) { - klog.Warningf("failed getting %q deployment scale, will retry: %v", deploymentName, err) - return false, nil + if !IsRetryableAPIError(err) { + return false, fmt.Errorf("non-retryable failure while getting %q deployment scale: %v", deploymentName, err) } - klog.Info("non-retryable failure while getting %q deployment scale: %v", deploymentName, err) - return false, err + klog.Warningf("failed getting %q deployment scale, will retry: %v", deploymentName, err) + return false, nil } if scale.Spec.Replicas != int32(replicas) { scale.Spec.Replicas = int32(replicas) - _, err = client.AppsV1().Deployments(namespace).UpdateScale(context.Background(), deploymentName, scale, meta.UpdateOptions{}) - if err != nil { - if IsRetryableAPIError(err) { - klog.Warningf("failed rescaling %s deployment, will retry: %v", deploymentName, err) - } else { - klog.Info("non-retryable failure while rescaling %s deployment: %v", deploymentName, err) + if _, err = client.AppsV1().Deployments(namespace).UpdateScale(context.Background(), deploymentName, scale, meta.UpdateOptions{}); err != nil { + if !IsRetryableAPIError(err) { + return false, fmt.Errorf("non-retryable failure while rescaling %s deployment: %v", deploymentName, err) } + klog.Warningf("failed rescaling %s deployment, will retry: %v", deploymentName, err) } // repeat (if change was successful - once again to check & confirm requested scale) return false, nil From 805f7b2da3b8f554827e0af1a60e6a76a3544304 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Tue, 10 Jan 2023 23:04:57 +0000 Subject: [PATCH 36/44] lint --- pkg/network/network.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/pkg/network/network.go b/pkg/network/network.go index 26fc1ae976..8a84260b2c 100644 --- a/pkg/network/network.go +++ b/pkg/network/network.go @@ -29,27 +29,6 @@ import ( const defaultReservationPeriod = 1 * time.Minute -var ( - // valid private network subnets (RFC1918) - privateSubnets = []net.IPNet{ - // 10.0.0.0/8 - { - IP: []byte{10, 0, 0, 0}, - Mask: []byte{255, 0, 0, 0}, - }, - // 172.16.0.0/12 - { - IP: []byte{172, 16, 0, 0}, - Mask: []byte{255, 240, 0, 0}, - }, - // 192.168.0.0/16 - { - IP: []byte{192, 168, 0, 0}, - Mask: []byte{255, 255, 0, 0}, - }, - } -) - // Parameters contains main network parameters. type Parameters struct { IP string // IP address of network From a573330a009f7abea2f43cf5e82fb4efe5c6d7df Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Thu, 12 Jan 2023 13:48:00 +0000 Subject: [PATCH 37/44] fix updateContainerdBinary --- pkg/minikube/cruntime/containerd.go | 6 +++--- pkg/minikube/cruntime/cruntime.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 04cf62f816..f932aa3c78 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -236,10 +236,10 @@ func (r *Containerd) Enable(disOthers bool, cgroupDriver string, inUserNamespace targetVersion := "1.6.15" currentVersion, err := r.Version() if err == nil && semver.MustParse(targetVersion).GT(semver.MustParse(currentVersion)) { - klog.Infof("replacing original containerd with v%s-%s-%s", targetVersion, runtime.GOOS, runtime.GOARCH) + klog.Infof("replacing original containerd with v%s-linux-%s", targetVersion, runtime.GOARCH) _ = r.Init.ForceStop("containerd") - if err := updateContainerdBinary(r.Runner, targetVersion, runtime.GOOS, runtime.GOARCH); err != nil { - klog.Warningf("unable to replace original containerd with v%s-%s-%s: %v", targetVersion, runtime.GOOS, runtime.GOARCH, err) + if err := updateContainerdBinary(r.Runner, targetVersion, runtime.GOARCH); err != nil { + klog.Warningf("unable to replace original containerd with v%s-linux-%s: %v", targetVersion, runtime.GOARCH, err) } } diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index bf3f692bf6..c9a8bac5b6 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -368,8 +368,8 @@ func updateCRIDockerdBinary(cr CommandRunner, version, arch string) error { } // updateContainerdBinary updates containerd to version -func updateContainerdBinary(cr CommandRunner, version, os, arch string) error { - curl := fmt.Sprintf("curl -sSfL https://github.com/containerd/containerd/releases/download/v%s/containerd-%s-%s-%s.tar.gz | tar -xz -C /tmp", version, version, os, arch) +func updateContainerdBinary(cr CommandRunner, version, arch string) error { + curl := fmt.Sprintf("curl -sSfL https://github.com/containerd/containerd/releases/download/v%s/containerd-%s-linux-%s.tar.gz | tar -xz -C /tmp", version, version, arch) if _, err := cr.RunCmd(exec.Command("sudo", "sh", "-c", curl)); err != nil { return fmt.Errorf("unable to download containerd version %s: %v", version, err) } From 0e3ebc74c8ee34e0eeddbc0eb85e9bf4384059e4 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Thu, 12 Jan 2023 16:24:25 +0000 Subject: [PATCH 38/44] go mod tidy --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 1b500371c7..726546ca4b 100644 --- a/go.mod +++ b/go.mod @@ -70,7 +70,6 @@ require ( golang.org/x/text v0.6.0 gonum.org/v1/plot v0.12.0 google.golang.org/api v0.106.0 - gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.26.0 k8s.io/apimachinery v0.26.0 From 23351ba30d02b11db5058bd15be004ab3bdd65d5 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Thu, 12 Jan 2023 21:18:49 +0000 Subject: [PATCH 39/44] Update pkg/kapi/kapi.go Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com> --- pkg/kapi/kapi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kapi/kapi.go b/pkg/kapi/kapi.go index 4fd39e0ff5..824de949cf 100644 --- a/pkg/kapi/kapi.go +++ b/pkg/kapi/kapi.go @@ -242,7 +242,7 @@ func ScaleDeployment(kcontext, namespace, deploymentName string, replicas int) e return true, nil }) if err != nil { - klog.Infof("failed rescaling %q deployment in %q namespace and %q context to %d replicas: %v", deploymentName, namespace, kcontext, replicas, err) + klog.Warningf("failed rescaling %q deployment in %q namespace and %q context to %d replicas: %v", deploymentName, namespace, kcontext, replicas, err) return err } klog.Infof("%q deployment in %q namespace and %q context rescaled to %d replicas", deploymentName, namespace, kcontext, replicas) From 470e7b6fa060786a05fa2abe3a5cf2e6950c5f08 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Thu, 12 Jan 2023 21:19:44 +0000 Subject: [PATCH 40/44] Update pkg/minikube/cruntime/cri.go Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com> --- pkg/minikube/cruntime/cri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/minikube/cruntime/cri.go b/pkg/minikube/cruntime/cri.go index 8d0c355f60..bfa4964f2a 100644 --- a/pkg/minikube/cruntime/cri.go +++ b/pkg/minikube/cruntime/cri.go @@ -232,7 +232,7 @@ func stopCRIContainers(cr CommandRunner, ids []string) error { klog.Infof("Stopping containers: %s", ids) crictl := getCrictlPath(cr) - // bring crictl stop timeout on pair with docker: + // bring crictl stop timeout on par with docker: // - docker stop --help => -t, --time int Seconds to wait for stop before killing it (default 10) // - crictl stop --help => --timeout value, -t value Seconds to wait to kill the container after a graceful stop is requested (default: 0) // to prevent "stuck" containers blocking ports (eg, "[ERROR Port-2379|2380]: Port 2379|2380 is in use" for etcd during "hot" k8s upgrade) From 4fbcdfc2ae72c95a7e9ed060885b6846f7e834e4 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Thu, 12 Jan 2023 21:26:05 +0000 Subject: [PATCH 41/44] reference follow up issue --- pkg/minikube/bootstrapper/bsutil/kubeadm.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/minikube/bootstrapper/bsutil/kubeadm.go b/pkg/minikube/bootstrapper/bsutil/kubeadm.go index 4854fc7734..780a573dde 100644 --- a/pkg/minikube/bootstrapper/bsutil/kubeadm.go +++ b/pkg/minikube/bootstrapper/bsutil/kubeadm.go @@ -69,7 +69,8 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana return nil, errors.Wrap(err, "getting cgroup driver") } // TODO: investigate why containerd (v1.6.15) does not work with k8s (v1.25.3) when both are set to use systemd cgroup driver - // for the time being, the workaround is to configure kubelet to use cgroupfs when containerd is using systemd + // issue: https://github.com/kubernetes/minikube/issues/15633 + // until this is fixed, the workaround is to configure kubelet to use cgroupfs when containerd is using systemd // note: pkg/minikube/bootstrapper/bsutil/kubeadm_test.go::TestGenerateKubeadmYAML also extects this override (for now) if cc.KubernetesConfig.ContainerRuntime == constants.Containerd && cgroupDriver == constants.SystemdCgroupDriver { cgroupDriver = constants.CgroupfsCgroupDriver From e2f2bc923a4c1a10fb95148f79352e0aa0d7f198 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Fri, 13 Jan 2023 02:35:09 +0000 Subject: [PATCH 42/44] fix none driver --- pkg/minikube/cni/cni.go | 5 ----- pkg/minikube/cruntime/cruntime.go | 6 +----- pkg/minikube/cruntime/docker.go | 4 ++-- pkg/minikube/node/start.go | 13 +++++-------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index 4f3cb15a5b..bc37805335 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -138,11 +138,6 @@ func chooseDefault(cc config.ClusterConfig) Manager { return Bridge{} } - if driver.BareMetal(cc.Driver) { - klog.Infof("Driver %s used, CNI unnecessary in this configuration, recommending no CNI", cc.Driver) - return Disabled{cc: cc} - } - if len(cc.Nodes) > 1 || cc.MultiNodeRequested { // Enables KindNet CNI in master in multi node cluster, This solves the network problem // inside pod for multi node clusters. See https://github.com/kubernetes/minikube/issues/9838. diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index c9a8bac5b6..0cfee9be2b 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -345,11 +345,7 @@ func ConfigureNetworkPlugin(r Manager, cr CommandRunner, networkPlugin string) e } return nil } - dm, ok := r.(*Docker) - if !ok { - return fmt.Errorf("name and type mismatch") - } - return dockerConfigureNetworkPlugin(*dm, cr, networkPlugin) + return dockerConfigureNetworkPlugin(cr, networkPlugin) } // updateCRIDockerdBinary updates cri-dockerd to version diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index 9ae3ea18f4..0695ba4fd5 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -699,7 +699,7 @@ const ( CNICacheDir = "/var/lib/cni/cache" ) -func dockerConfigureNetworkPlugin(r Docker, cr CommandRunner, networkPlugin string) error { +func dockerConfigureNetworkPlugin(cr CommandRunner, networkPlugin string) error { // $ cri-dockerd --version // cri-dockerd 0.2.6 (d8accf7) // $ cri-dockerd --help | grep -i cni @@ -738,5 +738,5 @@ ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plug if err := cr.Copy(svc); err != nil { return errors.Wrap(err, "failed to copy template") } - return r.Init.Restart("cri-docker") + return nil } diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 1d817be324..5b64cec86e 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -417,9 +417,9 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k inUserNamespace := strings.Contains(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true") // for docker container runtime: ensure containerd is properly configured by calling Enable(), as docker could be bound to containerd // it will also "soft" start containerd, but it will not disable others; docker will disable containerd if not used in the next step - if co.Type == "docker" { + if co.Type == constants.Docker { containerd, err := cruntime.New(cruntime.Config{ - Type: "containerd", + Type: constants.Containerd, Socket: "", // use default Runner: co.Runner, ImageRepository: co.ImageRepository, @@ -434,20 +434,17 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k } disableOthers := !driver.BareMetal(cc.Driver) - err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace) - if err != nil { + if err = cr.Enable(disableOthers, cgroupDriver(cc), inUserNamespace); err != nil { exit.Error(reason.RuntimeEnable, "Failed to enable container runtime", err) } // Wait for the CRI to be "live", before returning it - err = waitForCRISocket(runner, cr.SocketPath(), 60, 1) - if err != nil { + if err = waitForCRISocket(runner, cr.SocketPath(), 60, 1); err != nil { exit.Error(reason.RuntimeEnable, "Failed to start container runtime", err) } // Wait for the CRI to actually work, before returning - err = waitForCRIVersion(runner, cr.SocketPath(), 60, 10) - if err != nil { + if err = waitForCRIVersion(runner, cr.SocketPath(), 60, 10); err != nil { exit.Error(reason.RuntimeEnable, "Failed to start container runtime", err) } From 4c18f9d2649e1779a5a5ca57a87f8319cbfc96a2 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Wed, 18 Jan 2023 02:41:24 +0000 Subject: [PATCH 43/44] fix cri-o: work with selected cni and detected cgroup driver --- pkg/minikube/cni/cni.go | 52 ++++++++++++++++----------- pkg/minikube/cruntime/containerd.go | 21 +++++++---- pkg/minikube/cruntime/crio.go | 54 ++++++++++++++--------------- pkg/minikube/node/start.go | 9 ++++- test/integration/net_test.go | 5 +++ 5 files changed, 84 insertions(+), 57 deletions(-) diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index bc37805335..b0abcb5d0c 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -48,14 +48,6 @@ const ( DefaultConfDir = "/etc/cni/net.d" ) -var ( - // Network is the network name that CNI should use (eg, "kindnet"). - // Currently, only crio (and podman) can use it, so that setting custom ConfDir is not necessary. - // ref: https://github.com/cri-o/cri-o/issues/2121 (and https://github.com/containers/podman/issues/2370) - // ref: https://github.com/cri-o/cri-o/blob/master/docs/crio.conf.5.md#crionetwork-table - Network = "" -) - // Runner is the subset of command.Runner this package consumes type Runner interface { RunCmd(cmd *exec.Cmd) (*command.RunResult, error) @@ -200,25 +192,41 @@ func applyManifest(cc config.ClusterConfig, r Runner, f assets.CopyableFile) err return nil } -// ConfigureLoopback ensures loopback has expected version ("1.0.0") and valid name ("loopback") in its config file in /etc/cni/net.d -// cri-o is leaving name out atm (https://github.com/cri-o/cri-o/pull/6273) -// avoid errors like: +// ConfigureLoopbackCNI configures loopback cni. +// If disable is true, sets extension of its config file in /etc/cni/net.d to "mk_disabled". +// Otherwise, ensures loopback cni has expected version ("1.0.0") and valid name ("loopback") in its config file in /etc/cni/net.d. +// Note: cri-o is leaving out name atm (https://github.com/cri-o/cri-o/pull/6273). +// Avoid errors like: // - Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "..." network for pod "...": networkPlugin cni failed to set up pod "..." network: missing network name:, // - failed to clean up sandbox container "..." network for pod "...": networkPlugin cni failed to teardown pod "..." network: missing network name] // It is caller's responsibility to restart container runtime for these changes to take effect. -func ConfigureLoopback(r Runner) error { +func ConfigureLoopbackCNI(r Runner, disable bool) error { loopback := "/etc/cni/net.d/*loopback.conf*" // usually: 200-loopback.conf // turn { "cniVersion": "0.3.1", "type": "loopback" } // into { "cniVersion": "0.3.1", "name": "loopback", "type": "loopback" } if _, err := r.RunCmd(exec.Command("sh", "-c", fmt.Sprintf("stat %s", loopback))); err != nil { - klog.Warningf("%q not found, skipping patching loopback config step", loopback) + klog.Warningf("loopback cni configuration skipped: %q not found", loopback) return nil } - if _, err := r.RunCmd(exec.Command( - "sudo", "find", filepath.Dir(loopback), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(loopback), "-exec", "sh", "-c", - `grep -q loopback {} && ( grep -q name {} || sudo sed -i '/"type": "loopback"/i \ \ \ \ "name": "loopback",' {} ) && sudo sed -i 's|"cniVersion": ".*"|"cniVersion": "1.0.0"|g' {}`, ";")); err != nil { - return fmt.Errorf("unable to patch loopback config %q: %v", loopback, err) + + findExec := []string{"find", filepath.Dir(loopback), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(loopback), "-exec", "sh", "-c"} + + if disable { + if _, err := r.RunCmd(exec.Command( + "sudo", append(findExec, + `sudo mv {} {}.mk_disabled`, ";")...)); err != nil { + return fmt.Errorf("unable to disable loopback cni %q: %v", loopback, err) + } + klog.Infof("loopback cni configuration disabled: %q found", loopback) + return nil } + + if _, err := r.RunCmd(exec.Command( + "sudo", append(findExec, + `grep -q loopback {} && ( grep -q name {} || sudo sed -i '/"type": "loopback"/i \ \ \ \ "name": "loopback",' {} ) && sudo sed -i 's|"cniVersion": ".*"|"cniVersion": "1.0.0"|g' {}`, ";")...)); err != nil { + return fmt.Errorf("unable to patch loopback cni config %q: %v", loopback, err) + } + klog.Infof("loopback cni configuration patched: %q found", loopback) return nil } @@ -239,7 +247,8 @@ func disableAllBridgeCNIs(r Runner) error { path := "/etc/cni/net.d" out, err := r.RunCmd(exec.Command( - "sudo", "find", path, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", + // for cri-o, we also disable 87-podman.conflist (that does not have 'bridge' in its name) + "sudo", "find", path, "-maxdepth", "1", "-type", "f", "(", "-name", "*bridge*", "-or", "-name", "*podman*", "-and", "-not", "-name", "*.mk_disabled", ")", "-printf", "%p, ", "-exec", "sh", "-c", `sudo mv {} {}.mk_disabled`, ";")) if err != nil { return fmt.Errorf("failed to disable all bridge cni configs in %q: %v", path, err) @@ -257,7 +266,7 @@ func disableAllBridgeCNIs(r Runner) error { // ref: https://github.com/containernetworking/cni/blob/main/libcni/conf.go // ref: https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/troubleshooting-cni-plugin-related-errors/ func configureAllBridgeCNIs(r Runner, cidr string) error { - // non-podman configs: + // non-podman bridge configs: out, err := r.RunCmd(exec.Command( "sudo", "find", DefaultConfDir, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-not", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", // remove ipv6 entries to avoid "failed to set bridge addr: could not add IP address to \"cni0\": permission denied" @@ -273,7 +282,8 @@ func configureAllBridgeCNIs(r Runner, cidr string) error { } configs := out.Stdout.String() - // podman config(s): + // podman bridge config(s): + // could be eg, 87-podman-bridge.conflist or 87-podman.conflist // ref: https://github.com/containers/podman/blob/main/cni/87-podman-bridge.conflist ip, ipnet, err := net.ParseCIDR(cidr) if err != nil || ip.To4() == nil { @@ -282,7 +292,7 @@ func configureAllBridgeCNIs(r Runner, cidr string) error { gateway := ip.Mask(ipnet.Mask) gateway[3]++ out, err = r.RunCmd(exec.Command( - "sudo", "find", DefaultConfDir, "-maxdepth", "1", "-type", "f", "-name", "*bridge*", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", + "sudo", "find", DefaultConfDir, "-maxdepth", "1", "-type", "f", "-name", "*podman*", "-not", "-name", "*.mk_disabled", "-printf", "%p, ", "-exec", "sh", "-c", fmt.Sprintf(`sudo sed -i -r -e 's|^(.*)"subnet": ".*"(.*)$|\1"subnet": "%s"\2|g' -e 's|^(.*)"gateway": ".*"(.*)$|\1"gateway": "%s"\2|g' {}`, cidr, gateway), ";")) if err != nil { return fmt.Errorf("failed to configure podman bridge cni configs in %q: %v", DefaultConfDir, err) diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index f932aa3c78..e9ab39f684 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -137,34 +137,41 @@ func generateContainerdConfig(cr CommandRunner, imageRepository string, kv semve if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)restrict_oom_score_adj = .*$|\1restrict_oom_score_adj = %t|' %s`, inUserNamespace, containerdConfigFile))); err != nil { return errors.Wrap(err, "update restrict_oom_score_adj") } + // configure cgroup driver - if cgroupDriver != constants.UnknownCgroupDriver { - klog.Infof("configuring containerd to use %q as cgroup driver...", cgroupDriver) - useSystemd := cgroupDriver == constants.SystemdCgroupDriver - if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)SystemdCgroup = .*$|\1SystemdCgroup = %t|g' %s`, useSystemd, containerdConfigFile))); err != nil { - return errors.Wrap(err, "configuring SystemdCgroup") - } + if cgroupDriver == constants.UnknownCgroupDriver { + klog.Warningf("unable to configure containerd to use unknown cgroup driver, will use default %q instead", constants.DefaultCgroupDriver) + cgroupDriver = constants.DefaultCgroupDriver } + klog.Infof("configuring containerd to use %q as cgroup driver...", cgroupDriver) + useSystemd := cgroupDriver == constants.SystemdCgroupDriver + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)SystemdCgroup = .*$|\1SystemdCgroup = %t|g' %s`, useSystemd, containerdConfigFile))); err != nil { + return errors.Wrap(err, "configuring SystemdCgroup") + } + // handle deprecated/removed features // ref: https://github.com/containerd/containerd/blob/main/RELEASES.md#deprecated-features if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|"io.containerd.runtime.v1.linux"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "configuring io.containerd.runtime version") } + // avoid containerd v1.6.14+ "failed to load plugin io.containerd.grpc.v1.cri" error="invalid plugin config: `systemd_cgroup` only works for runtime io.containerd.runtime.v1.linux" error // that then leads to crictl "getting the runtime version: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService" error // ref: https://github.com/containerd/containerd/issues/4203 if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i '/systemd_cgroup/d' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "removing deprecated systemd_cgroup param") } + // "runtime_type" has to be specified and it should be "io.containerd.runc.v2" // ref: https://github.com/containerd/containerd/issues/6964#issuecomment-1132378279 if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|"io.containerd.runc.v1"|"io.containerd.runc.v2"|g' %s`, containerdConfigFile))); err != nil { return errors.Wrap(err, "configuring io.containerd.runc version") } + // ensure conf_dir is using '/etc/cni/net.d' // we might still want to try removing '/etc/cni/net.mk' in case of upgrade from previous minikube version that had/used it if _, err := cr.RunCmd(exec.Command("sh", "-c", `sudo rm -rf /etc/cni/net.mk`)); err != nil { - return fmt.Errorf("unable to remove /etc/cni/net.mk directory: %v", err) + klog.Warningf("unable to remove /etc/cni/net.mk directory: %v", err) } if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i -r 's|^( *)conf_dir = .*$|\1conf_dir = %q|g' %s`, cni.DefaultConfDir, containerdConfigFile))); err != nil { return errors.Wrap(err, "update conf_dir") diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 4439508dd9..3d0fd68f9c 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -31,7 +31,6 @@ import ( "k8s.io/klog/v2" "k8s.io/minikube/pkg/minikube/assets" "k8s.io/minikube/pkg/minikube/bootstrapper/images" - "k8s.io/minikube/pkg/minikube/cni" "k8s.io/minikube/pkg/minikube/command" "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" @@ -41,7 +40,7 @@ import ( ) const ( - // CRIOConfFile is the path to the CRI-O configuration + // crioConfigFile is the path to the CRI-O configuration crioConfigFile = "/etc/crio/crio.conf.d/02-crio.conf" ) @@ -54,35 +53,37 @@ type CRIO struct { Init sysinit.Manager } -// generateCRIOConfig sets up /etc/crio/crio.conf -func generateCRIOConfig(cr CommandRunner, imageRepository string, kv semver.Version) error { +// generateCRIOConfig sets up pause image and cgroup manager for cri-o in crioConfigFile +func generateCRIOConfig(cr CommandRunner, imageRepository string, kv semver.Version, cgroupDriver string) error { pauseImage := images.Pause(kv, imageRepository) - - c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*pause_image = .*$|pause_image = \"%s\"|' -i %s", pauseImage, crioConfigFile)) + klog.Infof("configure cri-o to use %q pause image...", pauseImage) + c := exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|^.*pause_image = .*$|pause_image = %q|' %s`, pauseImage, crioConfigFile)) if _, err := cr.RunCmd(c); err != nil { - return errors.Wrap(err, "generateCRIOConfig") + return errors.Wrap(err, "update pause_image") } - if cni.Network != "" { - klog.Infof("Updating CRIO to use the custom CNI network %q", cni.Network) - if _, err := cr.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*cni_default_network = .*$|cni_default_network = \"%s\"|' -i %s", cni.Network, crioConfigFile))); err != nil { - return errors.Wrap(err, "update network_dir") - } + // configure cgroup driver + if cgroupDriver == constants.UnknownCgroupDriver { + klog.Warningf("unable to configure cri-o to use unknown cgroup driver, will use default %q instead", constants.DefaultCgroupDriver) + cgroupDriver = constants.DefaultCgroupDriver } - - return nil -} - -func (r *CRIO) setCGroup(driver string) error { - if driver == constants.UnknownCgroupDriver { - return fmt.Errorf("unable to configure cri-o to use unknown cgroup driver") - } - - klog.Infof("configuring cri-o to use %q as cgroup driver...", driver) - c := exec.Command("/bin/bash", "-c", fmt.Sprintf(`sudo sed -i 's|^.*cgroup_manager = .*$|cgroup_manager = %q|' %s`, driver, crioConfigFile)) - if _, err := r.Runner.RunCmd(c); err != nil { + klog.Infof("configuring cri-o to use %q as cgroup driver...", cgroupDriver) + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|^.*cgroup_manager = .*$|cgroup_manager = %q|' %s`, cgroupDriver, crioConfigFile))); err != nil { return errors.Wrap(err, "configuring cgroup_manager") } + // avoid errors like: + // - level=fatal msg="Validating runtime config: conmon cgroup should be 'pod' or a systemd slice" + // - level=fatal msg="Validating runtime config: cgroupfs manager conmon cgroup should be 'pod' or empty" + // ref: https://github.com/cri-o/cri-o/pull/3940 + // ref: https://github.com/cri-o/cri-o/issues/6047 + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i '/cgroup_manager = .*/a conmon_cgroup = %q' %s`, "pod", crioConfigFile))); err != nil { + return errors.Wrap(err, "configuring conmon_cgroup") + } + + // we might still want to try removing '/etc/cni/net.mk' in case of upgrade from previous minikube version that had/used it + if _, err := cr.RunCmd(exec.Command("sh", "-c", `sudo rm -rf /etc/cni/net.mk`)); err != nil { + klog.Warningf("unable to remove /etc/cni/net.mk directory: %v", err) + } return nil } @@ -200,15 +201,12 @@ func (r *CRIO) Enable(disOthers bool, cgroupDriver string, inUserNamespace bool) if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil { return err } - if err := generateCRIOConfig(r.Runner, r.ImageRepository, r.KubernetesVersion); err != nil { + if err := generateCRIOConfig(r.Runner, r.ImageRepository, r.KubernetesVersion, cgroupDriver); err != nil { return err } if err := enableIPForwarding(r.Runner); err != nil { return err } - if err := r.setCGroup(cgroupDriver); err != nil { - return err - } if inUserNamespace { if err := CheckKernelCompatibility(r.Runner, 5, 11); err != nil { // For using overlayfs diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 5b64cec86e..e5db44b69e 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -381,9 +381,16 @@ func configureRuntimes(runner cruntime.CommandRunner, cc config.ClusterConfig, k exit.Error(reason.InternalRuntime, "Failed runtime", err) } + // 87-podman.conflist cni conf potentially conflicts with others and is created by podman on its first invocation, + // so we "provoke" it here to ensure it's generated and that we can disable it + // note: using 'help' or '--help' would be cheaper, but does not trigger that; 'version' seems to be next best option + if co.Type == constants.CRIO { + _, _ = runner.RunCmd(exec.Command("sudo", "sh", "-c", `podman version >/dev/null`)) + } // ensure loopback is properly configured // make sure container runtime is restarted afterwards for these changes to take effect - if err := cni.ConfigureLoopback(runner); err != nil { + disableLoopback := co.Type == constants.CRIO + if err := cni.ConfigureLoopbackCNI(runner, disableLoopback); err != nil { klog.Warningf("unable to name loopback interface in dockerConfigureNetworkPlugin: %v", err) } if kv.GTE(semver.MustParse("1.24.0-alpha.2")) { diff --git a/test/integration/net_test.go b/test/integration/net_test.go index 2083be10c2..dae8e1d781 100644 --- a/test/integration/net_test.go +++ b/test/integration/net_test.go @@ -218,6 +218,11 @@ func TestNetworkPlugins(t *testing.T) { func validateFalseCNI(ctx context.Context, t *testing.T, profile string) { cr := ContainerRuntime() + // override cri-o name + if cr == "cri-o" { + cr = "crio" + } + startArgs := []string{"start", "-p", profile, "--memory=2048", "--alsologtostderr", "--cni=false"} startArgs = append(startArgs, StartArgs()...) From 1eb68e8f8a413ab529fd82c6d1d4760917d15682 Mon Sep 17 00:00:00 2001 From: Predrag Rogic Date: Thu, 19 Jan 2023 03:37:39 +0000 Subject: [PATCH 44/44] fix cri-o: ignore disabled cnis --- pkg/minikube/cni/cni.go | 4 ++-- pkg/minikube/cruntime/crio.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/minikube/cni/cni.go b/pkg/minikube/cni/cni.go index b0abcb5d0c..03c9a7988a 100644 --- a/pkg/minikube/cni/cni.go +++ b/pkg/minikube/cni/cni.go @@ -209,7 +209,7 @@ func ConfigureLoopbackCNI(r Runner, disable bool) error { return nil } - findExec := []string{"find", filepath.Dir(loopback), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(loopback), "-exec", "sh", "-c"} + findExec := []string{"find", filepath.Dir(loopback), "-maxdepth", "1", "-type", "f", "-name", filepath.Base(loopback), "-not", "-name", "*.mk_disabled", "-exec", "sh", "-c"} if disable { if _, err := r.RunCmd(exec.Command( @@ -248,7 +248,7 @@ func disableAllBridgeCNIs(r Runner) error { out, err := r.RunCmd(exec.Command( // for cri-o, we also disable 87-podman.conflist (that does not have 'bridge' in its name) - "sudo", "find", path, "-maxdepth", "1", "-type", "f", "(", "-name", "*bridge*", "-or", "-name", "*podman*", "-and", "-not", "-name", "*.mk_disabled", ")", "-printf", "%p, ", "-exec", "sh", "-c", + "sudo", "find", path, "-maxdepth", "1", "-type", "f", "(", "(", "-name", "*bridge*", "-or", "-name", "*podman*", ")", "-and", "-not", "-name", "*.mk_disabled", ")", "-printf", "%p, ", "-exec", "sh", "-c", `sudo mv {} {}.mk_disabled`, ";")) if err != nil { return fmt.Errorf("failed to disable all bridge cni configs in %q: %v", path, err) diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index 3d0fd68f9c..0b38b200cd 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -71,11 +71,15 @@ func generateCRIOConfig(cr CommandRunner, imageRepository string, kv semver.Vers if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i 's|^.*cgroup_manager = .*$|cgroup_manager = %q|' %s`, cgroupDriver, crioConfigFile))); err != nil { return errors.Wrap(err, "configuring cgroup_manager") } - // avoid errors like: + // explicitly set conmon_cgroup to avoid errors like: // - level=fatal msg="Validating runtime config: conmon cgroup should be 'pod' or a systemd slice" // - level=fatal msg="Validating runtime config: cgroupfs manager conmon cgroup should be 'pod' or empty" // ref: https://github.com/cri-o/cri-o/pull/3940 // ref: https://github.com/cri-o/cri-o/issues/6047 + // ref: https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-driver + if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i '/conmon_cgroup = .*/d' %s`, crioConfigFile))); err != nil { + return errors.Wrap(err, "removing conmon_cgroup") + } if _, err := cr.RunCmd(exec.Command("sh", "-c", fmt.Sprintf(`sudo sed -i '/cgroup_manager = .*/a conmon_cgroup = %q' %s`, "pod", crioConfigFile))); err != nil { return errors.Wrap(err, "configuring conmon_cgroup") }