-
Notifications
You must be signed in to change notification settings - Fork 14
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
apply
ing to an aggregated clusterrole fails with 409 conflict on .rules
#32
Comments
This sort of situation is handled by tools like kapp, but the scope of kapp is a different from what lightkube is trying to do so not sure if it maps well to here. |
Just tested removing |
Closing at is seems there is a workaround. |
Sorry, I thought I had responded to this. Removing This also feels like a departure from expected behaviour based on the other similar tools. For example, cat << EOF > aggregator_role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aggregator-clusterrole
labels:
aggregationRule:
clusterRoleSelectors:
- matchExpressions:
- {key: test.com/aggregate-to-view, operator: Exists}
rules: []
EOF
# First time works
kubectl apply -f aggregator_role.yaml
# Second time also works
kubectl apply -f aggregator_role.yaml |
$ kubectl apply -f cr1.yaml --server-side
clusterrole.rbac.authorization.k8s.io/aggregated-clusterrole serverside-applied
clusterrole.rbac.authorization.k8s.io/aggregate-clusterrole serverside-applied
$ kubectl apply -f cr1.yaml --server-side
clusterrole.rbac.authorization.k8s.io/aggregated-clusterrole serverside-applied
error: Apply failed with 1 conflict: conflict with "clusterrole-aggregation-controller": .rules
Please review the fields above--they currently have other managers. Here
are the ways you can resolve this warning:
* If you intend to manage all of these fields, please re-run the apply
command with the `--force-conflicts` flag.
* If you do not intend to manage all of the fields, please edit your
manifest to remove references to the fields that should keep their
current managers.
* You may co-own fields by updating your manifest to match the existing
value; in this case, you'll become the manager if the other manager(s)
stop managing the field (remove it from their configuration).
See https://kubernetes.io/docs/reference/using-api/server-side-apply/#conflicts See also the error text "If you do not intend to manage all of the fields, please edit your To me this is the intended behaviour. I'm not sure why the client side apply behave differently, anyway I suggest you open an issue in the kubernetes repository and if they fix the server-side apply, lightkube will automatically take advantage of that. |
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
Due to gtsystem/lightkube#32, rules[] have to be commented out on this manifest template.
* fix: add missing aggregate roles * fix: comment out rules: [] to avoid gtsystem/lightkube#32
* feat: move aggregation roles from kubeflow-roles * fix: removes rules: [] to avoid gtsystem/lightkube#32
Is there a way in lightkube to apply an aggregate cluster role that includes an empty
rules: []
withoutforce
ing it? Applying to an aggregate clusterrole with anything inrules
results in a 409 conflict because the control plane maintains the rules list. I'd rather avoid usingforce
so I don't suppress other errors, but can't think of anything else apart from adding some custom logic before calling.apply
to remove therules
entirely.This python snippet demonstrates the issue, generating a 409 conflict on
rules
when a change is applied withoutforce=True
:The text was updated successfully, but these errors were encountered: