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

OCI image created with ko in a release misses version informations #257

Closed
rhuss opened this issue Jul 11, 2019 · 11 comments · Fixed by #1662
Closed

OCI image created with ko in a release misses version informations #257

rhuss opened this issue Jul 11, 2019 · 11 comments · Fixed by #1662
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)
Milestone

Comments

@rhuss
Copy link
Contributor

rhuss commented Jul 11, 2019

In what area(s)?

Release

What version of Knative Client?

Version:      v20190710-local-31dc57a-dirty
Build Date:   2019-07-10 09:51:46
Git Revision: 31dc57a
Dependencies:
- serving:    v0.6.0

What version of Knative Serving running on your cluster?

0.7.x

Expected Behavior

The image created during the release in

ko resolve ${KO_FLAGS} -f config/ > kn-image-location.yaml
with ko should also contain all version informations (propagated via ldflags)

Actual Behavior

Running the created Docker image with the coordinates from the 0.2.0 release yields:

docker run --rm -it gcr.io/knative-releases/github.com/knative/client/cmd/kn@sha256:393035ce99f1e639ba859d35ffb8b3f328722a2f22ab4b4ea1d889b9c015af49 version

Unable to find image 'gcr.io/knative-releases/github.com/knative/client/cmd/kn@sha256:393035ce99f1e639ba859d35ffb8b3f328722a2f22ab4b4ea1d889b9c015af49' locally
sha256:393035ce99f1e639ba859d35ffb8b3f328722a2f22ab4b4ea1d889b9c015af49: Pulling from knative-releases/github.com/knative/client/cmd/kn
155814304360: Pull complete
4003b5b92ca9: Pull complete
1f704ff7c739: Pull complete
Digest: sha256:393035ce99f1e639ba859d35ffb8b3f328722a2f22ab4b4ea1d889b9c015af49
Status: Downloaded newer image for gcr.io/knative-releases/github.com/knative/client/cmd/kn@sha256:393035ce99f1e639ba859d35ffb8b3f328722a2f22ab4b4ea1d889b9c015af49
Version:
Build Date:
Git Revision:
Dependencies:
- serving:
@rhuss rhuss added the kind/bug Categorizes issue or PR as related to a bug. label Jul 11, 2019
@zhangtbj
Copy link
Contributor

Interesting, I tried to create the image and docker run version, also get empty info:

jordanzt@zhangtaodembp:~/Works/workspaces/gopath/src/github.com/knative/client$ docker run --rm -it us.icr.io/knative_jordan/github.com/knative/client/cmd/kn:latest version
Version:
Build Date:
Git Revision:
Dependencies:
- serving:

But I checked ko command, it doesn't support ldflags flag. should use a ldflags similar way to add the info when ko creating the image? Or....

@rhuss
Copy link
Contributor Author

rhuss commented Jul 15, 2019

Yes, these flags are required during build to propagate the version information as golang variables. If ko doesn't support arbitrary go build options, then we could switch to a plain Docker build easily on our own

@zhangtbj
Copy link
Contributor

Hi @rhuss ,

I found there is a Configuration file.ko.yaml to config ldflags for buildOverrides, like this:

buildOverrides:
  github.com/my-org/my-repo/path/to/binary:
    flags:
    - name: ldflags
      value: "-X main.Version=foo"

Link: ko-build/ko#54

But it doesn't work.... I asked in ko slack channel:
https://knative.slack.com/archives/CAVRMBUMA/p1563264859136500

Hope it works. if not, we can use docker to build with ldflags in Dockerfile. But how we publish the image to docker registry without ko? I think we need more logic to do that.

@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 15, 2020
@navidshaikh
Copy link
Collaborator

/reopen
/remove-lifecycle stale

still an issue with kn v0.19.0 release

docker run -t gcr.io/knative-releases/knative.dev/client/cmd/kn@sha256:8a05c75916cf0c68469a7724e17ff9ff4697f38a59197dbd2435e811c44d8d87 version
Version:      
Build Date:   
Git Revision: 
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v0.19.0)
* Eventing
  - sources.knative.dev/v1alpha2 (knative-eventing v0.19.0)
  - eventing.knative.dev/v1beta1 (knative-eventing v0.19.0)

@knative-prow-robot
Copy link
Contributor

@navidshaikh: Reopened this issue.

In response to this:

/reopen
/remove-lifecycle stale

still an issue with kn v0.19.0 release

docker run -t gcr.io/knative-releases/knative.dev/client/cmd/kn@sha256:8a05c75916cf0c68469a7724e17ff9ff4697f38a59197dbd2435e811c44d8d87 version
Version:      
Build Date:   
Git Revision: 
Supported APIs:
* Serving
 - serving.knative.dev/v1 (knative-serving v0.19.0)
* Eventing
 - sources.knative.dev/v1alpha2 (knative-eventing v0.19.0)
 - eventing.knative.dev/v1beta1 (knative-eventing v0.19.0)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 17, 2020
@rhuss rhuss added this to the v0.20.0 milestone Dec 1, 2020
@navidshaikh navidshaikh modified the milestones: v0.20.0, v0.21.0 Jan 14, 2021
@navidshaikh navidshaikh removed this from the v0.21.0 milestone Mar 15, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 14, 2021
@rhuss
Copy link
Contributor Author

rhuss commented Jul 5, 2021

Still an issue with v0.24.0

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 5, 2021
@github-actions
Copy link

github-actions bot commented Oct 4, 2021

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 4, 2021
@rhuss
Copy link
Contributor Author

rhuss commented Oct 11, 2021

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 11, 2021
@rhuss rhuss added the triage/accepted Issues which should be fixed (post-triage) label Jan 4, 2022
@rhuss rhuss moved this to Icebox in Client Planning Jan 4, 2022
Repository owner moved this from Backlog to Done in Client Planning Apr 28, 2022
@dsimansk
Copy link
Contributor

dsimansk commented May 2, 2022

With latest nightly image.

➜  ~ podman run --rm -it gcr.io/knative-nightly/knative.dev/client/cmd/kn version
Version:      v20220502-local-bcd18d39
Build Date:   2022-05-02 09:12:15
Git Revision: bcd18d39
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v0.31.1-0.20220427153405-71842357ab0d)
* Eventing
  - sources.knative.dev/v1 (knative-eventing v0.31.1-0.20220427174252-2219e1485934)
  - eventing.knative.dev/v1 (knative-eventing v0.31.1-0.20220427174252-2219e1485934)

@dsimansk dsimansk added this to the 1.5 (0.32) milestone May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants