Commit dfebd8fa authored by Geoff Simmons's avatar Geoff Simmons

Delete rewrites for URLs are not permitted.

parent 801cb41b
......@@ -101,6 +101,12 @@ func (worker *NamespaceWorker) enqueueIngsForVcfg(
// XXX a validating webhook should do this
func validateRewrites(rewrites []vcr_v1alpha1.RewriteSpec) error {
for _, rw := range rewrites {
if rw.Method == vcr_v1alpha1.Delete &&
strings.HasSuffix(rw.Target, ".url") {
return fmt.Errorf("target %s may not be deleted",
rw.Target)
}
if rw.Source != "" && (strings.HasPrefix(rw.Target, "be") !=
strings.HasPrefix(rw.Source, "be")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment