GoogleContainerTools / GoogleContainerTools/skaffold

Should `skaffold fix -version` also upgrade the dependent skaffold.yaml?

Open
#5,798 6 comments 0 reactions 0 assignees View on GitHub
feature/multi-configs kind/feature-request kind/todo priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

## *Updated from the discussion with @gsquared94 (See below)*.
### Information
- Skaffold version: v2beta15
### Actual behavior
`skaffolx fix --version VERSION` only upgrades the root `skaffold.yaml` (or --filename if given). Should it also upgrade the local dependencies' `skaffold.yaml`?

### Expected behavior
When users run `skaffold fix [--version VERSION]`, they may not only want to upgrade the root `skaffold.yaml`, but the sub-directories' `skaffold.yaml`. Especially if the root `skaffold.yaml` is out of date, the sub-directories `skaffold.yaml` are more likely to be out of date as well.

### Proposal
1. Change the `skaffold fix` behavior to upgrade both the root `skaffold.yaml` and *local* dependent `skaffold.yaml` files (which are defined in `.requires.path`). @gsquared94 @tejal29 do you think we shall make this as the default behavior? Gaurav: add flag `--recursive` default to true.
2. If any APIVersions are newer than the --version flag, do no-op for that skaffold.yaml rather than abort the whole `skaffold fix`.

### *Original question*
#### Should `skaffold fix -version` abort or do no-op?
#### Description
In `skaffolx fix --version VERSION`, if VERSION is older than in use version, skaffold aborts the attempts with message. e.g.
```shell
skaffold fix --version v2beta12
config version v2beta14 is more recent than target version v2beta12: upgrade Skaffold
```
[Here](https://github.com/GoogleContainerTools/skaffold/blob/789d0581f6415de2ef2cc9a68fe27201fe252a48/pkg/skaffold/schema/versions.go#L202) is the source code.

As a consequence, in multi-config mode, users have no chance to use `skaffold fix --version` to upgrade their older versions if they also have some newer versions in use. Is this expected? Should `skaffold fix --version` do no-op if the in-use versions is equal or newer than the VERSION?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.