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)
772772 @ Override
773773 public boolean isOutdatedCrd (SemanticVersion productVersion , String resourceVersionString ,
774774 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-
784775 // Check product version label
785776 if (productVersion != null ) {
786777 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 ) {
788783 return false ;
784+ } else if (compareToResult > 0 ) {
785+ return true ;
789786 }
790787 }
791788
You can’t perform that action at this time.
0 commit comments