Skip to content

Commit

Permalink
Revert "feat: Add image source (dive --source) support" (#67)
Browse files Browse the repository at this point in the history
This reverts commit 71ca8b8.

`podman` is not supported inside docker image (current implementation how `dive` is run), and `docker-archive` is not very useful option.


For now, I will recommend installing binary and use it as is, if podman needed.
  • Loading branch information
MaxymVlasov authored Jan 28, 2025
1 parent 71ca8b8 commit f504247
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 37 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ reduce your container image size as early as possible.
| Name                      | Type | Required | Default | Description                              |
| ------------------- | ------ | -------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| image | String | true | | Image to analyze |
| image-source | String | true | `docker` | Specify the container image source Dive uses for fetching and analyzing the image. Possible values: `docker`, `docker-archive`, `podman` |
| config-file | String | false | `${{ github.workspace }}/.dive.yaml` | Path to [dive config file](https://github.com/joschi/dive#ci-integration) |
| github-token | String | false | | GitHub token to post PR comment on dive failure |
| dive-image-registry | String | false | `ghcr.io/joschi/dive` | Docker registry to pull the Dive image from |
| dive-image-version | String | false | `0.13.1@sha256:f016a4bd2837` `130545e391acee7876aa5f7258` `ccdb12640ab4afaffa1c597d17` | Version of the Dive docker image to use. <br> While `latest` is supported, using a specific version with SHA is recommended for security and reproducibility |


### Workflow

```yaml
Expand Down
6 changes: 0 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ inputs:
image:
description: Image to analyze
required: true
image-source:
description: >-
Specify the container image source Dive uses for fetching and analyzing the image. Possible
values: docker, docker-archive, podman
required: true
default: docker
config-file:
description: Path to dive config file
required: false
Expand Down
14 changes: 1 addition & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const image = core.getInput('image');
const imageSource = core.getInput('image-source');
const allowedSources = ['docker', 'docker-archive', 'podman'];
if (!allowedSources.includes(imageSource)) {
throw new Error(`Invalid image-source. Allowed values are: ${allowedSources.join(', ')}`);
}
const configFile = core.getInput('config-file');
const diveRepo = core.getInput('dive-image-registry');
// Validate Docker image name format
Expand All @@ -144,14 +139,7 @@ function run() {
if (hasConfigFile) {
commandOptions.push('--mount', `type=bind,source=${configFile},target=/.dive-ci`);
}
const parameters = [
'run',
...commandOptions,
diveImage,
image,
'--source',
imageSource
];
const parameters = ['run', ...commandOptions, diveImage, image];
if (hasConfigFile) {
parameters.push('--ci-config', '/.dive-ci');
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 1 addition & 16 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ function format(output: string): string {
async function run(): Promise<void> {
try {
const image = core.getInput('image')
const imageSource = core.getInput('image-source')
const allowedSources = ['docker', 'docker-archive', 'podman']
if (!allowedSources.includes(imageSource)) {
throw new Error(
`Invalid image-source. Allowed values are: ${allowedSources.join(', ')}`
)
}

const configFile = core.getInput('config-file')

const diveRepo = core.getInput('dive-image-registry')
Expand Down Expand Up @@ -99,14 +91,7 @@ async function run(): Promise<void> {
)
}

const parameters = [
'run',
...commandOptions,
diveImage,
image,
'--source',
imageSource
]
const parameters = ['run', ...commandOptions, diveImage, image]
if (hasConfigFile) {
parameters.push('--ci-config', '/.dive-ci')
}
Expand Down

0 comments on commit f504247

Please sign in to comment.