diff --git a/app/vmbackupmanager/README.md b/app/vmbackupmanager/README.md index 2394720bb..6c12c5c4c 100644 --- a/app/vmbackupmanager/README.md +++ b/app/vmbackupmanager/README.md @@ -151,6 +151,142 @@ The result on the GCS bucket. We see only 3 daily backups: ![daily](vmbackupmanager_rp_daily_2.png) +## API methods + +`vmbackupmanager` exposes the following API methods: + +* GET `/api/v1/backups` - returns list of backups in remote storage. + Example output: + ```json + ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + ``` + +* POST `/api/v1/restore` - saves backup name to restore when [performing restore](#restore-commands). + Example request body: + ```json + {"backup":"daily/2022-10-06"} + ``` + +* GET `/api/v1/restore` - returns backup name from restore mark if it exists. + Example response: + ```json + {"backup":"daily/2022-10-06"} + ``` + +* DELETE `/api/v1/restore` - delete restore mark. + +## CLI + +`vmbackupmanager` exposes CLI commands to work with [API methods](#api-methods) without external dependencies. + +Supported commands: +```console +vmbackupmanager backup + + vmbackupmanager backup list + List backups in remote storage + +vmbackupmanager restore + Restore backup specified by restore mark if it exists + + vmbackupmanager restore get + Get restore mark if it exists + + vmbackupmanager restore delete + Delete restore mark if it exists + + vmbackupmanager restore create [backup_name] + Create restore mark +``` + +By default, CLI commands are using `http://127.0.0.1:8300` endpoint to reach `vmbackupmanager` API. +It can be changed by using flag: +``` +-apiURL string + vmbackupmanager address to perform API requests (default "http://127.0.0.1:8300") +``` + +### Backup commands + +`vmbackupmanager backup list` lists backups in remote storage: +```console +$ ./vmbackupmanager backup list +["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] +``` + +### Restore commands + +Restore commands are used to create, get and delete restore mark. +Restore mark is used by `vmbackupmanager` to store backup name to restore when running restore. + + +Create restore mark: +```console +$ ./vmbackupmanager restore create daily/2022-10-06 +``` + +Get restore mark if it exists: +```console +$ ./vmbackupmanager restore get +{"backup":"daily/2022-10-06"} +``` + +Delete restore mark if it exists: +```console +$ ./vmbackupmanager restore delete +``` + +Perform restore: +```console +$ /vmbackupmanager-prod restore -dst=gs://vmstorage-data/$NODE_IP -credsFilePath=credentials.json -storageDataPath=/vmstorage-data +``` +Note that `vmsingle` or `vmstorage` should be stopped before performing restore. + +If restore mark doesn't exist at `storageDataPath`(restore wasn't requested) `vmbackupmanager restore` will exit with successful status code. + +### How to restore backup via CLI + +1. Run `vmbackupmanager backup list` to get list of available backups: + ```console + $ /vmbackupmanager-prod backup list + ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + ``` +2. Run `vmbackupmanager restore create` to create restore mark: + - Use relative path to backup to restore from currently used remote storage: + ```console + $ /vmbackupmanager-prod restore create daily/2022-10-06 + ``` + - Use full path to backup to restore from any remote storage: + ```console + $ /vmbackupmanager-prod restore create azblob://test1/vmbackupmanager/daily/2022-10-06 + ``` +3. Stop `vmstorage` or `vmsingle` node +4. Run `vmbackupmanager restore` to restore backup: + ```console + $ /vmbackupmanager-prod restore -credsFilePath=credentials.json -storageDataPath=/vmstorage-data + ``` +5. Start `vmstorage` or `vmsingle` node + + +### How to restore in Kubernetes + +1. Enter container running `vmbackupmanager` +2. Use `vmbackupmanager backup list` to get list of available backups: + ```console + $ /vmbackupmanager-prod backup list + ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + ``` +3. Use `vmbackupmanager restore create` to create restore mark: + - Use relative path to backup to restore from currently used remote storage: + ```console + $ /vmbackupmanager-prod restore create daily/2022-10-06 + ``` + - Use full path to backup to restore from any remote storage: + ```console + $ /vmbackupmanager-prod restore create azblob://test1/vmbackupmanager/daily/2022-10-06 + ``` +4. Restart pod + ## Configuration ### Flags @@ -256,6 +392,8 @@ vmbackupmanager performs regular backups according to the provided configs. -pushmetrics.url array Optional URL to push metrics exposed at /metrics page. See https://docs.victoriametrics.com/#push-metrics . By default metrics exposed at /metrics page aren't pushed to any remote storage Supports an array of values separated by comma or specified via multiple flags. + -restoreOnStart + Check if backup restore was requested and restore requested backup. -runOnStart Upload backups immediately after start of the service. Otherwise the backup starts on new hour -s3ForcePathStyle diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 77b08a759..5ad5ad5d2 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -15,6 +15,11 @@ The following tip changes can be tested by building VictoriaMetrics components f ## tip + +## [v1.83.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.83.0) + +Released at 29-10-2022 + **Update note 1:** the `indexdb/tagFilters` cache type at [/metrics](https://docs.victoriametrics.com/#monitoring) has been renamed to `indexdb/tagFiltersToMetricIDs` in order to make its puropose more clear. **Update note 2:** [vmalert](https://docs.victoriametrics.com/vmalert.html): the `crlfEscape` [template function](https://docs.victoriametrics.com/vmalert.html#template-functions) becames obsolete starting from this release. It can be safely removed from alerting templates, since `\n` chars are properly escaped with other `*Escape` functions now. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3139) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/890) issue for details. @@ -56,6 +61,7 @@ The following tip changes can be tested by building VictoriaMetrics components f * FEATURE: log error if some environment variables referred at `-promscrape.config` via `%{ENV_VAR}` aren't found. This should prevent from silent using incorrect config files. * FEATURE: immediately shut down VictoriaMetrics apps on the second SIGINT or SIGTERM signal if they couldn't be finished gracefully for some reason after receiving the first signal. * FEATURE: improve the performance of [/api/v1/series](https://docs.victoriametrics.com/url-examples.html#apiv1series) endpoint by eliminating loading of unused `TSID` data during the API call. +* FEATURE: [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager.html): add functionality for automated restore from backup. See [these docs](https://docs.victoriametrics.com/vmbackupmanager.html#how-to-restore-backup-via-cli). * BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): properly merge buckets with identical `le` values, but with different string representation of these values when calculating [histogram_quantile](https://docs.victoriametrics.com/MetricsQL.html#histogram_quantile) and [histogram_share](https://docs.victoriametrics.com/MetricsQL.html#histogram_share). For example, `http_request_duration_seconds_bucket{le="5"}` and `http_requests_duration_seconds_bucket{le="5.0"}`. Such buckets may be returned from distinct targets. Thanks to @647-coder for the [pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3225). * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): change severity level for log messages about failed attempts for sending data to remote storage from `error` to `warn`. The message for about all failed send attempts remains at `error` severity level. diff --git a/docs/vmbackupmanager.md b/docs/vmbackupmanager.md index 05fab1068..9b7a67294 100644 --- a/docs/vmbackupmanager.md +++ b/docs/vmbackupmanager.md @@ -155,6 +155,142 @@ The result on the GCS bucket. We see only 3 daily backups: ![daily](vmbackupmanager_rp_daily_2.png) +## API methods + +`vmbackupmanager` exposes the following API methods: + +* GET `/api/v1/backups` - returns list of backups in remote storage. + Example output: + ```json + ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + ``` + +* POST `/api/v1/restore` - saves backup name to restore when [performing restore](#restore-commands). + Example request body: + ```json + {"backup":"daily/2022-10-06"} + ``` + +* GET `/api/v1/restore` - returns backup name from restore mark if it exists. + Example response: + ```json + {"backup":"daily/2022-10-06"} + ``` + +* DELETE `/api/v1/restore` - delete restore mark. + +## CLI + +`vmbackupmanager` exposes CLI commands to work with [API methods](#api-methods) without external dependencies. + +Supported commands: +```console +vmbackupmanager backup + + vmbackupmanager backup list + List backups in remote storage + +vmbackupmanager restore + Restore backup specified by restore mark if it exists + + vmbackupmanager restore get + Get restore mark if it exists + + vmbackupmanager restore delete + Delete restore mark if it exists + + vmbackupmanager restore create [backup_name] + Create restore mark +``` + +By default, CLI commands are using `http://127.0.0.1:8300` endpoint to reach `vmbackupmanager` API. +It can be changed by using flag: +``` +-apiURL string + vmbackupmanager address to perform API requests (default "http://127.0.0.1:8300") +``` + +### Backup commands + +`vmbackupmanager backup list` lists backups in remote storage: +```console +$ ./vmbackupmanager backup list +["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] +``` + +### Restore commands + +Restore commands are used to create, get and delete restore mark. +Restore mark is used by `vmbackupmanager` to store backup name to restore when running restore. + + +Create restore mark: +```console +$ ./vmbackupmanager restore create daily/2022-10-06 +``` + +Get restore mark if it exists: +```console +$ ./vmbackupmanager restore get +{"backup":"daily/2022-10-06"} +``` + +Delete restore mark if it exists: +```console +$ ./vmbackupmanager restore delete +``` + +Perform restore: +```console +$ /vmbackupmanager-prod restore -dst=gs://vmstorage-data/$NODE_IP -credsFilePath=credentials.json -storageDataPath=/vmstorage-data +``` +Note that `vmsingle` or `vmstorage` should be stopped before performing restore. + +If restore mark doesn't exist at `storageDataPath`(restore wasn't requested) `vmbackupmanager restore` will exit with successful status code. + +### How to restore backup via CLI + +1. Run `vmbackupmanager backup list` to get list of available backups: + ```console + $ /vmbackupmanager-prod backup list + ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + ``` +2. Run `vmbackupmanager restore create` to create restore mark: + - Use relative path to backup to restore from currently used remote storage: + ```console + $ /vmbackupmanager-prod restore create daily/2022-10-06 + ``` + - Use full path to backup to restore from any remote storage: + ```console + $ /vmbackupmanager-prod restore create azblob://test1/vmbackupmanager/daily/2022-10-06 + ``` +3. Stop `vmstorage` or `vmsingle` node +4. Run `vmbackupmanager restore` to restore backup: + ```console + $ /vmbackupmanager-prod restore -credsFilePath=credentials.json -storageDataPath=/vmstorage-data + ``` +5. Start `vmstorage` or `vmsingle` node + + +### How to restore in Kubernetes + +1. Enter container running `vmbackupmanager` +2. Use `vmbackupmanager backup list` to get list of available backups: + ```console + $ /vmbackupmanager-prod backup list + ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + ``` +3. Use `vmbackupmanager restore create` to create restore mark: + - Use relative path to backup to restore from currently used remote storage: + ```console + $ /vmbackupmanager-prod restore create daily/2022-10-06 + ``` + - Use full path to backup to restore from any remote storage: + ```console + $ /vmbackupmanager-prod restore create azblob://test1/vmbackupmanager/daily/2022-10-06 + ``` +4. Restart pod + ## Configuration ### Flags @@ -260,6 +396,8 @@ vmbackupmanager performs regular backups according to the provided configs. -pushmetrics.url array Optional URL to push metrics exposed at /metrics page. See https://docs.victoriametrics.com/#push-metrics . By default metrics exposed at /metrics page aren't pushed to any remote storage Supports an array of values separated by comma or specified via multiple flags. + -restoreOnStart + Check if backup restore was requested and restore requested backup. -runOnStart Upload backups immediately after start of the service. Otherwise the backup starts on new hour -s3ForcePathStyle diff --git a/go.mod b/go.mod index da55c0a99..a7d89d608 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,8 @@ require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.4 require ( cloud.google.com/go v0.105.0 // indirect - cloud.google.com/go/compute/metadata v0.2.0 // indirect + cloud.google.com/go/compute v1.12.1 // indirect + cloud.google.com/go/compute/metadata v0.2.1 // indirect cloud.google.com/go/iam v0.6.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.1 // indirect github.com/VividCortex/ewma v1.2.0 // indirect diff --git a/go.sum b/go.sum index 9b5d67bf7..8f6e0996a 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,10 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute/metadata v0.2.0 h1:nBbNSZyDpkNlo3DepaaLKVuO7ClyifSAmNloSCZrHnQ= -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/iam v0.6.0 h1:nsqQC88kT5Iwlm4MeNGTpfMWddp6NB/UOLFTH6m1QfQ= diff --git a/lib/envflag/envflag.go b/lib/envflag/envflag.go index 1430ca8b4..598cf4dc0 100644 --- a/lib/envflag/envflag.go +++ b/lib/envflag/envflag.go @@ -22,9 +22,46 @@ var ( // // This function must be called instead of flag.Parse() before using any flags in the program. func Parse() { - // Substitute %{ENV_VAR} inside args with the corresponding environment variable values - args := os.Args[1:] - dstArgs := args[:0] + ParseFlagSet(flag.CommandLine, os.Args[1:]) +} + +// ParseFlagSet parses the given args into the given fs. +func ParseFlagSet(fs *flag.FlagSet, args []string) { + args = expandArgs(args) + if err := fs.Parse(args); err != nil { + // Do not use lib/logger here, since it is uninitialized yet. + log.Fatalf("cannot parse flags %q: %s", args, err) + } + if !*enable { + return + } + // Remember explicitly set command-line flags. + flagsSet := make(map[string]bool) + fs.Visit(func(f *flag.Flag) { + flagsSet[f.Name] = true + }) + + // Obtain the remaining flag values from environment vars. + fs.VisitAll(func(f *flag.Flag) { + if flagsSet[f.Name] { + // The flag is explicitly set via command-line. + return + } + // Get flag value from environment var. + fname := getEnvFlagName(f.Name) + if v, ok := envtemplate.LookupEnv(fname); ok { + if err := fs.Set(f.Name, v); err != nil { + // Do not use lib/logger here, since it is uninitialized yet. + log.Fatalf("cannot set flag %s to %q, which is read from env var %q: %s", f.Name, v, fname, err) + } + } + }) +} + +// expandArgs substitutes %{ENV_VAR} placeholders inside args +// with the corresponding environment variable values. +func expandArgs(args []string) []string { + dstArgs := make([]string, 0, len(args)) for _, arg := range args { s, err := envtemplate.ReplaceString(arg) if err != nil { @@ -35,35 +72,7 @@ func Parse() { dstArgs = append(dstArgs, s) } } - os.Args = os.Args[:1+len(dstArgs)] - - // Parse flags - flag.Parse() - if !*enable { - return - } - - // Remember explicitly set command-line flags. - flagsSet := make(map[string]bool) - flag.Visit(func(f *flag.Flag) { - flagsSet[f.Name] = true - }) - - // Obtain the remaining flag values from environment vars. - flag.VisitAll(func(f *flag.Flag) { - if flagsSet[f.Name] { - // The flag is explicitly set via command-line. - return - } - // Get flag value from environment var. - fname := getEnvFlagName(f.Name) - if v, ok := envtemplate.LookupEnv(fname); ok { - if err := flag.Set(f.Name, v); err != nil { - // Do not use lib/logger here, since it is uninitialized yet. - log.Fatalf("cannot set flag %s to %q, which is read from environment variable %q: %s", f.Name, v, fname, err) - } - } - }) + return dstArgs } func getEnvFlagName(s string) string { diff --git a/vendor/cloud.google.com/go/compute/LICENSE b/vendor/cloud.google.com/go/compute/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/cloud.google.com/go/compute/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/vendor/cloud.google.com/go/compute/internal/version.go b/vendor/cloud.google.com/go/compute/internal/version.go new file mode 100644 index 000000000..5ac4a843e --- /dev/null +++ b/vendor/cloud.google.com/go/compute/internal/version.go @@ -0,0 +1,18 @@ +// Copyright 2022 Google LLC +// +// 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 internal + +// Version is the current tagged release of the library. +const Version = "1.12.1" diff --git a/vendor/cloud.google.com/go/compute/metadata/tidyfix.go b/vendor/cloud.google.com/go/compute/metadata/tidyfix.go new file mode 100644 index 000000000..4cef48500 --- /dev/null +++ b/vendor/cloud.google.com/go/compute/metadata/tidyfix.go @@ -0,0 +1,23 @@ +// Copyright 2022 Google LLC +// +// 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. + +// This file, and the {{.RootMod}} import, won't actually become part of +// the resultant binary. +//go:build modhack +// +build modhack + +package metadata + +// Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository +import _ "cloud.google.com/go/compute/internal" diff --git a/vendor/modules.txt b/vendor/modules.txt index 6afda8e33..634905c7e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -4,7 +4,10 @@ cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -# cloud.google.com/go/compute/metadata v0.2.0 +# cloud.google.com/go/compute v1.12.1 +## explicit; go 1.19 +cloud.google.com/go/compute/internal +# cloud.google.com/go/compute/metadata v0.2.1 ## explicit; go 1.19 cloud.google.com/go/compute/metadata # cloud.google.com/go/iam v0.6.0