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

Add support for OCI labels on image/bundle push #552

Merged

Conversation

phenixblue
Copy link
Contributor

@phenixblue phenixblue commented Jul 26, 2023

This adds the ability for users to specify OCI labels that will be added to the generated OCI artifact (bundle/image) during a push operation.

Fixes #153

Example:

$ imgpkg push -b index.docker.io/jmsearcy/example-bundle:v1.0.3 -l foo.bar=baz -f ../../tmp/imgpkg-test

The resulting OCI artifact can be inspected as such to show the labels added:

$ regctl image inspect jmsearcy/example-bundle:v1.0.3

{
  "created": "0001-01-01T00:00:00Z",
  "architecture": "",
  "os": "",
  "config": {
    "Labels": {
      "dev.carvel.imgpkg.bundle": "true",
      "foo.bar": "baz",
    }
  },
  "rootfs": {
    "type": "layers",
    "diff_ids": [
      "sha256:f77fc57aa0878a70576e6b45c74ce5a7070219687b92fe073f632d71b7b107f8"
    ]
  },
  "history": [
    {
      "created": "0001-01-01T00:00:00Z",
      "created_by": "imgpkg",
      "author": "imgpkg"
    }
  ]
}

Signed-off-by: Joe Searcy <joe@twr.io>
Signed-off-by: Joe Searcy <joe@twr.io>
@phenixblue
Copy link
Contributor Author

Related to #412

Signed-off-by: Joe Searcy <joe@twr.io>
@phenixblue phenixblue temporarily deployed to GCR e2e July 30, 2023 06:46 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e July 30, 2023 06:46 — with GitHub Actions Inactive
Signed-off-by: Joe Searcy <joe@twr.io>
Signed-off-by: Joe Searcy <joe@twr.io>
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e August 1, 2023 21:34 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to GCR e2e August 1, 2023 21:34 — with GitHub Actions Inactive
Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me. Added some questions and suggestions.

pkg/imgpkg/bundle/contents_test.go Outdated Show resolved Hide resolved
pkg/imgpkg/bundle/contents.go Show resolved Hide resolved
pkg/imgpkg/cmd/push.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/label_flags.go Outdated Show resolved Hide resolved
pkg/imgpkg/cmd/push_test.go Show resolved Hide resolved
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e August 2, 2023 17:32 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to GCR e2e August 2, 2023 17:32 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to GCR e2e August 2, 2023 18:34 — with GitHub Actions Inactive
@phenixblue phenixblue had a problem deploying to TanzuNet Registry Dev e2e August 2, 2023 18:34 — with GitHub Actions Failure
phenixblue and others added 3 commits August 2, 2023 14:40
Co-authored-by: João Pereira <joaopapereira@gmail.com>
Signed-off-by: Joe Searcy <joe@twr.io>
Signed-off-by: Joe Searcy <joe@twr.io>
Signed-off-by: Joe Searcy <joe@twr.io>
@phenixblue phenixblue force-pushed the add-labels-for-bundles-and-images branch from 4ff82e7 to f5d15ff Compare August 2, 2023 18:41
@phenixblue phenixblue temporarily deployed to GCR e2e August 2, 2023 18:41 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e August 2, 2023 18:41 — with GitHub Actions Inactive
Signed-off-by: Joe Searcy <joe@twr.io>
@phenixblue phenixblue had a problem deploying to TanzuNet Registry Dev e2e August 2, 2023 19:12 — with GitHub Actions Failure
@phenixblue phenixblue temporarily deployed to GCR e2e August 2, 2023 19:12 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to TanzuNet Registry Dev e2e August 2, 2023 20:43 — with GitHub Actions Inactive
@phenixblue phenixblue temporarily deployed to GCR e2e August 2, 2023 20:43 — with GitHub Actions Inactive
Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joaopapereira joaopapereira merged commit f9723ee into carvel-dev:develop Aug 3, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add annotations/labels to bundle
2 participants