Skip to content

Commit 9fe79fd

Browse files
authored
Merge pull request #1982 from nkubala/config-change-docs
Add contributing docs for making a config change
2 parents ad3f934 + 13eb0d4 commit 9fe79fd

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

DEVELOPMENT.md

+30
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,36 @@ To check out this repository:
6868
_Adding the `upstream` remote sets you up nicely for regularly [syncing your
6969
fork](https://help.github.com/articles/syncing-a-fork/)._
7070
71+
## Making a config change
72+
73+
Some changes to the skaffold code require a change to the skaffold config. These changes require a few extra steps:
74+
75+
* Check to see what the latest config version was at the time of the last release. The easiest way to do this is to view the skaffold source on github at the last released tag.
76+
77+
* Check the current config version in the code. This can be found in `pkg/skaffold/schema/latest/config.go`: look for something like
78+
79+
```golang
80+
const Version string = "skaffold/v1beta9"
81+
```
82+
* If the config versions are different, do nothing. Somebody has already bumped the config version for this release cycle.
83+
84+
* **If the config versions are the same**:
85+
86+
* Run `./hack/new_version.sh` to freeze the current config version and cut a new version.
87+
88+
* Commit these generated changes, and submit a PR.
89+
90+
Once you've done this, continue making your changes locally, including the new config change.
91+
**Any new config changes belong in pkg/skaffold/schema/latest/config.go. Do not edit the older config versions.**
92+
93+
* Be sure and update the documentation in `pkg/skaffold/schema/<previous_config_version>/upgrade.go` with any additions, removals, or updates you make to the config.
94+
95+
* In case of backwards compatibility issues, update the `Upgrade()` method from the previous config version appropriately. This is usually required when a previously existing field in the config is changed, but **not** when a new field is added.
96+
97+
*Note: the Upgrade() method is called by skaffold automatically for older config versions. This can also be done manually by users by running `skaffold fix`.*
98+
99+
* Finally, before committing your final changes and opening your pull request, be sure and run `make test` locally. This will regenerate the JSON schemas for the skaffold config with your new changes. Commit the resulting changes autogenerated by the scripts.
100+
71101
## Building skaffold
72102
73103
To build with your local changes you have two options:

0 commit comments

Comments
 (0)