spring-cloud / spring-cloud-skipper

A package manager that installs, upgrades, and rolls back Spring Boot applications on multiple Cloud Platforms.
http://cloud.spring.io/spring-cloud-skipper/
Apache License 2.0
111 stars 78 forks source link

Skipper fails with oauth config #1036 #1038

Closed corneil closed 2 years ago

corneil commented 2 years ago

Reduce circular references. Add parameter to allow Spring Configuration to resolve circular references. Added expected exception to test case.

Fixes #1036

jvalkeal commented 2 years ago

This might be a good time to remove these old tests(which are based on legacy oauth libs) and rely on new IT tests which uses a real identity provider.

corneil commented 2 years ago

We found allow-circular-references: true in dataflow as well. I created a reproducer and opened an issue https://github.com/spring-cloud/spring-cloud-common-security-config/issues/89

corneil commented 2 years ago

I don't know why org.springframework.cloud.skipper.deployer.KubernetesPlatformPropertiesTest keeps failing. Running with ./mvnw -B -U clean package locally in WSL2 and on Windows both work fine. I did notice from logs that server also doesn't detect K8s like locally.

onobc commented 2 years ago

I don't know why org.springframework.cloud.skipper.deployer.KubernetesPlatformPropertiesTest keeps failing. Running with ./mvnw -B -U clean package locally in WSL2 and on Windows both work fine. I did notice from logs that server also doesn't detect K8s like locally.

Ok, this reproduces in IDEA - run the single test and you will see the error. I traced it down to parsing of the main application.yml.

Specifically, remove the #Logs comment line and it passes.

OR leave the above in AND then remove the # Logs comment line and it passes.

OR make it look like this and it passes:

            - GET /api/release/manifest/**       => hasRole('ROLE_VIEW')
            # Logs
            - GET /api/release/logs/**           => hasRole('ROLE_VIEW')

OR these work as well:

- GET /api/release/manifest/**       => hasRole('ROLE_VIEW')
# Logs
- GET /api/release/logs/**           => hasRole('ROLE_VIEW')
- GET /api/release/manifest/**       => hasRole('ROLE_VIEW')

# Logs
- GET /api/release/logs/**           => hasRole('ROLE_VIEW')

OR set allow-ciruclar-references to false and it always passes.

I thought it was some weird windows encoding character at first but after digging around it seems like some non-reentrant thing going on w/ circular ref bean load that is causing the parser to trip up on this area for some reason???

Good luck. My gift to you ;)

onobc commented 2 years ago

Closed via https://github.com/spring-cloud/spring-cloud-skipper/commit/8a654b4bfb3c98f7a496e87c0188b4d3db1ac48d