Skip to content

Commit

Permalink
add decision tree for artifact creation
Browse files Browse the repository at this point in the history
Signed-off-by: Sajay Antony <[email protected]>
  • Loading branch information
sajayantony committed Aug 5, 2023
1 parent c81b3b0 commit 1fce7ab
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/concepts/artifact.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ flowchart TD
B -->|No| E[type=manifest.config.mediaType]
```

For aritifact authors, the the choice of whether to set the `artifactType` or
`config.mediaType` depends on the contents and shape of the artifact and is discussed in the
following sections.

## Dissecting the Manifest

The structure of the artifact depends on the prupose of the artifact and content.
Expand Down Expand Up @@ -162,6 +166,30 @@ as per the [empty descriptors guidance][empty-descriptor].
}
```

### Deciding on artifactType or config.mediaType

Considering the above types of artifacts, the decision tree below should help
determine what fields to set when creating an artifact.

```mermaid
graph TD
A{Artifact has at least<br>one file or blob?}
B{Artifact has additional<br>JSON metadata?}
C{Artifact requires <br>different artifactType<br>from config.mediaType?}
D[Specify artifactType,<br>set config and layers<br>to empty descriptors.]
E[Specify artifactType, include<br>artifact in layers, set<br>config to empty descriptor.]
F[Specify config with metadata,<br>include artifact in layers,<br>do not set artifactType.]
G[Specify artifactType to common<br>value, specify config with<br>metadata, include artifact in layers.]
A -- No --> D
A -- Yes --> B
B -- No --> E
B -- Yes --> C
C -- No --> F
C -- Yes --> G
```

### Harnessing Image Indexes

One of the key advantages of OCI artifacts is their ability to utilize [Image Indexes][image-index],
Expand Down

0 comments on commit 1fce7ab

Please sign in to comment.