Giter VIP home page Giter VIP logo

Comments (9)

ryanjbaxter avatar ryanjbaxter commented on August 16, 2024 1

Glad it’s clear now!

from spring-cloud-kubernetes.

wind57 avatar wind57 commented on August 16, 2024

Duplicate of this one. The entire history and what to do with it is there. Please take a look. @ryanjbaxter safe to close as duplicate

from spring-cloud-kubernetes.

wabrit avatar wabrit commented on August 16, 2024

Is this really a duplicate? That linked bug seems to be mostly focused on earlier versions of SB/SC.

This is about SB 3.2.x / SC 2300.0.0.

And I may be missing something, but its not at all clear to me that the resolution (which seems to be "closed due to lack of feedback") to that issue sheds any light on this one.

from spring-cloud-kubernetes.

ryanjbaxter avatar ryanjbaxter commented on August 16, 2024

Is this really a duplicate? That linked bug seems to be mostly focused on earlier versions of SB/SC.

I assume you would get the same error using SB 3.1.x and SC 2022.0.x

Are your tests expected to pass even when not running on a K8S cluster?

from spring-cloud-kubernetes.

wabrit avatar wabrit commented on August 16, 2024

Yes that's right - the tests expect to pass with no dependency on k8s being present, and this is how they operated in SB 2.x. To this end, spring cloud kubernetes was disabled via a system property.

Under SB 3.2 it appears that this property no longer prevents spring cloud from attempting to locate e.g. ConfigMap property sources if it detects the presence of k8s (as is the case when running unit tests in BitBucket).

I have found an alternative approach as mentioned in the issue text above; whether this is a "bug" is moot - I'm more concerned that I understand whether this apparent change in behaviour is expected, and whether there is a better way of achieving what I need.

from spring-cloud-kubernetes.

ryanjbaxter avatar ryanjbaxter commented on August 16, 2024

Yes this was a breaking change in 2022.0.x
https://docs.spring.io/spring-cloud-kubernetes/docs/3.0.4/reference/html/#breaking-changes-in-3-0-x

Are you loading ConfigMap using Bootstrap or using spring.config.import?

from spring-cloud-kubernetes.

wabrit avatar wabrit commented on August 16, 2024

Ah thanks!

I'm using Bootstrap (setting spring.cloud.kubernetes.config.sources in src/main/resources/bootstrap.yml).

Previously I was disabling Spring Cloud kubernetes for unit tests using this configuration of the maven surefire plugin:

<systemPropertyVariables>
  <spring.cloud.kubernetes.enabled>false</spring.cloud.kubernetes.enabled>
</systemPropertyVariables>

That breaking change explains why this no longer works, so I guess I need to replace it with:

<systemPropertyVariables>
  <spring.main.cloud-platform>NONE</spring.main.cloud-platform>
</systemPropertyVariables>

from spring-cloud-kubernetes.

wind57 avatar wind57 commented on August 16, 2024

Exactly :) I thought that is explained in the linked issue I posted above

from spring-cloud-kubernetes.

wabrit avatar wabrit commented on August 16, 2024

I've looked again in the linked issue, but it's not leaping out at me :-)

But in any case I'm happy that I now understand what changed and how to adjust to that change - thank you both for your help.

from spring-cloud-kubernetes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.