mirror of https://github.com/k3s-io/k3s
run buildifier on build/workspace_mirror.bzl
parent
e76c62274a
commit
8bf47d7237
|
@ -20,16 +20,16 @@ def mirror(url):
|
|||
Update the GCS bucket using bazel run //hack:update-mirror"""
|
||||
return [prefix + url, url]
|
||||
|
||||
def mirror_urls():
|
||||
# This function only gives proper results when executed from WORKSPACE,
|
||||
# but the data is needed in sh_binary, which can only be in a BUILD file.
|
||||
# Thus, it is be exported by a repository_rule (which executes in WORKSPACE)
|
||||
# to be used by the sh_binary.
|
||||
def mirror_urls():
|
||||
urls = []
|
||||
for k, v in native.existing_rules().items():
|
||||
us = list(v.get('urls', []))
|
||||
if 'url' in v:
|
||||
us.append(v['url'])
|
||||
us = list(v.get("urls", []))
|
||||
if "url" in v:
|
||||
us.append(v["url"])
|
||||
for u in us:
|
||||
if u and not u.startswith(prefix):
|
||||
urls.append(u)
|
||||
|
|
Loading…
Reference in New Issue