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

Consistent/expanded usage of the resource term #3994

Merged
merged 2 commits into from
Mar 25, 2022

Conversation

shawkins
Copy link
Contributor

Description

This implements #3973, it is layered on top of the changes for #3875 to minimize conflicts - so only the last commit is of interest and this will get rebased prior to inclusion.

The change here is instead of withItem, we'll use resource, then instead getResources off of a resourceList, we'll use resources, and finally there's the addition of a convenience method resources, which serves the same purpose as the resourceList method.

This requires making watchlistdeletable more generic as we need the resource type. It also makes podresource non-generic as that is not needed.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@shawkins shawkins added the wip label Mar 23, 2022
@shawkins shawkins force-pushed the resource branch 3 times, most recently from f25b2f1 to 70d2923 Compare March 24, 2022 16:52
@shawkins shawkins removed the wip label Mar 24, 2022
@shawkins shawkins marked this pull request as ready for review March 24, 2022 16:52
@shawkins
Copy link
Contributor Author

Marking as ready for review now that the non-static changes are in.

@@ -1011,4 +1012,9 @@ public static URL appendListOptionParams(URL base, ListOptions listOptions) {
return urlBuilder.build();
}

@Override
public Stream<R> resources() {
return list().getItems().stream().map(this::resource);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of the map/peek? It will set the last listed item as the current item.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map does not perform a peek, it will convert from a stream of HasMetadata to a stream of Resources

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, GH interface is playing dirty again.

@@ -0,0 +1,15 @@
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks unintentional. I'll back that out as this file is going away in the other pr.

resource

# Conflicts:
#	kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/ResourceTest.java
@sonarcloud
Copy link

sonarcloud bot commented Mar 25, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

25.7% 25.7% Coverage
1.6% 1.6% Duplication

@manusa manusa added this to the 6.0.0 milestone Mar 25, 2022
@manusa manusa merged commit bb9a613 into fabric8io:master Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants