Skip to content

k8s_event hardcode resource API version to v1 #43

@zeusng-fast

Description

@zeusng-fast

With k8s_event.py, there is this line:

        if involved_obj:
            try:
                involved_object_resource = find_resource(self.client, involved_obj["kind"], "v1")
                api_involved_object = involved_object_resource.get(
                    name=involved_obj["name"], namespace=involved_obj["namespace"])

Here, the api_version in find_resource() is hardcoded to v1. We have CRD that use different api_version (e.g. v2, v3). When using k8s_event on such resource, it will split out NULLOBJECT error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions