Skip to content

Commit 27dceb9

Browse files
fix: [Many APIs] Resolve AttributeError 'Credentials' object has no attribute 'universe_domain' (#12264)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE fix: Resolve AttributeError 'Credentials' object has no attribute 'universe_domain' fix: Add google-auth as a direct dependency fix: Add staticmethod decorator to _get_client_cert_source and _get_api_endpoint END_COMMIT_OVERRIDE PiperOrigin-RevId: 603728206 Source-Link: googleapis/googleapis@9063da8 Source-Link: googleapis/googleapis-gen@891c67d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZS1odWIvLk93bEJvdC55YW1sIiwiaCI6Ijg5MWM2N2QwYTg1NWIwODA4NWViMzAxZGFiYjE0MDY0ZWY0YjJjNmQifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdrZS1tdWx0aWNsb3VkLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdzdWl0ZWFkZG9ucy8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhbS1sb2dnaW5nLy5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhbS8uT3dsQm90LnlhbWwiLCJoIjoiODkxYzY3ZDBhODU1YjA4MDg1ZWIzMDFkYWJiMTQwNjRlZjRiMmM2ZCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhcC8uT3dsQm90LnlhbWwi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MwMWRhYmIxNDA2NGVmNGIyYzZkIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 8465244 commit 27dceb9

File tree

191 files changed

+10282
-10542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+10282
-10542
lines changed

packages/google-cloud-gke-hub/google/cloud/gkehub/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.12.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-gke-hub/google/cloud/gkehub_v1/configmanagement_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.12.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-gke-hub/google/cloud/gkehub_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.12.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-gke-hub/google/cloud/gkehub_v1/multiclusteringress_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.12.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-gke-hub/google/cloud/gkehub_v1/services/gke_hub/client.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ def _read_environment_variables():
427427
)
428428
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env
429429

430+
@staticmethod
430431
def _get_client_cert_source(provided_cert_source, use_cert_flag):
431432
"""Return the client cert source to be used by the client.
432433
@@ -445,6 +446,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
445446
client_cert_source = mtls.default_client_cert_source()
446447
return client_cert_source
447448

449+
@staticmethod
448450
def _get_api_endpoint(
449451
api_override, client_cert_source, universe_domain, use_mtls_endpoint
450452
):
@@ -519,17 +521,18 @@ def _compare_universes(
519521
Raises:
520522
ValueError: when client_universe does not match the universe in credentials.
521523
"""
522-
if credentials:
523-
credentials_universe = credentials.universe_domain
524-
if client_universe != credentials_universe:
525-
default_universe = GkeHubClient._DEFAULT_UNIVERSE
526-
raise ValueError(
527-
"The configured universe domain "
528-
f"({client_universe}) does not match the universe domain "
529-
f"found in the credentials ({credentials_universe}). "
530-
"If you haven't configured the universe domain explicitly, "
531-
f"`{default_universe}` is the default."
532-
)
524+
525+
default_universe = GkeHubClient._DEFAULT_UNIVERSE
526+
credentials_universe = getattr(credentials, "universe_domain", default_universe)
527+
528+
if client_universe != credentials_universe:
529+
raise ValueError(
530+
"The configured universe domain "
531+
f"({client_universe}) does not match the universe domain "
532+
f"found in the credentials ({credentials_universe}). "
533+
"If you haven't configured the universe domain explicitly, "
534+
f"`{default_universe}` is the default."
535+
)
533536
return True
534537

535538
def _validate_universe_domain(self):

packages/google-cloud-gke-hub/samples/generated_samples/snippet_metadata_google.cloud.gkehub.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-gke-hub",
11-
"version": "1.12.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-gke-hub/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
dependencies = [
4242
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
43+
"google-auth >= 2.14.1, <3.0.0dev",
4344
"grpc-google-iam-v1 >=0.12.4, <1.0.0dev",
4445
"proto-plus >= 1.22.3, <2.0.0dev",
4546
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",

packages/google-cloud-gke-hub/testing/constraints-3.7.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
66
# Then this file should have google-cloud-foo==1.14.0
77
google-api-core==1.34.0
8+
google-auth==2.14.1
89
grpc-google-iam-v1==0.12.4
910
proto-plus==1.22.3
1011
protobuf==3.19.5

0 commit comments

Comments
 (0)