Skip to content

Commit

Permalink
Fixed more PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Young <nick@isovalent.com>
  • Loading branch information
youngnick committed Mar 15, 2023
1 parent 53f18f3 commit 32817ca
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
28 changes: 27 additions & 1 deletion geps/gep-713.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,40 @@ spec:
name: foo.com
```
### Merge semantics
It's possible (even likely) that configuration in a Policy may need to be merged
into an existing object somehow, particularly for Hierarchical policies.
In general, Policy objects should merge values at a scalar level, not at a
whole-struct level.
For example, in the `GKEServicePolicy` example above, the `cdn` struct contains
a `cachePolicy` struct that contains fields. If an implementation was merging
this configuration into an existing object that contained the same fields, it
should merge the fields at a scalar level, with the `includeHost`,
`includeProtocol`, and `includeQueryString` values being defaulted if they were
not specified in the object being controlled. Similarly, for `overrides`, the
values of the innermost scalar fields should overwrite the scalar fields in the
affected object.

Implementations should not copy the higher-level structs directly into the
affected object.

In the case that the field in the Policy affects a struct that is a member of a list,
each existing item in the list in the affected object should have each of its
fields compared to the corresponding fields in the Policy.

### Conflict Resolution
It is possible for multiple policies to target the same resource. When this
happens, merging is the preferred outcome. If multiple policy resources target
the same resource _and_ have an identical field specified with different values,
precedence MUST be determined in order of the following criteria, continuing on
ties:

* Hierarchical Policies override Direct Policies.
* Direct Policies override Hierarchical Policies. If preventing settings from
being overwritten is important, implementations should only use Hierarchical
Policies, and the `override` stanza that implies.
* The oldest Policy based on creation timestamp. For example, a Policy with a
creation timestamp of "2021-07-15 01:02:03" is given precedence over a Policy
with a creation timestamp of "2021-07-15 01:02:04".
Expand Down
1 change: 0 additions & 1 deletion site-src/references/policy-attachment.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ spec:
cachePolicy:
includeQueryString: false
targetRef:
type: direct
kind: HTTPRoute
name: example
```
Expand Down

0 comments on commit 32817ca

Please sign in to comment.