Compare commits

..

No commits in common. "main" and "1.18.0-alpha" have entirely different histories.

10 changed files with 7 additions and 68 deletions

View File

@ -11,12 +11,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* Class that helps with the extra resources map and also to create ResourceSelector in order to get extra resources
* to the function
@ -58,39 +56,6 @@ public class CrossplaneExtraResourcesService {
return result;
}
public Map<String, String> getConnectionDetails(Map<String, Resources> extraResources, String resourceName) {
List<Map<String, String>> resources = getConnectionDetails(extraResources, resourceName, 1);
if (resources.isEmpty()) {
return new HashMap<>();
}
return resources.get(0);
}
public List<Map<String, String>> getConnectionDetails(Map<String, Resources> extraResources, String resourceName, int expectedResources) {
List<Map<String, String>> result = new ArrayList<>();
Resources resources = extraResources.get(resourceName);
if (resources != null && resources.getItemsCount() == expectedResources) {
for (int i = 0; i < expectedResources; i++) {
try {
logger.debug("We have connectiondetails " + resourceName);
Map<String, String> currentDetails = new HashMap<>();
resources.getItems(i).getConnectionDetailsMap().forEach((key, value) ->
currentDetails.put(key, value.toStringUtf8())
);
result.add(currentDetails);
} catch (Exception e) {
throw new CrossplaneUnmarshallException("Error when unmarshalling the connectionDetails", e);
}
}
}
return result;
}
public Map<String, ResourceSelector> createExtraResourcesSelector(String resourceName, HasMetadata type) {
ResourceSelector resourceSelector = ResourceSelector.newBuilder()
.setApiVersion(type.getApiVersion())

View File

@ -9,8 +9,6 @@ import io.fabric8.kubernetes.client.utils.Serialization;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
@ -44,22 +42,4 @@ public class CrossplaneObservableService {
return result;
}
public Map<String, String> getObservableConnectionDetails(String resourceName, State observedState) {
Resource observedResource = observedState.getResourcesOrDefault(resourceName, null);
Map<String, String> result = new HashMap<>();
if (observedResource != null) {
try {
logger.debug("We have an observed connectionDetails for " + resourceName);
observedResource.getConnectionDetailsMap().forEach((key, value) ->
result.put(key, value.toStringUtf8())
);
} catch (Exception e) {
throw new CrossplaneUnmarshallException("Error when unmarshalling the connectionDetails for " + resourceName, e);
}
}
return result;
}
}

View File

@ -28,7 +28,6 @@
<central-publishing-maven-plugin.version>0.4.0</central-publishing-maven-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.7.0</maven-javadoc-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-gpg-plugin.version>3.2.4</maven-gpg-plugin.version>
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
</properties>
@ -107,11 +106,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.18.0-charlie</version>
<version>1.17.0-charlie</version>
</parent>
<artifactId>crossplane-provider-kubernetes-model</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.18.0-charlie</version>
<version>1.17.0-charlie</version>
</parent>
<artifactId>crossplane-provider-terraform-model</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.18.0-charlie</version>
<version>1.17.0-charlie</version>
</parent>
<artifactId>crossplane-provider-upjet-aws-model</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.18.0-charlie</version>
<version>1.17.0-charlie</version>
</parent>
<artifactId>crossplane-provider-upjet-azure-model</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.18.0-charlie</version>
<version>1.17.0-charlie</version>
</parent>
<artifactId>crossplane-provider-upjet-azuread-model</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.18.0-charlie</version>
<version>1.17.0-charlie</version>
</parent>
<artifactId>crossplane-provider-upjet-gcp-model</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.crossplane.providers</groupId>
<artifactId>crossplane-providers-parent</artifactId>
<version>1.18.0-charlie</version>
<version>1.17.0-charlie</version>
</parent>
<artifactId>crossplane-provider-upjet-github-model</artifactId>