Skip to content

Commit

Permalink
copy secrets from ephemeral-base (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb authored Jan 17, 2025
1 parent 3ab67c2 commit 415c16d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 8 additions & 8 deletions files/bin/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ class Snapshot(BaseModel):


def get_component_options(components: list[Component], pr_number: str | None = None) -> list[str]:
prefix = ""
if pr_number:
prefix = f"pr-{pr_number}-"

prefix = f"pr-{pr_number}-" if pr_number else ""
result = []
for component in components:
component_name = os.environ.get("BONFIRE_COMPONENT_NAME") or component.name
Expand Down Expand Up @@ -125,9 +122,7 @@ def get_pr_labels(
except HTTPError as exc:
sys.exit(f"Error {exc.code} retrieving {exc.url}.")

labels = {item["name"] for item in data["labels"]}

return labels
return {item["name"] for item in data["labels"]}


def display(command: str | t.Sequence[t.Any], no_log_values: t.Sequence[t.Any] | None = None) -> None:
Expand Down Expand Up @@ -172,7 +167,7 @@ def main() -> None:
components_arg = chain.from_iterable(("--component", component) for component in components)
components_with_resources = os.environ.get("COMPONENTS_W_RESOURCES", "").split()
components_with_resources_arg = chain.from_iterable(("--no-remove-resources", component) for component in components_with_resources)
snapshot_components = set(component.name for component in snapshot.components)
snapshot_components = {component.name for component in snapshot.components}
deploy_frontends = os.environ.get("DEPLOY_FRONTENDS") or "false"
deploy_timeout = get_timeout("DEPLOY_TIMEOUT", labels)
extra_deploy_args = os.environ.get("EXTRA_DEPLOY_ARGS", "")
Expand Down Expand Up @@ -219,6 +214,11 @@ def main() -> None:
oci_config_eph,
]

for secret in ["koku-aws", "koku-gcp", "koku-oci"]:
cmd = f"oc get secret {secret} -o yaml -n ephemeral-base | grep -v '^\s*namespace:\s' | oc apply --namespace=${namespace} -f -"
display(cmd)
subprocess.run(cmd, shell=True)

command = [
"bonfire", "deploy",
"--source", "appsre",
Expand Down
1 change: 0 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
required-version = "0.7.1"
line-length = 160
target-version = "py311"
preview = true
Expand Down

0 comments on commit 415c16d

Please sign in to comment.