File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
operator/src/main/java/oracle/kubernetes/operator/helpers Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -772,20 +772,17 @@ private static List<ResourceVersion> getVersions(V1CustomResourceDefinition crd)
772
772
@ Override
773
773
public boolean isOutdatedCrd (SemanticVersion productVersion , String resourceVersionString ,
774
774
V1CustomResourceDefinition actual , V1CustomResourceDefinition expected ) {
775
- ResourceVersion current = new ResourceVersion (resourceVersionString );
776
- List <ResourceVersion > actualVersions = getVersions (actual );
777
-
778
- for (ResourceVersion v : actualVersions ) {
779
- if (!isLaterOrEqual (v , current )) {
780
- return false ;
781
- }
782
- }
783
-
784
775
// Check product version label
785
776
if (productVersion != null ) {
786
777
SemanticVersion currentCrdVersion = KubernetesUtils .getProductVersionFromMetadata (actual .getMetadata ());
787
- if (currentCrdVersion == null || productVersion .compareTo (currentCrdVersion ) < 0 ) {
778
+ if (currentCrdVersion == null ) {
779
+ return false ;
780
+ }
781
+ int compareToResult = productVersion .compareTo (currentCrdVersion );
782
+ if (compareToResult < 0 ) {
788
783
return false ;
784
+ } else if (compareToResult > 0 ) {
785
+ return true ;
789
786
}
790
787
}
791
788
You can’t perform that action at this time.
0 commit comments