Skip to content

Commit

Permalink
fix: [Many APIs] Resolve AttributeError 'Credentials' object has no a…
Browse files Browse the repository at this point in the history
…ttribute '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:
eyJwIjoicGFja2FnZXMvZ29vZ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aXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI4OTFjNjdkMGE4NTViMDgwODVlYjMwMWRhYmIxNDA2NGVmNGIyYzZkIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Feb 5, 2024
1 parent 8465244 commit 27dceb9
Show file tree
Hide file tree
Showing 191 changed files with 10,282 additions and 10,542 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.12.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.12.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.12.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.12.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ def _read_environment_variables():
)
return use_client_cert == "true", use_mtls_endpoint, universe_domain_env

@staticmethod
def _get_client_cert_source(provided_cert_source, use_cert_flag):
"""Return the client cert source to be used by the client.
Expand All @@ -445,6 +446,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
client_cert_source = mtls.default_client_cert_source()
return client_cert_source

@staticmethod
def _get_api_endpoint(
api_override, client_cert_source, universe_domain, use_mtls_endpoint
):
Expand Down Expand Up @@ -519,17 +521,18 @@ def _compare_universes(
Raises:
ValueError: when client_universe does not match the universe in credentials.
"""
if credentials:
credentials_universe = credentials.universe_domain
if client_universe != credentials_universe:
default_universe = GkeHubClient._DEFAULT_UNIVERSE
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)

default_universe = GkeHubClient._DEFAULT_UNIVERSE
credentials_universe = getattr(credentials, "universe_domain", default_universe)

if client_universe != credentials_universe:
raise ValueError(
"The configured universe domain "
f"({client_universe}) does not match the universe domain "
f"found in the credentials ({credentials_universe}). "
"If you haven't configured the universe domain explicitly, "
f"`{default_universe}` is the default."
)
return True

def _validate_universe_domain(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-gke-hub",
"version": "1.12.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-gke-hub/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

dependencies = [
"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.*",
"google-auth >= 2.14.1, <3.0.0dev",
"grpc-google-iam-v1 >=0.12.4, <1.0.0dev",
"proto-plus >= 1.22.3, <2.0.0dev",
"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",
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-gke-hub/testing/constraints-3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
google-api-core==1.34.0
google-auth==2.14.1
grpc-google-iam-v1==0.12.4
proto-plus==1.22.3
protobuf==3.19.5

0 comments on commit 27dceb9

Please sign in to comment.