-
Notifications
You must be signed in to change notification settings - Fork 521
CLOUDP-66908: add configmap to evg logs #100
Conversation
…s-operator into CLOUDP-66908_add_configmap_to_evg_logs
chatton
left a comment
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.
Looks great! Nice and straight forward change.
Good to merge once tests pass 👍 (and we see the configmaps are correctly attached!)
rodrigovalin
left a comment
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.
Check that ApiException capture, return inmediatelly maybe?
scripts/dev/k8s_request_data.py
Outdated
| config_maps = corev1.list_namespaced_config_map(namespace, pretty="true") | ||
| except ApiException as e: | ||
| print("Exception when calling list_namespaced_config_map: %s\n" % e) | ||
| return config_maps.items |
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.
if the ApiException is raised, config_maps will be None and .items will fail with AttributeError
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.
Ah you are absolutely right! I'll fix this on all functions in this file!
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.
❗ nice catch
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.
Should we change the function to return a Optional[dict] and similar and give the caller the burden to check it?
The other way would be to just not catch the exception, but that would interrupting the dumping of logs and mark the task as failed even when it is not. So I'm leaning towards the first.
|
@bznein a few small things
What do you think? |
|
I think in this case, it might actually be fine to just pick a configmap by name, and explicitly just upload that one. Right now, we only have a single one we want, later on we can worry about adding all, or maybe use an exlude-list like you mentioned. We could maybe create a mechanism like I don't think we need to worry too much about configmap names changing, as it should always be a deterministic name based on the name of the resource. "{mdb-name}-config" I think. Another thing to consider, we are currently running all our tests in kind, a pretty empty environment, but if we're running in a different cluster, there can be all sorts of other k8s resources we don't actually care about, so maybe explicitly stating which resources we want will result in a cleaner output overall. |
All Submissions: