Commit Graph

164 Commits

Author SHA1 Message Date
micw523
02232a2e22 Change apis to api 2019-12-18 15:38:27 -06:00
Haowei Cai
b3164930dd turn on warning filter to print deprecation warning by default 2019-11-12 12:51:22 -08:00
Haowei Cai
9959273625 hotfix for patching custom objects issue#866 2019-11-11 12:02:41 -08:00
Haowei Cai
dee078639b Add alias package kubernetes.client.apis with deprecation warning 2019-11-11 12:02:41 -08:00
Haowei Cai
5cddbde0bf generated client change for 11.0.0-snapshot 2019-11-11 12:02:41 -08:00
Haowei Cai
778b25d87f update base submodule, update CHANGELOG and include CHANGELOG from 11.0.0a1 2019-11-11 12:02:38 -08:00
Nigel Foucha
f1339b864d
Merge azure refresh fix from python-base 2019-10-09 13:18:10 -04:00
Richard Godden
67bac5d22b support false values and missing fields in configs 2019-09-25 10:53:41 +01:00
micw523
fd9de42bab Fix deprecations introduced in v1.16 2019-09-24 16:30:10 -04:00
Oz Tiram
752373b1f9 Test getting the returncode of execution in a pod
This tests demonstrate how to execute a command in a pod and
what behavior is expected. As discussed in the commit
bf367ed6ddc63369f76df0a07b248a6711328605 in python-base this
behavior would be familiar to Python users, as `subprocess.Popen`
has the same property.
2019-09-19 10:03:43 +02:00
Julian Taylor
8b385a87dc add function to parse canonical quantities (e.g. resources)
This utility function is useful to parse values like the 200m or 300Gi
memory and cpu resources stored in kubernetes manifests.
It uses Decimal as output format as it usually represents typical input
values more accurately and reduces rounding errors.
2019-08-26 21:49:58 +02:00
Richard Godden
3f8d583ee0 update submodule to include parsing microseconds 2019-08-01 22:16:00 +01:00
Kubernetes Prow Robot
41971cc6ea
Merge pull request #888 from micw523/update-nginx
Deprecate extensions/v1beta1 deployment
2019-07-30 15:15:53 -07:00
Xianglong Wang
dd72deaec2 Deprecate extensions/v1beta1 deployment 2019-07-23 21:28:04 -04:00
Kubernetes Prow Robot
1ad4afff35
Merge pull request #824 from tnqn/verbose
Fix AttributeError in create_from_yaml
2019-07-23 12:48:14 -07:00
Oz N Tiram
e867c294bb Merge branch 'master' into util-improvements 2019-07-23 07:38:20 +02:00
Oz N Tiram
6100392c47 Add optional namespace to create_from_dict
This follows up on the addition to create_from_yaml, the behavior is the
same.
2019-07-23 05:33:40 +02:00
Oz N Tiram
ab002f760d Remove obsolete test
The current PR no longer support creating from string
2019-07-23 05:33:40 +02:00
Haowei Cai
8622ac4be4 generated client update for 10.0.0-snapshot 2019-07-01 15:20:01 -07:00
Haowei Cai
14f97fcdce update python-base submodule 2019-07-01 14:49:26 -07:00
Oz N Tiram
9e40421bcc create_from_yaml function deals with files only
Adding the ability to deal with strings containing yaml seems to repel
to much. So we stay with create_from_yaml with a bad name.

This removes the need fro StringIO to wrap strings.
Also note:

```
with open('foo.txt') as f:
    y = yaml.safe_load_all(f)

for i in y:
    print(i)

\# raises ValueError: I/O operation on closed file.
```

Hence, we indent the whole method body into the open block.

with open('foo.txt') as f:
    y = yaml.safe_load_all(f)
    for i in y:
        print(i)
2019-06-20 23:02:41 +02:00
Oz N Tiram
ed67d89f9b Remove un-necessary if block 2019-06-20 19:53:28 +02:00
Oz N Tiram
5c912f986f Throw exception from create_from_dict
This is instead of doing this in create_from_yaml
2019-06-20 18:37:58 +02:00
Oz N Tiram
4fa0e87bd7 Correct the documentation for create_from_dict
The function can create one or more Kuberenetes objects
based on the content of data. It can handle all API objects
incuding `List` type, which by itself can contain more than
one Kuberenetes API objects.
2019-06-20 14:30:27 +02:00
Oz N Tiram
34898387c3 Merge remote-tracking branch 'upstream/master' into util-improvements 2019-06-20 14:06:00 +02:00
Oz N Tiram
f6566ee5e6 Rename yml_document paramter and update documentation
Renaming `yml_document` in `create_from_dict` to data. This is a bit
 clearer that this it a data item and not a string (usually document
 read from the file system).
 Also update the documentation to describe better what the functions
 `create_from_dict` and `create_from_yaml` do.
