Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: SpiritZhou <[email protected]>
  • Loading branch information
SpiritZhou committed Feb 6, 2025
1 parent dcbdc45 commit e6f0a0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,5 @@ validate-changelog: ## Validate changelog

.PHONY: generate-scaler-schemas
generate-scaler-schemas: ## Generate scaler shcemas
GOBIN=$(LOCALBIN) go run ./schema/generate_scaler_schema.go --keda-version $(VERSION) --scalers-builder-file $(SCALERS_BUILDER_FILE) --scalers-files-dir $(SCALERS_FILES_DIR) --output-file-path $(OUTPUT_FILE_PATH)
GOBIN=$(LOCALBIN) go run ./schema/generate_scaler_schema.go --keda-version $(VERSION) --scalers-builder-file $(SCALERS_BUILDER_FILE) --scalers-files-dir $(SCALERS_FILES_DIR) --output-file-path $(OUTPUT_FILE_PATH)

8 changes: 5 additions & 3 deletions schema/generate_scaler_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,19 @@ func aggregateSchemaStruct(scalerSelectors map[string]string, kedaScalerStructs
}

filedata := []byte{}
if outputFileFormat == "yaml" {

switch outputFileFormat {
case "yaml":
filedata, err = yaml.Marshal(fullMetadataSchema)
if err != nil {
return err
}
} else if outputFileFormat == "json" {
case "json":
filedata, err = json.MarshalIndent(fullMetadataSchema, "", " ")
if err != nil {
return err
}
} else {
default:
return fmt.Errorf("output file format %s is not supported", outputFileFormat)
}

Expand Down

0 comments on commit e6f0a0f

Please sign in to comment.