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

Switch the repository to xpkg.upbound.io/crossplane-contrib to install the crossplane providers #475

Merged
merged 24 commits into from
May 3, 2024

Conversation

cmoulliard
Copy link
Contributor

@cmoulliard cmoulliard commented May 2, 2024

@cmoulliard
Copy link
Contributor Author

cmoulliard commented May 2, 2024

There is now another issue

./scripts/data/bind_application.sh application_name=atomic-fruits claim_name=fruits-claim
  shell: /usr/bin/bash -e {0}
  env:
    PSEUDO_TTY: false
    JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.10-7/x6[4](https://github.com/halkyonio/primaza-poc/actions/runs/8923233395/job/24507035138?pr=475#step:13:4)
    JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.10-7/x64
    KIND_REGISTRY: kind-registry:[5](https://github.com/halkyonio/primaza-poc/actions/runs/8923233395/job/24507035138?pr=475#step:13:5)000
    PRIMAZA_URL: primaza.127.0.0.1.nip.io
    PRIMAZA_NAMESPACE: primaza
NOTE: Searching about the application to be bound ...
NOTE: curl -H 'Accept: application/json' -s primaza.12[7](https://github.com/halkyonio/primaza-poc/actions/runs/8923233395/job/24507035138?pr=475#step:13:7).0.0.1.nip.io/applications/name/atomic-fruits
NOTE: Application ID to be bound: 1
NOTE: Searching about the claim ...
NOTE: Claim ID to be bound: 1
NOTE: curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d "claimId=1" -s -i primaza.[12](https://github.com/halkyonio/primaza-poc/actions/runs/8923233395/job/24507035138?pr=475#step:13:13)7.0.0.1.nip.io/applications/claim/1
ERROR: Application failed to be bound in Primaza: 500 Internal Server Error
Error: Process completed with exit code 1.

due to

Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:358)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:273)
	at org.postgresql.Driver.makeConnection(Driver.java:446)
	at org.postgresql.Driver.connect(Driver.java:298)
	at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:225)
	at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:545)
	at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:526)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	... 1 more
Caused by: java.net.UnknownHostException: fruits-app-db
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:572)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
	at java.base/java.net.Socket.connect(Socket.java:633)
	at org.postgresql.core.PGStream.createSocket(PGStream.java:243)
	at org.postgresql.core.PGStream.<init>(PGStream.java:98)
	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:136)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:262)
	... 12 more

If I replay the scenario locally I discover that the db is not installed by crossplane as the script ./scripts/data/bind_application.sh application_name=atomic-fruits claim_name=fruits-claim reports an error HTTP 500

Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class io.crossplane.helm.v1beta1.ReleaseSpec$ManagementPolicies (java.lang.String is in module java.base of loader 'b
ootstrap'; io.crossplane.helm.v1beta1.ReleaseSpec$ManagementPolicies is in unnamed module of loader io.quarkus.bootstrap.runner.RunnerClassLoader @475530b9)
    at io.crossplane.helm.v1beta1.ReleaseSpecFluent.withManagementPolicies(ReleaseSpecFluent.java:337)
    at io.crossplane.helm.v1beta1.ReleaseSpecFluent.copyInstance(ReleaseSpecFluent.java:57)
    at io.crossplane.helm.v1beta1.ReleaseSpecBuilder.<init>(ReleaseSpecBuilder.java:15)
    at io.crossplane.helm.v1beta1.ReleaseFluent$SpecNested.<init>(ReleaseFluent.java:232)
    at io.crossplane.helm.v1beta1.ReleaseFluent.withNewSpec(ReleaseFluent.java:101)
    at io.halkyon.services.KubernetesClientService.createCrossplaneHelmRelease(KubernetesClientService.java:247)

Code:

release.withApiVersion("helm.crossplane.io").withKind("v1beta1").withNewMetadata().withName(service.helmChart)

Here is the java code generated by dekorate

    public enum ManagementPolicies {

        @com.fasterxml.jackson.annotation.JsonProperty("Observe")
        OBSERVE("Observe"),
        @com.fasterxml.jackson.annotation.JsonProperty("Create")
        CREATE("Create"),
        @com.fasterxml.jackson.annotation.JsonProperty("Update")
        UPDATE("Update"),
        @com.fasterxml.jackson.annotation.JsonProperty("Delete")
        DELETE("Delete"),
        @com.fasterxml.jackson.annotation.JsonProperty("LateInitialize")
        LATEINITIALIZE("LateInitialize"),
        @com.fasterxml.jackson.annotation.JsonProperty("*")
        __("*");

        java.lang.String value;

        ManagementPolicies(java.lang.String value) {
            this.value = value;
        }

        @com.fasterxml.jackson.annotation.JsonValue()
        public java.lang.String getValue() {
            return value;
        }
    }

I dont really understand why it complains about the ManagementPolicies - https://github.com/crossplane/crossplane-runtime/blob/master/apis/common/v1/policies.go as the object that we are creating which is a Release do not include it: https://github.com/crossplane-contrib/provider-helm/blob/master/apis/release/v1beta1/types.go

@aureamunoz

cmoulliard added 14 commits May 2, 2024 14:15
…ch is generating the error: String cannot be cast to class io.crossplane.helm.v1beta1.ReleaseSpec

Signed-off-by: cmoulliard <[email protected]>
Signed-off-by: cmoulliard <[email protected]>
Signed-off-by: cmoulliard <[email protected]>
@cmoulliard cmoulliard requested a review from aureamunoz May 3, 2024 11:18
Copy link
Contributor

@aureamunoz aureamunoz left a comment

Choose a reason for hiding this comment

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

LGTM

@aureamunoz
Copy link
Contributor

It would be nice to squash all commits ;-)

@aureamunoz aureamunoz mentioned this pull request May 3, 2024
@cmoulliard cmoulliard merged commit ebe3424 into halkyonio:main May 3, 2024
4 checks passed
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