Skip to content

Commit

Permalink
prepare_release_branch: Update generated config regex substitutions
Browse files Browse the repository at this point in the history
prepare_release_branch.py uses a regex to replace the version markers of
a release branch during the beta.0 branch cut.

As we've moved to using the "latest**" version markers in
test_config.yaml, we need to update the regexes to properly recognize
the versions in the "k8sVersions" and "nodeK8sVersions" fields.

Signed-off-by: Stephen Augustus <[email protected]>
  • Loading branch information
justaugustus committed Dec 11, 2019
1 parent c3e43d3 commit 14aaf3f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions experiment/prepare_release_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,16 @@ def update_generated_config(path, latest_version):
suffixes = ['beta', 'stable1', 'stable2', 'stable3']
for i, s in enumerate(suffixes):
vs = "%d.%d" % (v[0], v[1] + 1 - i)
config['k8sVersions'][s]['version'] = vs
markers = config['k8sVersions'][s]
markers['version'] = vs
for j, arg in enumerate(markers['args']):
markers['args'][j] = re.sub(
r'latest(-\d+\.\d+)?', 'latest-%s' % vs, arg)

node = config['nodeK8sVersions'][s]
for j, arg in enumerate(node['args']):
node['args'][j] = re.sub(
r'release-\d+\.\d+', 'release-%s' % vs, arg)
for k, arg in enumerate(node['args']):
node['args'][k] = re.sub(
r'master|release-\d+\.\d+', 'release-%s' % vs, arg)
node['prowImage'] = node['prowImage'].rpartition('-')[0] + '-' + vs

with open(path, 'w') as f:
Expand Down

0 comments on commit 14aaf3f

Please sign in to comment.