Skip to content

Commit 49de7f5

Browse files
authored
Sync main nov 10 feature branch resource identity (#15673)
2 parents 00f4e18 + cb9ae56 commit 49de7f5

File tree

414 files changed

+16934
-3531
lines changed

Some content is hidden

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

414 files changed

+16934
-3531
lines changed

.ci/infra/terraform/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,5 @@ Quotas that will need to be adjusted to support all tests:
7474
- compute.googleapis.com/n2_cpus (us-central1) to 36+
7575
- VMware Engine standard 72 vCPUs nodes per region - southamerica-east1 to 21
7676
- logging.googleapis.com/log_buckets_count to 200
77+
- "Reasoning engine write requests per minute" for us-central1 to 20+
78+
- aiplatform.googleapis.com/in_use_customer_managed_encryption_keys to 5+

.ci/infra/terraform/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ module "project-services" {
235235
"binaryauthorization.googleapis.com",
236236
"blockchainnodeengine.googleapis.com",
237237
"certificatemanager.googleapis.com",
238+
"ces.googleapis.com",
238239
"chronicle.googleapis.com",
239240
"cloudaicompanion.googleapis.com",
240241
"cloudapis.googleapis.com",

.ci/magician/cmd/collect_nightly_test_status.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type TestInfo struct {
4242
Name string `json:"name"`
4343
Status string `json:"status"`
4444
Service string `json:"service"`
45+
Resource string `json:"resource"`
4546
ErrorMessage string `json:"error_message"`
4647
LogLink string `json:"log_link"`
4748
ProviderVersion string `json:"provider_version"`
@@ -187,6 +188,7 @@ func createTestReport(pVersion provider.Version, tc TeamcityClient, gcs Cloudsto
187188
Name: testResult.Name,
188189
Status: testResult.Status,
189190
Service: serviceName,
191+
Resource: convertTestNameToResource(testResult.Name),
190192
ErrorMessage: errorMessage,
191193
LogLink: logLink,
192194
ProviderVersion: strings.ToUpper(pVersion.String()),

.ci/magician/cmd/create_test_failure_ticket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func lastNDaysTestFailureMap(pVersion provider.Version, n int, now time.Time, gc
200200
if _, ok := testFailuresToday[testName]; !ok {
201201
testFailuresToday[testName] = &testFailure{
202202
TestName: testName,
203-
AffectedResource: convertTestNameToResource(testName),
203+
AffectedResource: testInfo.Resource,
204204
ErrorMessageLinks: map[provider.Version]string{provider.GA: "", provider.Beta: ""},
205205
DebugLogLinks: map[provider.Version]string{provider.GA: "", provider.Beta: ""},
206206
FailureRates: map[provider.Version]string{provider.GA: "N/A", provider.Beta: "N/A"},

docs/content/convert/add-new-resource-tgc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export WRITE_FILES=true
232232
To run the unit tests locally, run the following from the root of the `terraform-google-conversion` repository:
233233

234234
```
235-
make test
235+
make test-local
236236
```
237237

238238
#### Run integration tests

docs/content/develop/set-up-dev-environment.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ development environment.
3434
# Add Go binaries to PATH
3535
export PATH=$PATH:$(go env GOPATH)/bin
3636
```
37-
1. Install goimports
38-
```bash
39-
go install golang.org/x/tools/cmd/goimports@latest
40-
```
4137
1. [Install terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)
4238
1. Clone the `magic-modules` repository
4339
```bash
@@ -57,8 +53,6 @@ development environment.
5753
```
5854
Check for go in path...
5955
found!
60-
Check for goimports in path...
61-
found!
6256
Check for git in path...
6357
found!
6458
Check for terraform in path...

docs/content/reference/metadata.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ The version of the API used for this resource e.g., "v2".
3131

3232
The API "resource type kind" used for this resource e.g., "Function".
3333

34+
### `cai_asset_name_format`
35+
36+
The custom CAI asset name format for this resource is typically specified (e.g., //cloudsql.googleapis.com/projects/{{project}}/instances/{{name}}). If this format is not provided, the Terraform resource ID format is used instead.
37+
3438
### `api_variant_patterns`
3539

3640
The API URL patterns used by this resource that represent variants e.g., "folders/{folder}/feeds/{feed}". Each pattern must match the value defined in the API exactly. The use of `api_variant_patterns` is only meaningful when the resource type has multiple parent types available.

mmv1/api/async.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"strings"
1919

2020
"golang.org/x/exp/slices"
21+
"gopkg.in/yaml.v3"
2122
)
2223

2324
// Base class from which other Async classes can inherit.
@@ -109,12 +110,12 @@ type PollAsync struct {
109110
TargetOccurrences int `yaml:"target_occurrences,omitempty"`
110111
}
111112

112-
func (a *Async) UnmarshalYAML(unmarshal func(any) error) error {
113+
func (a *Async) UnmarshalYAML(value *yaml.Node) error {
113114
a.Actions = []string{"create", "delete", "update"}
114115
type asyncAlias Async
115116
aliasObj := (*asyncAlias)(a)
116117

117-
err := unmarshal(aliasObj)
118+
err := value.Decode(aliasObj)
118119
if err != nil {
119120
return err
120121
}

mmv1/api/compiler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import (
2323

2424
func Compile(yamlPath string, obj interface{}, overrideDir string) {
2525
objYaml, err := os.ReadFile(yamlPath)
26+
2627
if err != nil {
27-
log.Fatalf("Cannot open the file: %v", objYaml)
28+
log.Fatalf("Cannot open the file: %s", yamlPath)
2829
}
2930

3031
if overrideDir != "" {

mmv1/api/product.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/GoogleCloudPlatform/magic-modules/mmv1/api/product"
2525
"github.com/GoogleCloudPlatform/magic-modules/mmv1/google"
2626
"golang.org/x/exp/slices"
27+
"gopkg.in/yaml.v3"
2728
)
2829

2930
// Represents a product to be managed
@@ -34,6 +35,9 @@ type Product struct {
3435
// Example inputs: "Compute", "AccessContextManager"
3536
Name string
3637

38+
// This is the name of the package path relative to mmv1 root repo
39+
PackagePath string
40+
3741
// original value of :name before the provider override happens
3842
// same as :name if not overridden in provider
3943
ApiName string `yaml:"api_name,omitempty"`
@@ -58,6 +62,9 @@ type Product struct {
5862
// base URL. Specific to defining the resource as a CAI asset.
5963
CaiBaseUrl string
6064

65+
// The service name from CAI asset name, e.g. bigtable.googleapis.com.
66+
CaiAssetService string `yaml:"cai_asset_service,omitempty"`
67+
6168
// CaiResourceType of resources that already have an AssetType constant defined in the product.
6269
ResourcesWithCaiAssetType map[string]struct{}
6370

@@ -77,11 +84,11 @@ type Product struct {
7784
Compiler string `yaml:"-"`
7885
}
7986

80-
func (p *Product) UnmarshalYAML(unmarshal func(any) error) error {
87+
func (p *Product) UnmarshalYAML(value *yaml.Node) error {
8188
type productAlias Product
8289
aliasObj := (*productAlias)(p)
8390

84-
if err := unmarshal(aliasObj); err != nil {
91+
if err := value.Decode(aliasObj); err != nil {
8592
return err
8693
}
8794

0 commit comments

Comments
 (0)