2019-06-20 13:27:33 +02:00
Kubernetes Prow Robot
c86e4898fb
Merge pull request #782 from johscheuer/create-from-yaml-namespaced
Add method to dynamically set namespace in yaml files
2019-06-18 13:23:51 -07:00
Quan Tian
7ac1070077 Fix AttributeError in create_from_yaml
Some models don't have attribute 'status', like V1ConfigMap,
V1ClusterRole, and V1NetworkPolicy. AttributeError would be raised if
these resources are created via create_from_yaml with verbose enabled.

This patch checks if attribute 'status' exists before accessing it.
2019-05-03 10:41:00 -07:00
Oz N Tiram
139848efcb Relax pycodestyle: import only allowed at the top
While this is a really good convention, sometimes one must import
stuff inside a try except block. This block is still at the top, but pycodestyle
treats like it isn't, because it's in an idented block, and the outeer scope.
2019-04-09 23:42:01 +02:00
Oz N Tiram
38894cc397
Fix import for StringIO
This is embarrassing.
2019-04-09 23:03:02 +02:00
Oz Tiram
408d405704 Handle StringIO for Python2 properly 2019-04-09 22:51:54 +02:00
axelsteingrimsson
914b6aacf6 Updating Submodule for GCP Email Scope Addition 2019-04-09 10:20:59 +02:00
Oz Tiram
8d41478ed8 Explicitly use other deployment names for test
Using `nginx-app` deployment multiple times, is problematic because we get
conflicts or not found error.

Instead of trying to handle all cases, explicit different names
are used now. The tests now runs more reliably
2019-04-08 13:54:26 +02:00
Oz Tiram
2b83c683f8 Fix for a flaky test failing because k8s is slow
We create a deployment and do the following:

```
self.assertIsNotNone(dep)
```

Which does not fail, and then the code proceeds to deletion
and fails with a 404 execption in 80% of the time, but sometimes
it works. The deployment is there, but for some reason not available for
deletion.
Travis CI also showed inconsitent behaviour on this. Python3.5 passed
but all other version failed.
With this commit we wait for the deployment to become available for
deletion and only then continue.
2019-04-08 13:17:25 +02:00
Johannes M. Scheuermann
80339ef3f7 Add more documentation to new namespace parameter 2019-04-08 07:52:01 +02:00
Oz Tiram
0779fc9c66 Fix collection of execptions when applying yaml
This fixes of all tests and keeps the original API.

 It's the users responsiblility to do something the execptions
 when using `create_from_dict`, no air bag or breaks are supplied here.
2019-04-05 08:20:57 +02:00
Oz Tiram
18f45c9cec Fix wrong import name 2019-04-05 06:30:43 +02:00
Oz Tiram
50ef8746a9 Merge branch 'master' into util-improvements 2019-04-05 00:23:34 +02:00
Haowei Cai
b603b4a9c4 generated client change for 10.0.0-snapshot 2019-04-03 13:53:46 -07:00
Haowei Cai
52ba6399c4 update python-base submodule 2019-04-03 10:25:21 -07:00
Oz Tiram
cee4e49eda Rename create_from_map to create_from_dict, add tests 2019-03-26 23:54:34 +01:00
Oz Tiram
aa28bc7067 Allow create from string or from dict
This is a fix for #722
2019-03-26 23:26:08 +01:00
Johannes M. Scheuermann
15d36c9688 Use optional parameter for method 2019-03-26 21:45:14 +01:00
Johannes M. Scheuermann
06776ced35 Rebase code and add namespaced method 2019-03-25 16:17:12 +01:00
Xianglong Wang
9b989ddc2d Add rbac support for yaml 2019-03-20 17:54:33 -05:00
Kubernetes Prow Robot
84c057bfac
Merge pull request #673 from micw523/yaml-list
Extend YAML load functionality to *LIST and multi-resources
2019-03-19 13:22:24 -07:00
micw523
c0f71c3ba6 Add list / multi resource support 2019-03-19 00:36:32 -05:00
chowmean
8c9494ecf9 adding proxy headers settings for proxy_manager 2019-03-16 00:20:12 +05:30
Haowei Cai
e35611ca62 remove patch backup 2019-02-06 17:20:12 -08:00
Haowei Cai
1496a21b5e generated client change for 9.0.0b1 release 2019-02-06 15:20:25 -08:00