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

Add wildcard to DNS Names for workloads #86

Merged
merged 3 commits into from
Jan 23, 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
9 changes: 2 additions & 7 deletions cli/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,10 @@ func checkPoliciesMatchManifest(policies map[string]deployment, policyHashes map
len(policies), len(policyHashes))
}
for name, deployment := range policies {
existingNames, ok := policyHashes[deployment.policy.Hash()]
_, ok := policyHashes[deployment.policy.Hash()]
if !ok {
return fmt.Errorf("policy %s not found in manifest", name)
}

if !slices.Equal(existingNames, deployment.DNSNames()) {
return fmt.Errorf("policy %s with hash %s exists in manifest, but with different names %v",
name, deployment.policy.Hash(), existingNames,
)
}
}
return nil
}
Expand All @@ -116,5 +110,6 @@ func (d deployment) DNSNames() []string {
return []string{
fmt.Sprintf("%s.%s", d.name, d.namespace),
fmt.Sprintf("*.%s", d.namespace),
"*",
}
}
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ generate target=default_deploy_target:
mkdir -p ./{{ workspace_dir }}
rm -rf ./{{ workspace_dir }}/*
cp -R ./deployments/{{ target }} ./{{ workspace_dir }}/deployment
echo "{{ target }}${namespace_suffix}" > ./{{ workspace_dir }}/just.namespace
echo "{{ target }}${namespace_suffix-}" > ./{{ workspace_dir }}/just.namespace
nix run .#patch-nunki-image-hashes -- ./{{ workspace_dir }}/deployment
nix run .#kypatch images -- ./{{ workspace_dir }}/deployment \
--replace ghcr.io/edgelesssys ${container_registry}
nix run .#kypatch namespace -- ./{{ workspace_dir }}/deployment \
--replace edg-default {{ target }}${namespace_suffix}
--replace edg-default {{ target }}${namespace_suffix-}
t=$(date +%s)
nix run .#cli -- generate \
-m ./{{ workspace_dir }}/manifest.json \
Expand Down