Skip to content

Commit

Permalink
Fixes for eap in the go engine (#11841)
Browse files Browse the repository at this point in the history
  • Loading branch information
c2thorn committed Sep 26, 2024
1 parent 9d2f533 commit 49eb7bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion mmv1/api/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ func Merge(self, otherObj reflect.Value) {

// skip if the override is the "empty" value
emptyOverrideValue := reflect.DeepEqual(reflect.Zero(otherObj.Field(i).Type()).Interface(), otherObj.Field(i).Interface())
if emptyOverrideValue {

if emptyOverrideValue && selfObj.Type().Field(i).Name != "Required" {
continue
}

Expand Down
6 changes: 5 additions & 1 deletion mmv1/api/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1618,9 +1618,13 @@ func (r Resource) TestExamples() []resource.Examples {
}

func (r Resource) VersionedProvider(exampleVersion string) bool {
vp := r.MinVersion
var vp string
if exampleVersion != "" {
vp = exampleVersion
} else if r.MinVersion == "" {
vp = r.ProductMetadata.lowestVersion().Name
} else {
vp = r.MinVersion
}
return vp != "" && vp != "ga"
}
Expand Down
7 changes: 1 addition & 6 deletions mmv1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var outputPath = flag.String("output", "", "path to output generated files to")
// Example usage: --version beta
var version = flag.String("version", "", "optional version name. If specified, this version is preferred for resource generation when applicable")

var overrideDirectory = flag.String("override", "", "directory containing yaml overrides")
var overrideDirectory = flag.String("overrides", "", "directory containing yaml overrides")

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.")

Expand Down Expand Up @@ -282,11 +282,6 @@ func GenerateProduct(productChannel chan string, providerToGenerate provider.Pro
continue
}

// Prepend "go_" to the Go yaml files' name to distinguish with the ruby yaml files
if filepath.Base(overrideYamlPath) == "go_product.yaml" || !strings.HasPrefix(filepath.Base(overrideYamlPath), "go_") {
continue
}

resource := &api.Resource{}

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

0 comments on commit 49eb7bf

Please sign in to comment.