Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #3628 removing sorting from lists and templates #3905

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/MIGRATION-v6.md
Expand Up @@ -4,6 +4,7 @@
- [API/Impl split](#api-impl-split)
- [Deprecation Removals](#deprecation-removals)
- [IntOrString changes](#intorstring-changes)
- [Object sorting](#object-sorting)

## API/Impl split

Expand Down Expand Up @@ -64,3 +65,7 @@ We've removed setter methods `setIntVal`, `setKind`, `setStrVal` from the class.
IntOrString i2 = new IntOrString("3000");
String strValue = i2.getStrVal();
```

## Object Sorting

KubernetesList and Template will no longer automatically sort their objects by default. You may use the HasMetadataComparator to sort the items as needed.
Expand Up @@ -182,8 +182,8 @@ void testResourceListCreateOrReplace() throws IOException {

// Then
verify(mockClient, times(2)).send(any(), any());
assertRequest("POST", "/api/v1/namespaces/ns1/services", "dryRun=All");
assertRequest(1, "POST", "/api/v1/namespaces/ns1/pods", "dryRun=All");
assertRequest("POST", "/api/v1/namespaces/ns1/pods", "dryRun=All");
assertRequest(1, "POST", "/api/v1/namespaces/ns1/services", "dryRun=All");
}

@Test
Expand All @@ -197,8 +197,8 @@ void testResourceListDelete() throws IOException {

// Then
verify(mockClient, times(2)).send(any(), any());
assertRequest("DELETE", "/api/v1/namespaces/ns1/services/svc1", "dryRun=All");
assertRequest(1, "DELETE", "/api/v1/namespaces/ns1/pods/pod1", "dryRun=All");
assertRequest("DELETE", "/api/v1/namespaces/ns1/pods/pod1", "dryRun=All");
assertRequest(1, "DELETE", "/api/v1/namespaces/ns1/services/svc1", "dryRun=All");
}

private Pod getPod(String name) {
Expand Down
Expand Up @@ -71,8 +71,6 @@ public String getApiVersion() {

@Override
public List<HasMetadata> getItems() {
List<HasMetadata> sortedItems = new ArrayList<>(super.getItems());
Collections.sort(sortedItems, new HasMetadataComparator());
return sortedItems;
return super.getItems();
}
}
manusa marked this conversation as resolved.
Show resolved Hide resolved
19 changes: 0 additions & 19 deletions kubernetes-model-generator/openshift-model/pom.xml
Expand Up @@ -99,25 +99,6 @@
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target>
<echo>Removing the duplicate generated class</echo>
<delete
file="${generate.targetDirectory}/io/fabric8/openshift/api/model/Template.java"
verbose="true" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down