Skip to content

skaffold render should accept tagged images #4874

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

Closed
yuwenma opened this issue Oct 8, 2020 · 6 comments
Closed

skaffold render should accept tagged images #4874

yuwenma opened this issue Oct 8, 2020 · 6 comments
Assignees
Labels
area/render help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/feature-request priority/p1 High impact feature/bug.

Comments

@yuwenma
Copy link
Contributor

yuwenma commented Oct 8, 2020

Expected behavior

skaffold render should be able to update the new tag to the image.

For example, if the old tag is 2020-09-28_0000 and the new tag is 2020-09-28_1111 , this change should happen in deployment.yaml files.

Actual behavior

Skaffold does not update but attach the new tag (See here). This results in an increasing image tag and eventually hits the max length limitation.

Information

  • Skaffold version: v1.14
  • Operating system: linux
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta7
kind: Config
build:
  artifacts:
  - image: skaffold-example
deploy:
  kubectl:
    manifests:
      - k8s-*

Steps to reproduce the behavior

  1. Run "skaffold render", get the full image url from the stdout.
  2. Replace the full image url with the pod.yaml "image" field.
  3. Run "skaffold render" again.

pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: getting-started
spec:
  containers:
  - name: getting-started
    image: skaffold-example

Proposal

Per offline discussion w/ @nkubala , we expect skaffold render to accept a new flag "--ignoreTag=". When enabled, "skaffold render" will replace the image tag with the new tag instead of appending the tag at the image tail.

@yuwenma yuwenma added kind/feature-request priority/p1 High impact feature/bug. labels Oct 8, 2020
@yuwenma yuwenma added this to the Backlog [P0/P1] milestone Oct 8, 2020
@nkubala
Copy link
Contributor

nkubala commented Oct 14, 2020

the reason we designed skaffold this way is so users wouldn't get themselves into an unpredictable situation when deploying with skaffold. if a user provided a manifest with an existing tag and ran skaffold run, skaffold might build and deploy a different image than the one they expected (with the provided tag before running), which could produce some unexpected and potentially dangerous results (e.g. deploying to prod).

technically speaking this is possible in skaffold, but we should make sure we don't enable users to do things they don't mean to do, and that the UX is intuitive. --ignore-tags should probably be an all-or-nothing flag (i.e. you can't pass a specific flag you want to ignore - either ignore all, or replace all). we'd also probably want to at the very least issue a warning or something clear to the user that any previously built images with skaffold are not being used by the deployment if that flag is provided. what happens if --build-artifacts is provided? does the provided tag on the image take precedence, or the one built by skaffold?

we should also consider how this factors into a few other FRs related to render/deploy:

@nkubala nkubala added triage/discuss Items for discussion area/render labels Oct 14, 2020
@nkubala nkubala changed the title Skaffold "build" should accept tagged images skaffold render should accept tagged images Oct 14, 2020
@nkubala nkubala modified the milestones: Backlog [P0/P1], v1.17.0 Oct 14, 2020
@nkubala nkubala removed the triage/discuss Items for discussion label Oct 19, 2020
@tejal29
Copy link
Contributor

tejal29 commented Nov 2, 2020

This issue is approaching SLO. Any takers @marlon-gamez @nkubala @yuwenma @gsquared94 @IsaacPD

@tejal29 tejal29 added the help wanted We would love to have this done, but don't have the bandwidth, need help from contributors label Nov 2, 2020
@IsaacPD
Copy link
Contributor

IsaacPD commented Nov 2, 2020

I'll try and get a fix available

@IsaacPD IsaacPD self-assigned this Nov 2, 2020
@IsaacPD
Copy link
Contributor

IsaacPD commented Nov 3, 2020

I have not actually been able to reproduce the behavior as described here. I tried it on the examples/getting-started project

  1. skaffold render
    -- Outputs gcr.io/isaacpd-test/skaffold-example:1277ddcd3b1e840c76abe71d1d35fd1716a0cb87be41fa145a3e12ec0f2e2eb8 for the image name
  2. Copy the output for the image name into k8s-pod.yaml
containers: 
- name: getting-started 
  image: gcr.io/isaacpd-test/skaffold-example:1277ddcd3b1e840c76abe71d1d35fd1716a0cb87be41fa145a3e12ec0f2e2eb8
  1. skaffold render again

All that I see in the output is the same image name that was output as the original "skaffold render". I'm not getting the scenario where the tag is appended onto the tag in the manifest. Sorry if i'm misunderstanding what the intended behavior is here, I'm also using skaffold v1.16.0

@nkubala
Copy link
Contributor

nkubala commented Nov 16, 2020

alright, out of curiosity i dug into this one again and was also unable to reproduce. i did run into a few inconsistencies which i think we should track in separate issues, since they're not exactly related to this specific issue.

@yuwenma would you be able to provide more detailed repro instructions? did you use any additional flags on the call to skaffold render? did you manually update your pod.yaml? did you ever update the artifact in your skaffold.yaml?

@briandealwis briandealwis modified the milestones: v1.17.0, v1.18.0 Nov 25, 2020
@briandealwis briandealwis modified the milestones: v1.18.0, v1.19.0 Jan 25, 2021
@nkubala
Copy link
Contributor

nkubala commented Feb 3, 2021

@yuwenma with the new render design we're working on, i think this issue is obsolete. i'll close it for now, but feel free and reopen if you think it's still relevant.

@nkubala nkubala closed this as completed Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/render help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/feature-request priority/p1 High impact feature/bug.
Projects
None yet
Development

No branches or pull requests

5 participants