Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix: fix write-coordinator-yaml after refactoring #172

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
- name: Create portable coordinator resource definitions
run: |
mkdir -p workspace
nix run .#scripts.write-coordinator-yaml -- "${container_registry}/nunki/coordinator" > workspace/coordinator.yaml
nix run .#scripts.write-coordinator-yaml -- "${container_registry}/nunki/coordinator:${{ inputs.version }}" > workspace/coordinator.yaml
- name: Update coordinator policy hash
run: |
yq < workspace/coordinator.yaml \
Expand Down
8 changes: 4 additions & 4 deletions packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ with pkgs;
name = "write-coordinator-policy";
runtimeInputs = [
yq-go
genpolicy
genpolicy-msft
];
text = ''
imageRef=$1:v${version}
imageRef=$1

tmpdir=$(mktemp -d)
trap 'rm -rf $tmpdir' EXIT
Expand All @@ -162,8 +162,8 @@ with pkgs;
(select(.kind == \"Service\") | .spec.type) = \"LoadBalancer\" "

pushd "$tmpdir" >/dev/null
# TODO(burgerdev): this should not be dev, but there are unknown env vars
cp ${genpolicy.settings}/genpolicy-settings.json .
cp ${genpolicy-msft.rules-coordinator}/genpolicy-rules.rego rules.rego
cp ${genpolicy-msft.settings}/genpolicy-settings.json .
genpolicy < "$tmpdir/coordinator.yml"
popd >/dev/null
'';
Expand Down
Loading