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 Jan 21, 2025
1 parent 3e2b4e4 commit 06661d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions schema/generate_scaler_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ func aggregateSchemaStruct(scalerSelectors map[string]string, kedaScalerStructs
}
sort.Strings(sortedScalerCreatorNames)

sortedScalerNames := []string{}
for k := range scalerSelectors {
sortedScalerNames = append(sortedScalerNames, k)
}
sort.Strings(sortedScalerNames)

for _, creatorName := range sortedScalerCreatorNames {
metadataFields := generateMetadataFields(kedaScalerStructs[creatorName], otherReferenceKedaTagStructs)
if len(metadataFields) == 0 {
Expand All @@ -127,8 +133,8 @@ func aggregateSchemaStruct(scalerSelectors map[string]string, kedaScalerStructs
}

// Find which scaler names the creator is called by and construct the metadata schema
for scalerName, selectorName := range scalerSelectors {
if selectorName == creatorName {
for _, scalerName := range sortedScalerNames {
if scalerSelectors[scalerName] == creatorName {
scalerMetadataSchema := ScalerMetadataSchema{}
scalerMetadataSchema.Type = scalerName
scalerMetadataSchema.Metadata = metadataFields
Expand Down

0 comments on commit 06661d5

Please sign in to comment.