Skip to content

apis: Add Artifact type to meta package#1018

Merged
stefanprodan merged 1 commit into
mainfrom
meta-artifact
Sep 3, 2025
Merged

apis: Add Artifact type to meta package#1018
stefanprodan merged 1 commit into
mainfrom
meta-artifact

Conversation

@stefanprodan

Copy link
Copy Markdown
Member

Extract the Artifact type from source-controller API into fluxcd/apis/meta. This is a prerequisite for RFC-0012.

PS. The only change I made to the Artifact type is to make the Digest a required field, this was suppose to happen at GA time (source-controller v1.0.0) but we missed it.

@stefanprodan stefanprodan added the area/api API related issues and pull requests label Sep 3, 2025

@matheuscscp matheuscscp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! 🚀

Comment thread apis/meta/artifact.go
// the file in the root of the Artifact storage on the local file system of
// the controller managing the Source.
// +required
Path string `json:"path"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be an optional field? Kustomize controller uses spec.Path to find the manifests once the archive is uncompressed as far as I know.

@stefanprodan stefanprodan Sep 3, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not for making this optional, this is used by the storage GC, so it's a requirement of the internals of source-controller but not consumers. kustomize and helm-controller use the URL field only.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

status:
  artifact:
    digest: sha256:edb4266e6f0a6ea1f00bdb882f2fcb8d9c2829f60d2a70c1f1bb1ec972649d5a
    lastUpdateTime: "2025-08-06T09:56:37Z"
    metadata:
      org.opencontainers.image.created: "2025-07-14T10:03:53Z"
      org.opencontainers.image.revision: refs/heads/main@sha1:abedb77c208ddac5f12cda9ab055451e31637f96
      org.opencontainers.image.source: https://github.com/matheuscscp/gitops-playground
    path: ocirepository/flux-system/flux-system/sha256:dba3d2e4782bea12da7ffd4197bbf0c9db55bc0ae62e266a97a031f87eb3231e.tar.gz
    revision: latest@sha256:dba3d2e4782bea12da7ffd4197bbf0c9db55bc0ae62e266a97a031f87eb3231e
    size: 7100
    url: http://source-controller.flux-system.svc.cluster.local./ocirepository/flux-system/flux-system/sha256:dba3d2e4782bea12da7ffd4197bbf0c9db55bc0ae62e266a97a031f87eb3231e.tar.gz

Here, Path is a path to the artifact in the artifact storage. The field .spec.path is a path inside the artifact.

@stefanprodan stefanprodan merged commit d2f54dd into main Sep 3, 2025
11 checks passed
@stefanprodan stefanprodan deleted the meta-artifact branch September 3, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants