Skip to content

Commit

Permalink
api: include v1alpha1 in proto_sync.py (#9175)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Argueta <[email protected]>
  • Loading branch information
derekargueta authored and htuch committed Dec 10, 2019
1 parent 1f36b1f commit 8cf6e56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/proto_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def SyncV3Alpha(cmd, src_labels):
continue
# Skip unversioned package namespaces. TODO(htuch): fix this to use the type
# DB and proper upgrade paths.
if 'v2' in dst:
if 'v1' in dst:
dst = re.sub('v1alpha\d?|v1', 'v3alpha', dst)
SyncProtoFile(cmd, src, dst)
elif 'v2' in dst:
dst = re.sub('v2alpha\d?|v2', 'v3alpha', dst)
SyncProtoFile(cmd, src, dst)
elif 'envoy/type/matcher' in dst:
Expand Down
2 changes: 2 additions & 0 deletions tools/type_whisperer/typedb_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Regexes governing v3alpha upgrades. TODO(htuch): The regex approach will have
# to be rethought as we go beyond v3alpha, this is WiP.
TYPE_UPGRADE_REGEXES = [
(r'(envoy[\w\.]*\.)(v1alpha\d?|v1)', r'\1v3alpha'),
(r'(envoy[\w\.]*\.)(v2alpha\d?|v2)', r'\1v3alpha'),
# These are special cases, e.g. upgrading versionless packages.
('envoy\.type\.matcher', 'envoy.type.matcher.v3alpha'),
Expand All @@ -21,6 +22,7 @@

# As with TYPE_UPGRADE_REGEXES but for API .proto paths.
PATH_UPGRADE_REGEXES = [
(r'(envoy/[\w/]*/)(v1alpha\d?|v1)', r'\1v3alpha'),
(r'(envoy/[\w/]*/)(v2alpha\d?|v2)', r'\1v3alpha'),
# These are special cases, e.g. upgrading versionless packages.
('envoy/type/matcher', 'envoy/type/matcher/v3alpha'),
Expand Down

0 comments on commit 8cf6e56

Please sign in to comment.