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

Skaffold init uses incorrect image with single jib config + single k8s manifest #2852

Closed
TadCordle opened this issue Sep 10, 2019 · 1 comment · Fixed by #2854
Closed

Skaffold init uses incorrect image with single jib config + single k8s manifest #2852

TadCordle opened this issue Sep 10, 2019 · 1 comment · Fixed by #2854
Assignees
Labels
area/build build/jib kind/bug Something isn't working priority/p1 High impact feature/bug.

Comments

@TadCordle
Copy link
Contributor

I have a single-module maven project setup with a k8s yaml that points to gcr.io/k8s-skaffold/project1:

apiVersion: apps/v1
kind: Deployment
...
      containers:
      - name: web1
        image: gcr.io/k8s-skaffold/project1
        ports:
          - containerPort: 8080
...

I have Jib setup to point to a different image, gcr.io/tcordle-test/abc:

...
<configuration>
  <to><image>gcr.io/tcordle-test/abc</image></to>
</configuration>
...

When I run skaffold init --XXenableJibInit, the prompt is skipped because there's only one image and one builder. However, the output has Jib building to its own target image, instead of what's defined in the k8s manifest.

$ skaffold init --XXenableJibInit
apiVersion: skaffold/v1beta14
kind: Config
build:
  artifacts:
  - image: gcr.io/tcordle-test/abc
    jibMaven: {}
deploy:
  kubectl:
    manifests:
    - k8s/web.yaml

The expected behavior is that the jibMaven block will contain an arg (-Dimage=gcr.io/k8s-skaffold/project1) that will make sure it tags the image correctly.

@TadCordle TadCordle self-assigned this Sep 10, 2019
@TadCordle
Copy link
Contributor Author

TadCordle commented Sep 10, 2019

It might make sense for skaffold init to just always add the -Dimage= arg, even if the target image is already configured by Jib, so skaffold keeps working even if the user changes their Jib configs without changing the k8s yamls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build build/jib kind/bug Something isn't working priority/p1 High impact feature/bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants