Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mike Eltsufin
    @meltsufin
    @marcingrzejszczak Can someone please update our learn page (https://spring.io/projects/spring-cloud-gcp#learn) to list the 1.2.6 release? The Javadocs will be at https://googleapis.dev/java/spring-cloud-gcp/1.2.6.RELEASE/index.html
    Marcin Grzejszczak
    @marcingrzejszczak
    updated
    Mike Eltsufin
    @meltsufin
    thanks!
    Andreas Kluth
    @AndreasKl
    Hi, I'm trying to calculate a signUrl for a file on cloud storage. My application is running on cloudrun, is a spring boot application and uses the cloud gcp starter. I can access the blob via val blob = storage.get(BlobId.of(bucketName, attachment.location)) but the signUrl call fails with a permission exception. My service is running under a service account that has the appropriate permissions and I'm able to generate the URI locally by passing the service-account.json. I'm assuming the service account in my app is not the same that I have configured?
    How would I retrieve the ServiceAccountCredentials for the service account my cloudrun application is running on (or validate which account spring gcp is using)?
    Elena Felder
    @elefeint
    signing URLs requires a different permission -- try "Service Account Token Creator" role
    Mike Eltsufin
    @meltsufin
    This might help figuring out which identity your app is using: https://cloud.google.com/run/docs/securing/service-identity
    Andreas Kluth
    @AndreasKl
    @elefeint Thanks, this solved my issue.. I thought I used the same account for my local and tests on gcp... maybe I just somehow used another service account locally
    Travis Tomsu
    @ttomsu
    @spencergibb - Hi Spencer - it looks like y'all are making good progress on Ilford-M5 (https://github.com/orgs/spring-cloud/projects/46). We're wondering if you have an estimate as to when this may get released and secondarily, if there will be more changes going in before a full/non-milestone release?
    Spencer Gibb
    @spencergibb
    today
    right now
    Travis Tomsu
    @ttomsu
    Nice :-)
    Travis Tomsu
    @ttomsu
    Excellent! Thank you!
    Daniel Zou
    @dzou
    @spencergibb - Hey, do you have any more docs or examples for integrators on how to implement ConfigDataLocationResolver and ConfigDataLoader described here: https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4 (about adding new properties config locations). Very interested in implementing this for our secret manager module.
    @dzou :arrow_up:
    Daniel Zou
    @dzou
    Thanks Spencer! Really appreciate the help.
    Marcin Grzejszczak
    @marcingrzejszczak
    Sleuth 3.0.0-M5 with otel support is released! There might be some breaking changes and maybe more still to come 😬
    Not gigantic though
    Travis Tomsu
    @ttomsu
    @marcingrzejszczak Would you happen to be able to help track down an issue we're having upgrading to Boot 2.4 related to Sleuth/Trace?
    Marcin Grzejszczak
    @marcingrzejszczak
    I can check it out tomorrow
    Travis Tomsu
    @ttomsu
    Ok, thank you!
    3 replies
    Marcin Grzejszczak
    @marcingrzejszczak
    hi! you can check this PR spring-cloud/spring-cloud-sleuth#1784 cause it might break GCP with Sleuth
    Daniel Zou
    @dzou
    @spencergibb - Hey Spencer, what is Spring's recommendation regarding spring.config.import vs. using BootstrapConfiguration (via spring-cloud-starter-bootstrap) ? Our project has a bootstrap configuration which loads a property source into the context. We're trying to understand if whether we need to implement those ConfigData classes or if we can get by just adding the spring-cloud-starter-bootstrap dependency
    Spencer Gibb
    @spencergibb
    @dzou spring.config.import bypasses some of the edge cases with bootstrap that can cause problems for folks
    By far the easiest way is to use the bootstrap starter. Just document that folks will use bootstrap still.
    Daniel Zou
    @dzou
    Ok, thanks!
    William S Johnstone III
    @wjohnst3
    Hi, I have a GKE application pushing logging information from stdout to GCP. Logging use Log4j2 as a Json object. When I look at the logged events in Logging Operations (the new one), the collapsed line just shows {...}. Should the json payload be in a specific format?
    Mike Eltsufin
    @meltsufin
    Hi William! Yes, there is a specific format that's expected. See this documentation: https://cloud.google.com/logging/docs/agent/configuration#process-payload
    If you're using Spring Cloud GCP, we already support the correct format via logback. See: https://docs.spring.io/spring-cloud-gcp/docs/1.2.6.RELEASE/reference/html/#log-via-console
    William S Johnstone III
    @wjohnst3
    Great thanks Mike. That's really helpful. I might need to migrate from log4j2 to logback
    William S Johnstone III
    @wjohnst3
    I have one additional ques. I have a new project using spring-cloud-gcp version 2.0.0-rc2. I need gcp secret manager integration but it doesnt seem to be available in that bom. Do you know if i can use the 1.x version or would there be issues?
    Mike Eltsufin
    @meltsufin
    secret manager integration should be there... can you elaborate on what is missing?
    William S Johnstone III
    @wjohnst3
    I include the bom and add the sm dependency. Intellij doesnt resolve it.
    I did remove a bit of my .m2 cache just in case there was some weirdness going on. Do i need to add a diff repo? If i google sm and maven i just see the older 1.x guy and not the new rc2
    Thanks for the quick response btw
    William S Johnstone III
    @wjohnst3
    Could not find artifact org.springframework.cloud:spring-cloud-gcp-starter-secretmanager:pom:unknown in spring-milestones (https://repo.spring.io/milestone)
    ugg...figured it out
    group id moved
    com.google.cloud :)
    Mike Eltsufin
    @meltsufin
    Yup! And it's in Maven Central now.
    Dan Natic
    @dnatic09

    Hey friends. I am trying to run unit tests in my spring-cloud-gcp-storage-starter application. The application works perfectly because it can pull the correct ENV variables to start the GCP client. In the unit test context, it crashes that the credentials are not available. Is there a recommended way to get this library to support running in a unit test context? I need to point the Storage client to a localhost GCP storage server and to run without passing credentials.

    java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

    Elena Felder
    @elefeint
    You'd want to have a test-only configuration file containing a CredentialsProvider bean; something like this:
    @Bean
    public CredentialsProvider credentialsProvider() {
        return NoCredentialsProvider.create();
    }
    William S Johnstone III
    @wjohnst3
    Hey, I'm using GCP secrets manager from a GKE container using SpringCloudGCP v2.0.0-RC2. I would like to configure the credentials location to be an absolute path. My credentials file is in a shared volume mounted in the container. The DefaultCredentialsProvider.class seems to expect the json file to be a resource on the classpath and not an absolute path. Is there a reason for that? I can serve it in an env var as well and put it on the encoded-key, but I would like to use the file. I also would not like to put the credentials in the image. Is there a way around this? I can impl my own provider, but I'm not sure how to make the bean available at bootstrap time. Thank you.
    Mike Eltsufin
    @meltsufin
    You should be able to specify an absolute path.
    Have you tried: spring.cloud.gcp.credentials.location=file:/usr/local/key.json ?
    William S Johnstone III
    @wjohnst3
    Tried location: file:~/secrets/secrets/credentials.json, got an error. I put the json file in my resource dir and it worked fine.
    file:/user/local/secrets/secrets/credentials.json doesn't work either
    William S Johnstone III
    @wjohnst3
    Read access on the location is ok, so it isn't that
    i also pushed the docker image to gke with a small check.