-
Notifications
You must be signed in to change notification settings - Fork 88
Conversation
🤖 zincr found 0 problems , 1 warning
Details on how to resolve are provided below Large CommitsChecks all commits for large additions to a single file. Large commits should be reviewed more carefully for potential copyright and licensing issues This file contains a substantial change, please review to determine if the change comes from an external source and if there are any copyright or licensing issues to be aware of
|
kopf/reactor/peering.py
Outdated
name=peering, | ||
body={'status': {peer.id: None if peer.is_dead else peer.as_dict() for peer in peers}}, | ||
) | ||
if namespace is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about wrapping this logic in a class? so we can use it later to fetch/patch peering custom objects.
e.g.
PeeringObjects.patch(body, peering, namespace: Optional[String])
PeeringObjects.exists(peering, namespace: Optional[String]) -> bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pykube-ng
does that, more or less. I prefer to not re-invent it or any other Kubernetes client. Instead, it is better to built on top of pykube-ng (see #15). I have a draft branch, but there are few issues both in pykube-ng, and in pykube-to-kopf connectivity — I am going to get back to them later, after I cover the functionality with the tests.
edacc35
to
d9033fb
Compare
So far, as tested with Minikube, the behaviour is this:
Both cases of (new code + old peerings) fail because they try to use the All cases of (old code + new peerings) fail since they use the now-namespaced CRD (KopfPeering) with a cluster-scoped method ( This is not solvable, since it can only be done with a new version which supports the fallback to |
Rebased on master, and added the fallback scenario for the legacy mode (cluster-scoped KopfPeering). As tested manually, the new code works as expected both in the legacy mode (of the cluster) and in the new mode (as documented). @samurang87 @aweller It can be reviewed and merged to master now. |
docs/deployment.rst
Outdated
* ``kind: KopfExample`` for the example operator objects. | ||
* ``kind: Pod/Job/PersistentVolumeClaim`` as the children objects. | ||
* ``kind: Pod/CluJob/PersistentVolumeClaim`` as the children objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clujob?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
docs/peering.rst
Outdated
|
||
kopf run --priority=$RANDOM ... | ||
|
||
``$RANDOM`` is a feature of bash (if you use another shell, find your own way). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"find your own way" is kinda rude :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
For the purpose of strict namespace isolation of the operators, the peering objects must be cluster- or namespace-scoped (previously: always cluster-scoped).
For this, split the old cluster-wide
KopfPeering
resource into the newClusterKopfPeering
& namespacedKopfPeering
, and use one of them depending on the--namespace
option.The testing of peering is performed manually — it works. More tests will be added when the whole peering subsystem will be covered with tests (as part of #13).
Docs preview:
See also: #37 for the namespace isolation of the listing/watching API calls.
TODO:
kind: KopfPeering
when re-created from the cluster to the namespaced scope — in different running modes (with/without--peering
, with/without--namespace
). Ensure that the operators actually behave as before and as expected.KopfPeering
if that CRD is cluster-scoped (but not if namespaced).