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

Cannot create V1NetworkPolicy using create_from_yaml #704

Closed
trobert2 opened this issue Dec 12, 2018 · 6 comments
Closed

Cannot create V1NetworkPolicy using create_from_yaml #704

trobert2 opened this issue Dec 12, 2018 · 6 comments
Assignees
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@trobert2
Copy link

This error appears when trying to create a network policy from an existing configuration file.
Contents

kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  namespace: ci
  name: default-deny
spec:
  podSelector: {}
  policyTypes:
  - Ingress

Steps

>>> kubernetes.config.load_kube_config(config_file='/Users/trobert2/.kube/myconfing.yaml')
>>> k8s_client = client.api_client.ApiClient()
>>> api = utils.create_from_yaml(k8s_client, yaml_file='/Users/trobert2/extra/ci/0-default-deny-ingress.yaml', verbose=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/trobert2/extra/ci/venv/lib/python3.7/site-packages/kubernetes/utils/create_from_yaml.py", line 72, in create_from_yaml
    print("{0} created. status='{1}'".format(kind, str(resp.status)))
AttributeError: 'V1NetworkPolicy' object has no attribute 'status'
@micw523
Copy link
Contributor

micw523 commented Dec 13, 2018

===Found out my comment is completely wrong===

@micw523
Copy link
Contributor

micw523 commented Feb 14, 2019

On a separate look, it looks like that the response does not include a status field. Let me take an additional look on this. In the meantime, the network policy seems to be created. Calling verbose=False may help getting around the error.
/assign

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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 15, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 14, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants