-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validator for data directories
- Loading branch information
Showing
6 changed files
with
824 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 16 additions & 3 deletions
19
pkg/resources/provisioning.cattle.io/v1/cluster/Cluster.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
## Validation Checks | ||
|
||
### On Update | ||
|
||
#### Data Directories | ||
|
||
Prevent the creation of new objects with an env var (under `spec.agentEnvVars`) with a name of `CATTLE_AGENT_VAR_DIR`. | ||
On update, also prevent new env vars with this name from being added but allow them to be removed. Rancher will perform | ||
a one-time migration to move the system-agent data dir definition to the top level field from the `AgentEnvVars` | ||
section. A secondary validator will ensure that the effective data directory for the `system-agent` is not different | ||
from the one chosen during cluster creation. Additionally, the changing of a data directory for the `system-agent`, | ||
kubernetes distro (RKE2/K3s), and CAPR components is also prohibited. | ||
|
||
## Mutation Checks | ||
|
||
### On Update | ||
|
||
#### Dynamic Schema Drop | ||
|
||
Check for the presence of the `provisioning.cattle.io/allow-dynamic-schema-drop` annotation. If the value is `"true"`, | ||
perform no mutations. If the value is not present or not `"true"`, compare the value of the `dynamicSchemaSpec` field | ||
for each `machinePool`, to its' previous value. If the values are not identical, revert the value for the | ||
Check for the presence of the `provisioning.cattle.io/allow-dynamic-schema-drop` annotation. If the value is `"true"`, | ||
perform no mutations. If the value is not present or not `"true"`, compare the value of the `dynamicSchemaSpec` field | ||
for each `machinePool`, to its' previous value. If the values are not identical, revert the value for the | ||
`dynamicSchemaSpec` for the specific `machinePool`, but do not reject the request. |
Oops, something went wrong.