GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.08k stars 1.63k forks source link

Cloud Run deployer is not streaming the logs from all the services associated #8370

Open renzodavid9 opened 1 year ago

renzodavid9 commented 1 year ago

A Skaffold project configured with the cloudrun deployer, that deploys more than one Cloud Run service in a single module, only streams the logs from one of those services, the others are not printed in the console.

This works as expected when we have more than one module, each with one Cloud Run service.

Expected behavior

To have the output of all the services deployed from the project streamed to the console.

Actual behavior

Only one service is doing log stream.

Information

apiVersion: skaffold/v4beta2
kind: Config

manifests:
  rawYaml:
    - service1.yaml
    - service2.yaml

deploy:
  cloudrun:
    projectid: <you-gcp-project-id>
    region: <gcp-region>

Steps to reproduce the behavior

  1. Create a new folder with the skaffold.yaml, service1.yaml, and service2.yaml files provided above, all in the same folder
  2. Run skaffold dev or skaffold run --tail (the error is present in both)
  3. You'll see the following output:
    No tags generated
    Starting deploy...
    Deploying Cloud Run service:
         skaffold-example-cloudrun-img-1
    Deploying Cloud Run service:
         skaffold-example-cloudrun-img-2
    Cloud Run Service skaffold-example-cloudrun-img-1 finished: Service started. 1/2 deployment(s) still pending
    skaffold-example-cloudrun-img-2: Service starting: Deploying Revision. Waiting on revision skaffold-example-cloudrun-img-2-p6jd6.
    Cloud Run Service skaffold-example-cloudrun-img-2 finished: Service started. 0/2 deployment(s) still pending
    No artifacts found to watch
    Press Ctrl+C to exit
    Watching for changes...
    [skaffold-example-cloudrun-img-1] streaming logs from renzo-friction-log-cloud-run

    Here you'll see that only skaffold-example-cloudrun-img-1 streamed the logs, and no output was produced for skaffold-example-cloudrun-img-2.

renzodavid9 commented 1 year ago

It seems related with the line in here blocking the for loop: https://github.com/GoogleContainerTools/skaffold/blob/954bcf15b5ebe43a935ed504f8c96e40e3967cdf/pkg/skaffold/deploy/cloudrun/log.go#L167

jagathprakash commented 1 year ago

/assign @jagathprakash