|
4 | 4 | import java.util.Collections; |
5 | 5 | import java.util.HashSet; |
6 | 6 | import java.util.Map; |
| 7 | +import java.util.Objects; |
7 | 8 | import java.util.Optional; |
8 | 9 | import java.util.Set; |
9 | 10 | import java.util.function.BooleanSupplier; |
|
64 | 65 | import io.quarkus.gizmo.ResultHandle; |
65 | 66 | import io.quarkus.kubernetes.client.spi.KubernetesClientBuildItem; |
66 | 67 | import io.quarkus.kubernetes.spi.DecoratorBuildItem; |
67 | | -import io.quarkus.runtime.Quarkus; |
68 | 68 | import io.quarkus.runtime.QuarkusApplication; |
69 | 69 | import io.quarkus.runtime.metrics.MetricsFactory; |
70 | 70 |
|
@@ -136,6 +136,10 @@ void updateControllerConfigurations( |
136 | 136 | } |
137 | 137 |
|
138 | 138 | private void checkVersionCompatibility(String found, String expected, String name) { |
| 139 | + // optimize most common case |
| 140 | + if(Objects.equals(found, expected)) { |
| 141 | + return; |
| 142 | + } |
139 | 143 | final var foundVersionOpt = getSemverFrom(found); |
140 | 144 | final var expectedVersionOpt = getSemverFrom(expected); |
141 | 145 | if (foundVersionOpt.isEmpty() || expectedVersionOpt.isEmpty()) { |
@@ -185,7 +189,7 @@ ConfigurationServiceBuildItem createConfigurationServiceAndOperator( |
185 | 189 | // check versions alignment |
186 | 190 | final var version = Version.loadFromProperties(); |
187 | 191 | versionBuildItemBuildProducer.produce(new VersionBuildItem(version)); |
188 | | - final var runtimeQuarkusVersion = Quarkus.class.getPackage().getImplementationVersion(); |
| 192 | + final var runtimeQuarkusVersion = io.quarkus.builder.Version.getVersion(); |
189 | 193 | checkVersionCompatibility(runtimeQuarkusVersion, version.getQuarkusVersion(), "Quarkus"); |
190 | 194 | final var runtimeFabric8Version = io.fabric8.kubernetes.client.Version.clientVersion(); |
191 | 195 | checkVersionCompatibility(runtimeFabric8Version, version.getKubernetesClientVersion(), |
|
0 commit comments