Skip to content

Commit 49eb7bf

Browse files
authored
Fixes for eap in the go engine (GoogleCloudPlatform#11841)
1 parent 9d2f533 commit 49eb7bf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

mmv1/api/product.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ func Merge(self, otherObj reflect.Value) {
240240

241241
// skip if the override is the "empty" value
242242
emptyOverrideValue := reflect.DeepEqual(reflect.Zero(otherObj.Field(i).Type()).Interface(), otherObj.Field(i).Interface())
243-
if emptyOverrideValue {
243+
244+
if emptyOverrideValue && selfObj.Type().Field(i).Name != "Required" {
244245
continue
245246
}
246247

mmv1/api/resource.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -1618,9 +1618,13 @@ func (r Resource) TestExamples() []resource.Examples {
16181618
}
16191619

16201620
func (r Resource) VersionedProvider(exampleVersion string) bool {
1621-
vp := r.MinVersion
1621+
var vp string
16221622
if exampleVersion != "" {
16231623
vp = exampleVersion
1624+
} else if r.MinVersion == "" {
1625+
vp = r.ProductMetadata.lowestVersion().Name
1626+
} else {
1627+
vp = r.MinVersion
16241628
}
16251629
return vp != "" && vp != "ga"
16261630
}

mmv1/main.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var outputPath = flag.String("output", "", "path to output generated files to")
3030
// Example usage: --version beta
3131
var version = flag.String("version", "", "optional version name. If specified, this version is preferred for resource generation when applicable")
3232

33-
var overrideDirectory = flag.String("override", "", "directory containing yaml overrides")
33+
var overrideDirectory = flag.String("overrides", "", "directory containing yaml overrides")
3434

3535
var product = flag.String("product", "", "optional product name. If specified, the resources under the specific product will be generated. Otherwise, resources under all products will be generated.")
3636

@@ -282,11 +282,6 @@ func GenerateProduct(productChannel chan string, providerToGenerate provider.Pro
282282
continue
283283
}
284284

285-
// Prepend "go_" to the Go yaml files' name to distinguish with the ruby yaml files
286-
if filepath.Base(overrideYamlPath) == "go_product.yaml" || !strings.HasPrefix(filepath.Base(overrideYamlPath), "go_") {
287-
continue
288-
}
289-
290285
resource := &api.Resource{}
291286

292287
baseResourcePath := filepath.Join(productName, filepath.Base(overrideYamlPath))

0 commit comments

Comments
 (0)