Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
loki/vendor/cloud.google.com/go/storage/iam.go

133 lines
3.7 KiB

// Copyright 2017 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 storage
import (
"context"
"cloud.google.com/go/iam"
"cloud.google.com/go/iam/apiv1/iampb"
raw "google.golang.org/api/storage/v1"
"google.golang.org/genproto/googleapis/type/expr"
)
// IAM provides access to IAM access control for the bucket.
func (b *BucketHandle) IAM() *iam.Handle {
return iam.InternalNewHandleClient(&iamClient{
userProject: b.userProject,
promtail: GCPLog fixing `failed to receive pubsub messages` error (#6965) 1. Read our CONTRIBUTING.md guide 2. Name your PR as `<Feature Area>: Describe your change`. a. Do not end the title with punctuation. It will be added in the changelog. b. Start with an imperative verb. Example: Fix the latency between System A and System B. c. Use sentence case, not title case. d. Use a complete phrase or sentence. The PR title will appear in a changelog, so help other people understand what your change will be. 3. Rebase your PR if it gets out of sync with main --> **What this PR does / why we need it**: Upgrades PubSub to the latest. Myself and other users observe frequent disconnects from PubSub which was addressed upstream. High load production testing has proven that this fixes the problem. As an extra bonus, PubSub seems to ingest ~33% faster with the latest library. **Which issue(s) this PR fixes**: Fixes #6505 **Special notes for your reviewer**: <!-- Note about CHANGELOG entries, if a change adds: * an important feature * fixes an issue present in a previous release, * causes a change in operation that would be useful for an operator of Loki to know then please add a CHANGELOG entry. For documentation changes, build changes, simple fixes etc please skip this step. We are attempting to curate a changelog of the most relevant and important changes to be easier to ingest by end users of Loki. Note about the upgrade guide, if this changes: * default configuration values * metric names or label names * changes existing log lines such as the metrics.go query output line * configuration parameters * anything to do with any API * any other change that would require special attention or extra steps to upgrade Please document clearly what changed AND what needs to be done in the upgrade guide. --> **Checklist** - [ ] Documentation added - [ ] Tests updated - [x] Is this an important fix or new feature? Add an entry in the `CHANGELOG.md`. - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md`
3 years ago
retry: b.retry,
Bump cloud.google.com/go/storage from 1.22.1 to 1.27.0 (#7233) Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.22.1 to 1.27.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/googleapis/google-cloud-go/releases">cloud.google.com/go/storage's releases</a>.</em></p> <blockquote> <h2>storage: v1.27.0</h2> <h2><a href="https://github.com/googleapis/google-cloud-go/compare/storage/v1.26.0...storage/v1.27.0">1.27.0</a> (2022-09-22)</h2> <h3>Features</h3> <ul> <li><strong>storage:</strong> Find GoogleAccessID when using impersonated creds (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/6591">#6591</a>) (<a href="https://github.com/googleapis/google-cloud-go/commit/a2d16a7a778c85d13217fc67955ec5dac1da34e8">a2d16a7</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/googleapis/google-cloud-go/commit/272a0aeb936724403e1f2fb6ccba0bd4548ae1f7"><code>272a0ae</code></a> chore: release spanner 1.27.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4999">#4999</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/59e548acc249c7bddd9c884c2af35d582a408c4d"><code>59e548a</code></a> chore(all): auto-regenerate gapics (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4996">#4996</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/4537b45d2611ce480abfb5d186b59e7258ec872c"><code>4537b45</code></a> feat(spanner): implement valuer and scanner interfaces (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4936">#4936</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/44bc953a426874e7c4cc49c91af0903b83f90477"><code>44bc953</code></a> test(storage): init retry conformance test scaffolding (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4711">#4711</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/e6aa62a95ceb43d22d0fe19e4f8164507d3596f8"><code>e6aa62a</code></a> chore: release dataproc 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4989">#4989</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/d225ec5fe6240ce134ac25804cb8b6160abf053f"><code>d225ec5</code></a> chore: release video 1.0.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4986">#4986</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/0e74f80808e2268f852c58526d0259145d6e2237"><code>0e74f80</code></a> chore: release accesscontextmanager 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4985">#4985</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/a0931472d786673cd44babab1b972be96e1bdf72"><code>a093147</code></a> chore: release securitycenter 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4976">#4976</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/664f1bef34d9da41c1c8c2a7ed7d1021df8daf28"><code>664f1be</code></a> chore: release monitoring 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4975">#4975</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/786ab964f01ed24b27f476f2d5f9b13a184753ce"><code>786ab96</code></a> chore: release profiler 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4957">#4957</a>)</li> <li>Additional commits viewable in <a href="https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.22.1...spanner/v1.27.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cloud.google.com/go/storage&package-manager=go_modules&previous-version=1.22.1&new-version=1.27.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
client: b.c,
}, b.name)
}
// iamClient implements the iam.client interface.
type iamClient struct {
userProject string
promtail: GCPLog fixing `failed to receive pubsub messages` error (#6965) 1. Read our CONTRIBUTING.md guide 2. Name your PR as `<Feature Area>: Describe your change`. a. Do not end the title with punctuation. It will be added in the changelog. b. Start with an imperative verb. Example: Fix the latency between System A and System B. c. Use sentence case, not title case. d. Use a complete phrase or sentence. The PR title will appear in a changelog, so help other people understand what your change will be. 3. Rebase your PR if it gets out of sync with main --> **What this PR does / why we need it**: Upgrades PubSub to the latest. Myself and other users observe frequent disconnects from PubSub which was addressed upstream. High load production testing has proven that this fixes the problem. As an extra bonus, PubSub seems to ingest ~33% faster with the latest library. **Which issue(s) this PR fixes**: Fixes #6505 **Special notes for your reviewer**: <!-- Note about CHANGELOG entries, if a change adds: * an important feature * fixes an issue present in a previous release, * causes a change in operation that would be useful for an operator of Loki to know then please add a CHANGELOG entry. For documentation changes, build changes, simple fixes etc please skip this step. We are attempting to curate a changelog of the most relevant and important changes to be easier to ingest by end users of Loki. Note about the upgrade guide, if this changes: * default configuration values * metric names or label names * changes existing log lines such as the metrics.go query output line * configuration parameters * anything to do with any API * any other change that would require special attention or extra steps to upgrade Please document clearly what changed AND what needs to be done in the upgrade guide. --> **Checklist** - [ ] Documentation added - [ ] Tests updated - [x] Is this an important fix or new feature? Add an entry in the `CHANGELOG.md`. - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md`
3 years ago
retry *retryConfig
Bump cloud.google.com/go/storage from 1.22.1 to 1.27.0 (#7233) Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.22.1 to 1.27.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/googleapis/google-cloud-go/releases">cloud.google.com/go/storage's releases</a>.</em></p> <blockquote> <h2>storage: v1.27.0</h2> <h2><a href="https://github.com/googleapis/google-cloud-go/compare/storage/v1.26.0...storage/v1.27.0">1.27.0</a> (2022-09-22)</h2> <h3>Features</h3> <ul> <li><strong>storage:</strong> Find GoogleAccessID when using impersonated creds (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/6591">#6591</a>) (<a href="https://github.com/googleapis/google-cloud-go/commit/a2d16a7a778c85d13217fc67955ec5dac1da34e8">a2d16a7</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/googleapis/google-cloud-go/commit/272a0aeb936724403e1f2fb6ccba0bd4548ae1f7"><code>272a0ae</code></a> chore: release spanner 1.27.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4999">#4999</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/59e548acc249c7bddd9c884c2af35d582a408c4d"><code>59e548a</code></a> chore(all): auto-regenerate gapics (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4996">#4996</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/4537b45d2611ce480abfb5d186b59e7258ec872c"><code>4537b45</code></a> feat(spanner): implement valuer and scanner interfaces (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4936">#4936</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/44bc953a426874e7c4cc49c91af0903b83f90477"><code>44bc953</code></a> test(storage): init retry conformance test scaffolding (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4711">#4711</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/e6aa62a95ceb43d22d0fe19e4f8164507d3596f8"><code>e6aa62a</code></a> chore: release dataproc 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4989">#4989</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/d225ec5fe6240ce134ac25804cb8b6160abf053f"><code>d225ec5</code></a> chore: release video 1.0.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4986">#4986</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/0e74f80808e2268f852c58526d0259145d6e2237"><code>0e74f80</code></a> chore: release accesscontextmanager 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4985">#4985</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/a0931472d786673cd44babab1b972be96e1bdf72"><code>a093147</code></a> chore: release securitycenter 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4976">#4976</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/664f1bef34d9da41c1c8c2a7ed7d1021df8daf28"><code>664f1be</code></a> chore: release monitoring 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4975">#4975</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/786ab964f01ed24b27f476f2d5f9b13a184753ce"><code>786ab96</code></a> chore: release profiler 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4957">#4957</a>)</li> <li>Additional commits viewable in <a href="https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.22.1...spanner/v1.27.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cloud.google.com/go/storage&package-manager=go_modules&previous-version=1.22.1&new-version=1.27.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
client *Client
}
func (c *iamClient) Get(ctx context.Context, resource string) (p *iampb.Policy, err error) {
return c.GetWithVersion(ctx, resource, 1)
}
func (c *iamClient) GetWithVersion(ctx context.Context, resource string, requestedPolicyVersion int32) (p *iampb.Policy, err error) {
ctx, _ = startSpan(ctx, "storage.IAM.Get")
defer func() { endSpan(ctx, err) }()
Bump cloud.google.com/go/storage from 1.22.1 to 1.27.0 (#7233) Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.22.1 to 1.27.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/googleapis/google-cloud-go/releases">cloud.google.com/go/storage's releases</a>.</em></p> <blockquote> <h2>storage: v1.27.0</h2> <h2><a href="https://github.com/googleapis/google-cloud-go/compare/storage/v1.26.0...storage/v1.27.0">1.27.0</a> (2022-09-22)</h2> <h3>Features</h3> <ul> <li><strong>storage:</strong> Find GoogleAccessID when using impersonated creds (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/6591">#6591</a>) (<a href="https://github.com/googleapis/google-cloud-go/commit/a2d16a7a778c85d13217fc67955ec5dac1da34e8">a2d16a7</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/googleapis/google-cloud-go/commit/272a0aeb936724403e1f2fb6ccba0bd4548ae1f7"><code>272a0ae</code></a> chore: release spanner 1.27.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4999">#4999</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/59e548acc249c7bddd9c884c2af35d582a408c4d"><code>59e548a</code></a> chore(all): auto-regenerate gapics (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4996">#4996</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/4537b45d2611ce480abfb5d186b59e7258ec872c"><code>4537b45</code></a> feat(spanner): implement valuer and scanner interfaces (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4936">#4936</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/44bc953a426874e7c4cc49c91af0903b83f90477"><code>44bc953</code></a> test(storage): init retry conformance test scaffolding (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4711">#4711</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/e6aa62a95ceb43d22d0fe19e4f8164507d3596f8"><code>e6aa62a</code></a> chore: release dataproc 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4989">#4989</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/d225ec5fe6240ce134ac25804cb8b6160abf053f"><code>d225ec5</code></a> chore: release video 1.0.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4986">#4986</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/0e74f80808e2268f852c58526d0259145d6e2237"><code>0e74f80</code></a> chore: release accesscontextmanager 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4985">#4985</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/a0931472d786673cd44babab1b972be96e1bdf72"><code>a093147</code></a> chore: release securitycenter 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4976">#4976</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/664f1bef34d9da41c1c8c2a7ed7d1021df8daf28"><code>664f1be</code></a> chore: release monitoring 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4975">#4975</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/786ab964f01ed24b27f476f2d5f9b13a184753ce"><code>786ab96</code></a> chore: release profiler 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4957">#4957</a>)</li> <li>Additional commits viewable in <a href="https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.22.1...spanner/v1.27.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cloud.google.com/go/storage&package-manager=go_modules&previous-version=1.22.1&new-version=1.27.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
o := makeStorageOpts(true, c.retry, c.userProject)
return c.client.tc.GetIamPolicy(ctx, resource, requestedPolicyVersion, o...)
}
func (c *iamClient) Set(ctx context.Context, resource string, p *iampb.Policy) (err error) {
ctx, _ = startSpan(ctx, "storage.IAM.Set")
defer func() { endSpan(ctx, err) }()
promtail: GCPLog fixing `failed to receive pubsub messages` error (#6965) 1. Read our CONTRIBUTING.md guide 2. Name your PR as `<Feature Area>: Describe your change`. a. Do not end the title with punctuation. It will be added in the changelog. b. Start with an imperative verb. Example: Fix the latency between System A and System B. c. Use sentence case, not title case. d. Use a complete phrase or sentence. The PR title will appear in a changelog, so help other people understand what your change will be. 3. Rebase your PR if it gets out of sync with main --> **What this PR does / why we need it**: Upgrades PubSub to the latest. Myself and other users observe frequent disconnects from PubSub which was addressed upstream. High load production testing has proven that this fixes the problem. As an extra bonus, PubSub seems to ingest ~33% faster with the latest library. **Which issue(s) this PR fixes**: Fixes #6505 **Special notes for your reviewer**: <!-- Note about CHANGELOG entries, if a change adds: * an important feature * fixes an issue present in a previous release, * causes a change in operation that would be useful for an operator of Loki to know then please add a CHANGELOG entry. For documentation changes, build changes, simple fixes etc please skip this step. We are attempting to curate a changelog of the most relevant and important changes to be easier to ingest by end users of Loki. Note about the upgrade guide, if this changes: * default configuration values * metric names or label names * changes existing log lines such as the metrics.go query output line * configuration parameters * anything to do with any API * any other change that would require special attention or extra steps to upgrade Please document clearly what changed AND what needs to be done in the upgrade guide. --> **Checklist** - [ ] Documentation added - [ ] Tests updated - [x] Is this an important fix or new feature? Add an entry in the `CHANGELOG.md`. - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md`
3 years ago
isIdempotent := len(p.Etag) > 0
Bump cloud.google.com/go/storage from 1.22.1 to 1.27.0 (#7233) Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.22.1 to 1.27.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/googleapis/google-cloud-go/releases">cloud.google.com/go/storage's releases</a>.</em></p> <blockquote> <h2>storage: v1.27.0</h2> <h2><a href="https://github.com/googleapis/google-cloud-go/compare/storage/v1.26.0...storage/v1.27.0">1.27.0</a> (2022-09-22)</h2> <h3>Features</h3> <ul> <li><strong>storage:</strong> Find GoogleAccessID when using impersonated creds (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/6591">#6591</a>) (<a href="https://github.com/googleapis/google-cloud-go/commit/a2d16a7a778c85d13217fc67955ec5dac1da34e8">a2d16a7</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/googleapis/google-cloud-go/commit/272a0aeb936724403e1f2fb6ccba0bd4548ae1f7"><code>272a0ae</code></a> chore: release spanner 1.27.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4999">#4999</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/59e548acc249c7bddd9c884c2af35d582a408c4d"><code>59e548a</code></a> chore(all): auto-regenerate gapics (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4996">#4996</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/4537b45d2611ce480abfb5d186b59e7258ec872c"><code>4537b45</code></a> feat(spanner): implement valuer and scanner interfaces (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4936">#4936</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/44bc953a426874e7c4cc49c91af0903b83f90477"><code>44bc953</code></a> test(storage): init retry conformance test scaffolding (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4711">#4711</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/e6aa62a95ceb43d22d0fe19e4f8164507d3596f8"><code>e6aa62a</code></a> chore: release dataproc 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4989">#4989</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/d225ec5fe6240ce134ac25804cb8b6160abf053f"><code>d225ec5</code></a> chore: release video 1.0.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4986">#4986</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/0e74f80808e2268f852c58526d0259145d6e2237"><code>0e74f80</code></a> chore: release accesscontextmanager 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4985">#4985</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/a0931472d786673cd44babab1b972be96e1bdf72"><code>a093147</code></a> chore: release securitycenter 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4976">#4976</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/664f1bef34d9da41c1c8c2a7ed7d1021df8daf28"><code>664f1be</code></a> chore: release monitoring 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4975">#4975</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/786ab964f01ed24b27f476f2d5f9b13a184753ce"><code>786ab96</code></a> chore: release profiler 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4957">#4957</a>)</li> <li>Additional commits viewable in <a href="https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.22.1...spanner/v1.27.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cloud.google.com/go/storage&package-manager=go_modules&previous-version=1.22.1&new-version=1.27.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
o := makeStorageOpts(isIdempotent, c.retry, c.userProject)
return c.client.tc.SetIamPolicy(ctx, resource, p, o...)
}
func (c *iamClient) Test(ctx context.Context, resource string, perms []string) (permissions []string, err error) {
ctx, _ = startSpan(ctx, "storage.IAM.Test")
defer func() { endSpan(ctx, err) }()
Bump cloud.google.com/go/storage from 1.22.1 to 1.27.0 (#7233) Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.22.1 to 1.27.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/googleapis/google-cloud-go/releases">cloud.google.com/go/storage's releases</a>.</em></p> <blockquote> <h2>storage: v1.27.0</h2> <h2><a href="https://github.com/googleapis/google-cloud-go/compare/storage/v1.26.0...storage/v1.27.0">1.27.0</a> (2022-09-22)</h2> <h3>Features</h3> <ul> <li><strong>storage:</strong> Find GoogleAccessID when using impersonated creds (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/6591">#6591</a>) (<a href="https://github.com/googleapis/google-cloud-go/commit/a2d16a7a778c85d13217fc67955ec5dac1da34e8">a2d16a7</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/googleapis/google-cloud-go/commit/272a0aeb936724403e1f2fb6ccba0bd4548ae1f7"><code>272a0ae</code></a> chore: release spanner 1.27.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4999">#4999</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/59e548acc249c7bddd9c884c2af35d582a408c4d"><code>59e548a</code></a> chore(all): auto-regenerate gapics (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4996">#4996</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/4537b45d2611ce480abfb5d186b59e7258ec872c"><code>4537b45</code></a> feat(spanner): implement valuer and scanner interfaces (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4936">#4936</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/44bc953a426874e7c4cc49c91af0903b83f90477"><code>44bc953</code></a> test(storage): init retry conformance test scaffolding (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4711">#4711</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/e6aa62a95ceb43d22d0fe19e4f8164507d3596f8"><code>e6aa62a</code></a> chore: release dataproc 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4989">#4989</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/d225ec5fe6240ce134ac25804cb8b6160abf053f"><code>d225ec5</code></a> chore: release video 1.0.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4986">#4986</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/0e74f80808e2268f852c58526d0259145d6e2237"><code>0e74f80</code></a> chore: release accesscontextmanager 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4985">#4985</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/a0931472d786673cd44babab1b972be96e1bdf72"><code>a093147</code></a> chore: release securitycenter 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4976">#4976</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/664f1bef34d9da41c1c8c2a7ed7d1021df8daf28"><code>664f1be</code></a> chore: release monitoring 1.1.0 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4975">#4975</a>)</li> <li><a href="https://github.com/googleapis/google-cloud-go/commit/786ab964f01ed24b27f476f2d5f9b13a184753ce"><code>786ab96</code></a> chore: release profiler 0.1.1 (<a href="https://github-redirect.dependabot.com/googleapis/google-cloud-go/issues/4957">#4957</a>)</li> <li>Additional commits viewable in <a href="https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.22.1...spanner/v1.27.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cloud.google.com/go/storage&package-manager=go_modules&previous-version=1.22.1&new-version=1.27.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
o := makeStorageOpts(true, c.retry, c.userProject)
return c.client.tc.TestIamPermissions(ctx, resource, perms, o...)
}
func iamToStoragePolicy(ip *iampb.Policy) *raw.Policy {
return &raw.Policy{
Bindings: iamToStorageBindings(ip.Bindings),
Etag: string(ip.Etag),
Version: int64(ip.Version),
}
}
func iamToStorageBindings(ibs []*iampb.Binding) []*raw.PolicyBindings {
var rbs []*raw.PolicyBindings
for _, ib := range ibs {
rbs = append(rbs, &raw.PolicyBindings{
Role: ib.Role,
Members: ib.Members,
Condition: iamToStorageCondition(ib.Condition),
})
}
return rbs
}
func iamToStorageCondition(exprpb *expr.Expr) *raw.Expr {
if exprpb == nil {
return nil
}
return &raw.Expr{
Expression: exprpb.Expression,
Description: exprpb.Description,
Location: exprpb.Location,
Title: exprpb.Title,
}
}
func iamFromStoragePolicy(rp *raw.Policy) *iampb.Policy {
return &iampb.Policy{
Bindings: iamFromStorageBindings(rp.Bindings),
Etag: []byte(rp.Etag),
}
}
func iamFromStorageBindings(rbs []*raw.PolicyBindings) []*iampb.Binding {
var ibs []*iampb.Binding
for _, rb := range rbs {
ibs = append(ibs, &iampb.Binding{
Role: rb.Role,
Members: rb.Members,
Condition: iamFromStorageCondition(rb.Condition),
})
}
return ibs
}
func iamFromStorageCondition(rawexpr *raw.Expr) *expr.Expr {
if rawexpr == nil {
return nil
}
return &expr.Expr{
Expression: rawexpr.Expression,
Description: rawexpr.Description,
Location: rawexpr.Location,
Title: rawexpr.Title,
}
}