Skip to content
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

Get CR, delete and re-create results in unsolvable TypeError: 'NoneType' object is not callable #2186

Open
blackliner opened this issue Jan 31, 2024 · 2 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@blackliner
Copy link

blackliner commented Jan 31, 2024

What happened (please include outputs or screenshots):

client = dynamic.DynamicClient(
    api_client.ApiClient(configuration=config.load_kube_config())
)

api = client.resources.get(api_version="kubeflow.org/v1", kind="PyTorchJob")

result = api.get()
jobs_in_queue = [job for job in result.items if some_checks(job)]

for job in to_be_deleted:
    print(f"Deleting {job.metadata.name}")
    api.delete(name=job.metadata.name, namespace=job.metadata.namespace)

# recreate all deleted jobs
for job in to_be_deleted:
    api.create(body=job)
    print(f"Recreated {job.metadata.name}")

What you expected to happen:
Not to fail

How to reproduce it (as minimally and precisely as possible):
see code

Anything else we need to know?:

Environment:

  • Kubernetes version (kubectl version):
  • OS (e.g., MacOS 10.13.6):
  • Python version (python --version)
  • Python client version (pip list | grep kubernetes)
@blackliner blackliner added the kind/bug Categorizes issue or PR as related to a bug. label Jan 31, 2024
@roycaihw
Copy link
Member

/assign @fabianvf

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

5 participants