Skip to content

Commit

Permalink
fix(crd-generator): Sort required properties to ensure deterministic …
Browse files Browse the repository at this point in the history
…output
  • Loading branch information
baloo42 committed Apr 25, 2024
1 parent f6c56d5 commit ac2960d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ private T internalFromImpl(TypeDef definition, LinkedHashMap<String, String> vis
.collect(Collectors.toList());

swaps.throwIfUnmatchedSwaps();
return build(builder, required, validationRules, preserveUnknownFields);

List<String> sortedRequiredProperties = required.stream().sorted()
.collect(Collectors.toList());

return build(builder, sortedRequiredProperties, validationRules, preserveUnknownFields);
}

private Map<String, Method> indexPotentialAccessors(TypeDef definition) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,18 @@ spec:
x-kubernetes-validations:
- rule: self.startsWith('simple-')
required:
- minReplicas
- onAttributeAndGetter
- replicas
- deepLevel1
- onAttributeAndClass
- simple
- maxReplicas
- minReplicas
- multiple
- namePrefix
- onAbstractClass
- onAttributeAndClass
- onAttributeAndGetter
- onGetter
- maxReplicas
- priority
- namePrefix
- replicas
- simple
type: object
x-kubernetes-validations:
- fieldPath: .replicas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,18 @@ spec:
x-kubernetes-validations:
- rule: self.startsWith('simple-')
required:
- minReplicas
- onAttributeAndGetter
- replicas
- deepLevel1
- onAttributeAndClass
- simple
- maxReplicas
- minReplicas
- multiple
- namePrefix
- onAbstractClass
- onAttributeAndClass
- onAttributeAndGetter
- onGetter
- maxReplicas
- priority
- namePrefix
- replicas
- simple
type: object
x-kubernetes-validations:
- fieldPath: .replicas
Expand Down

0 comments on commit ac2960d

Please sign in to comment.