Skip to content

Commit

Permalink
493.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Google committed Sep 17, 2024
1 parent 64dbfb3 commit ab29636
Show file tree
Hide file tree
Showing 324 changed files with 24,968 additions and 8,436 deletions.
100 changes: 100 additions & 0 deletions google-cloud-sdk/RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,106 @@ Copyright 2014-2024 Google Inc. All rights reserved.
Subscribe to these release notes at [https://groups.google.com/forum/#!forum/google-cloud-sdk-announce](https://groups.google.com/forum/#!forum/google-cloud-sdk-announce).


## 493.0.0 (2024-09-17)

### Breaking Changes

* **(Anthos Multi-Cloud)** Renamed `--security-posture` flag as `--workload-vulnerability-scanning`.
* **(Compute Engine)** Removed `gcloud compute future-reservations` command group from GA.
* **(Security Command Center)** Removed `gcloud scc slz-overwatch` command group.


### Google Cloud CLI

* `gcloud auth application-default print-access-token` now supports context_aware access.

### AlloyDB

* Added `--node-ids` flag to `gcloud alloydb instances restart` command to the
GA track. This flag allows users to allow users to specify a
comma-separated list of read pool node IDs to perform the restart on. Without
specifying this flag, every node in the read pool will be restarted.

### Cloud Firestore Emulator

* Release Cloud Firestore emulator v1.19.9
* Fix missing version data on non-transactional and transactional deletes

### Cloud Identity-Aware Proxy

* Promoted `--resource-type=forwarding-rule` from ALPHA to beta.

### Cloud Managed Flink

* Fixed issue UDF jars are mishandled for SQL jobs in some cases.
* SQL jobs will always produce script output to improve spotting errors.

### Cloud NetApp

* Added `--allow-auto-tiering` flag to `gcloud netapp storagepools`.
* Added `--tiering-policy` flag to `gcloud netapp volumes`.

### Cloud Pub/Sub

* Modified `--message-retention-duration` flag of `gcloud pubsub subscriptions create` to enforce lower bound of 10 minutes and upper bound of 7 days.
* Modified `--message-retention-duration` flag of `gcloud pubsub subscriptions update` to enforce lower bound of 10 minutes and upper bound of 7 days.

### Cloud SQL

* Added support for restoring backups across projects.

### Cloud Spanner

* Added `--edition` flag to `gcloud spanner instances create` and `gcloud spanner instances update` commands to allow specifying the Spanner edition while creating or updating instances.

### Colab Enterprise

* Added `gcloud beta colab-enterprise runtimes`.
* Added `gcloud beta colab-enterprise runtimes assign`.
* Update `gcloud beta colab-enterprise runtime-templates create` to set
default disk type and size if neither flag is specified, instead of no disk.

### Compute Engine

* Added `--reservation-sharing-policy` flag to `gcloud compute commitments create command` to specify
the reservation sharing policy for the commitment.
* Promote `--turbo-mode` in `gcloud compute instances create` to GA.

### Compute Firewall Policy Rules

* Promoted `--src-network-scope` flag of `gcloud compute firewall-policies rules` to beta.
* Promoted `--src-networks` flag of `gcloud compute firewall-policies rules` to beta.
* Promoted `--dest-network-scope` flag of `gcloud compute firewall-policies rules` to beta.
* Promoted `--src-network-scope` flag of `gcloud compute network-firewall-policies rules` to beta.
* Promoted `--src-networks` flag of `gcloud compute network-firewall-policies rules` to beta.
* Promoted `--dest-network-scope` flag of `gcloud compute network-firewall-policies rules` to beta.

### GKE Hub

* Modified `gcloud beta container fleet memberships update` to call gkehub API version v1beta instead of v1beta1.
* Modified `gcloud beta container fleet memberships create` to call gkehub API version v1beta instead of v1beta1.

### Migrate to Virtual Machines

* Promoted `gcloud migration vms image-imports` commands to GA.

### Network Security

* Simplified the `network-security mirroring-deployment-groups create` command by accepting just the `networkID` for network specification.
* Changed subflags for `--threat-prevention-policy` in `network-security security-profile-groups create` and `update` from `--security-profile-organization` and `--security-profile-location` to the more consistent `--threat-prevention-profile-organization` and `--threat-prevention-profile-location`, while keeping the old flags as well for backwards compatibility.

### Recaptcha

* Update reCAPTCHA Express support in CreateKey API.

### Security Command Center

* Modified `gcloud scc sources describe` to accept parent (organization|folder|project) as positional argument instead of only organization.


Subscribe to these release notes at [https://groups.google.com/forum/#!forum/google-cloud-sdk-announce](https://groups.google.com/forum/#!forum/google-cloud-sdk-announce).


## 492.0.0 (2024-09-10)

### Anthos Multi-Cloud
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def GetApiClientForTrack(release_track):
api_version = APPENGINE_VERSIONS_MAP[release_track]
return AppengineApiClient.GetApiClient(api_version)

gen1_runtimes = ['python27']


class AppengineApiClient(appengine_api_client_base.AppengineApiClientBase):
"""Client used by gcloud to communicate with the App Engine API."""
Expand Down Expand Up @@ -850,3 +852,88 @@ def UpdateDatabaseType(self, database_type):

return operations_util.WaitForOperation(self.client.apps_operations,
operation)

def CheckGen1AppId(self, service_name, project_id):
"""Checks if the service contains a Gen1 app.
Args:
service_name: str, The service name
project_id: str, The project id
Returns:
boolean, True if the service contains a Gen1 app, False otherwise
"""
request = self.messages.AppengineAppsServicesMigrationCheckGen1appIdRequest(
name=self._GetServiceRelativeName(service_name),
checkGen1AppIdRequest=self.messages.CheckGen1AppIdRequest(
projectId=project_id
),
)
return self.client.apps_services_migration.CheckGen1appId(request)

def MigrateConfigYaml(
self, project_id, config_as_string, runtime, service_name
):
"""Migrates the app.yaml file provided by the user to be Gen2 compatible.
Args:
project_id: str, The project id
config_as_string: str, The config as a string
runtime: str, The runtime
service_name: str, The service name
Returns:
str, The migrated config as a string
"""
if runtime in gen1_runtimes:
runtime_enum = (
self.messages.MigrateConfigYamlRequest.RuntimeValueValuesEnum.GEN1_PYTHON27
)
else:
runtime_enum = (
self.messages.MigrateConfigYamlRequest.RuntimeValueValuesEnum.MIGRATION_ASSIST_RUNTIME_UNSPECIFIED
)
req = self.messages.AppengineAppsServicesMigrationMigrateConfigYamlRequest(
name=self._GetServiceRelativeName(service_name),
migrateConfigYamlRequest=self.messages.MigrateConfigYamlRequest(
projectId=project_id,
configAsString=config_as_string,
runtime=runtime_enum,
),
)
return self.client.apps_services_migration.MigrateConfigYaml(req)

def MigrateCodeFile(self, project_id, code_as_string, runtime, service_name):
"""Migrates the code file provided by the user to Gen2 runtime.
Args:
project_id: str, The project id
code_as_string: str, The code as a string
runtime: str, The runtime
service_name: str, The service name
Returns:
Long running operation
"""
if runtime in gen1_runtimes:
runtime_enum = (
self.messages.MigrateCodeFileRequest.RuntimeValueValuesEnum.GEN1_PYTHON27
)
else:
runtime_enum = (
self.messages.MigrateCodeFileRequest.RuntimeValueValuesEnum.MIGRATION_ASSIST_RUNTIME_UNSPECIFIED
)
request = (
self.messages.AppengineAppsServicesMigrationMigrateCodeFileRequest(
name=self._GetServiceRelativeName(service_name),
migrateCodeFileRequest=self.messages.MigrateCodeFileRequest(
projectId=project_id,
codeAsString=code_as_string,
runtime=runtime_enum,
),
)
)
operation = self.client.apps_services_migration.MigrateCodeFile(request)
return operations_util.WaitForOperation(
self.client.apps_operations, operation
)
48 changes: 14 additions & 34 deletions google-cloud-sdk/lib/googlecloudsdk/api_lib/assured/message_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,9 @@
from googlecloudsdk.api_lib.assured import util
from googlecloudsdk.calliope import base as calliope_base
from googlecloudsdk.command_lib.util.apis import arg_utils
from googlecloudsdk.generated_clients.apis.assuredworkloads.v1 import assuredworkloads_v1_messages
from googlecloudsdk.generated_clients.apis.assuredworkloads.v1beta1 import assuredworkloads_v1beta1_messages

ReleaseTrack = calliope_base.ReleaseTrack

V1ComplianceRegimes = (
assuredworkloads_v1_messages.GoogleCloudAssuredworkloadsV1Workload.ComplianceRegimeValueValuesEnum
)
V1beta1ComplianceRegimes = (
assuredworkloads_v1beta1_messages.GoogleCloudAssuredworkloadsV1beta1Workload.ComplianceRegimeValueValuesEnum
)

compliance_regimes_enum = {
ReleaseTrack.GA: V1ComplianceRegimes,
ReleaseTrack.BETA: V1beta1ComplianceRegimes,
ReleaseTrack.ALPHA: V1beta1ComplianceRegimes,
}

V1Partners = (
assuredworkloads_v1_messages.GoogleCloudAssuredworkloadsV1Workload.PartnerValueValuesEnum
)
V1beta1Partners = (
assuredworkloads_v1beta1_messages.GoogleCloudAssuredworkloadsV1beta1Workload.PartnerValueValuesEnum
)

partners_enum = {
ReleaseTrack.GA: V1Partners,
ReleaseTrack.BETA: V1beta1Partners,
ReleaseTrack.ALPHA: V1beta1Partners,
}


def GetMessages(release_track):
return util.GetMessagesModule(release_track)
Expand All @@ -61,6 +33,14 @@ def GetWorkloadMessage(release_track):
return WORKLOAD_MAP.get(release_track)


def GetComplianceRegimesEnum(release_track):
return GetWorkloadMessage(release_track).ComplianceRegimeValueValuesEnum


def GetPartnersEnum(release_track):
return GetWorkloadMessage(release_track).PartnerValueValuesEnum


def GetKmsSettings(release_track):
return KMS_SETTINGS_MAP.get(release_track)

Expand Down Expand Up @@ -146,11 +126,11 @@ def CreateAssuredWorkload(
workload.labels = CreateLabels(labels, workload_message)
if compliance_regime:
workload.complianceRegime = arg_utils.ChoiceToEnum(
compliance_regime, compliance_regimes_enum[release_track]
compliance_regime, GetComplianceRegimesEnum(release_track)
)
if partner:
workload.partner = arg_utils.ChoiceToEnum(
partner, partners_enum[release_track]
partner, GetPartnersEnum(release_track)
)
if partner_services_billing_account:
workload.partnerServicesBillingAccount = partner_services_billing_account
Expand Down Expand Up @@ -374,7 +354,7 @@ def CreateAcknowledgeRequest(

WORKLOAD_MAP = {
ReleaseTrack.ALPHA: GetMessages(
ReleaseTrack.ALPHA
ReleaseTrack.BETA
).GoogleCloudAssuredworkloadsV1beta1Workload,
ReleaseTrack.BETA: GetMessages(
ReleaseTrack.BETA
Expand All @@ -386,7 +366,7 @@ def CreateAcknowledgeRequest(

KMS_SETTINGS_MAP = {
ReleaseTrack.ALPHA: GetMessages(
ReleaseTrack.ALPHA
ReleaseTrack.BETA
).GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings,
ReleaseTrack.BETA: GetMessages(
ReleaseTrack.BETA
Expand All @@ -398,7 +378,7 @@ def CreateAcknowledgeRequest(

RESOURCE_SETTINGS_MAP = {
ReleaseTrack.ALPHA: GetMessages(
ReleaseTrack.ALPHA
ReleaseTrack.BETA
).GoogleCloudAssuredworkloadsV1beta1WorkloadResourceSettings,
ReleaseTrack.BETA: GetMessages(
ReleaseTrack.BETA
Expand All @@ -410,7 +390,7 @@ def CreateAcknowledgeRequest(

PARTNER_PERMISSIONS_MAP = {
ReleaseTrack.ALPHA: GetMessages(
ReleaseTrack.ALPHA
ReleaseTrack.BETA
).GoogleCloudAssuredworkloadsV1beta1WorkloadPartnerPermissions,
ReleaseTrack.BETA: GetMessages(
ReleaseTrack.BETA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
"""colab-enterprise runtime-templates api helper."""

from googlecloudsdk.calliope import exceptions
from googlecloudsdk.command_lib.iam import iam_util
from googlecloudsdk.command_lib.util.apis import arg_utils
from googlecloudsdk.core import resources
Expand Down Expand Up @@ -120,18 +121,22 @@ def GetPersistentDiskSpecFromArgs(args, messages):
Persistent disk spec config for the runtime template.
"""
# Keep the string input, disk type is not represented as an enum in API.
disk_type = None
disk_size = None
persistent_disk_spec_config = (
messages.GoogleCloudAiplatformV1beta1PersistentDiskSpec
)
if args.IsSpecified('disk_type'):
disk_type = FormatDiskTypeForApiRequest(args.disk_type)
if args.IsSpecified('disk_size_gb'):
disk_size = args.disk_size_gb
return persistent_disk_spec_config(
diskType=disk_type, diskSizeGb=disk_size
)
return persistent_disk_spec_config(
diskType=disk_type, diskSizeGb=args.disk_size_gb
)
# Match API requirement that disk type must be specified when disk size is,
# instead of silently using the default stored in args.disk_type.
elif args.IsSpecified('disk_size_gb'):
raise exceptions.RequiredArgumentException(
'--disk-type',
'Disk type must be specified when disk size is specified.',
)
return None


def GetNetworkSpecFromArgs(args, messages):
Expand Down
Loading

0 comments on commit ab29636

Please sign in to comment.