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

Schema upgrade mechanism fails to upgrade profiles by default #2469

Closed
corneliusweig opened this issue Jul 15, 2019 · 1 comment · Fixed by #2582
Closed

Schema upgrade mechanism fails to upgrade profiles by default #2469

corneliusweig opened this issue Jul 15, 2019 · 1 comment · Fixed by #2582

Comments

@corneliusweig
Copy link
Contributor

Currently, the schema upgrade mechanism works by implementing the VersionedConfig interface:

type VersionedConfig interface {
	GetVersion() string
	Upgrade() (VersionedConfig, error)
}

The responsibility of Upgrade is to migrate the whole config from one version to the next. This opens the possibility for a class of bugs, where the main pipeline (SkaffoldConfig.Pipeline) is migrated to a new version, but none of the pipeline configs in the profiles SkaffoldConfig.Profiles[*].Pipeline (see for example #2415). If there are use-cases where profile-pipelines need to be upgraded differently than the main pipeline, the following suggestion is void.

Suggestion

Add a new interface

type SkaffoldPipeline interface {
	Upgrade() (SkaffoldPipeline, error)
}

which upgrades a given pipeline to the next version. In addition, add an upgrade helper which migrates the main pipeline and all profile pipelines to the next version.
This will be backwards compatible with skaffold schema versions before the Pipeline structure was introduced.

@dgageot dgageot self-assigned this Jul 16, 2019
@dgageot dgageot added area/config kind/bug Something isn't working labels Jul 16, 2019
@dgageot dgageot removed their assignment Jul 16, 2019
@dgageot
Copy link
Contributor

dgageot commented Jul 16, 2019

I like that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants