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

Allow creation from dict #795

Merged
merged 19 commits into from
Jul 23, 2019

Commits on Mar 26, 2019

  1. Allow create from string or from dict

    This is a fix for kubernetes-client#722
    oz123 committed Mar 26, 2019
    Configuration menu
    Copy the full SHA
    aa28bc7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cee4e49 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2019

  1. Configuration menu
    Copy the full SHA
    50ef874 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2019

  1. Fix wrong import name

    oz123 committed Apr 5, 2019
    Configuration menu
    Copy the full SHA
    18f45c9 View commit details
    Browse the repository at this point in the history
  2. 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.
    oz123 committed Apr 5, 2019
    Configuration menu
    Copy the full SHA
    0779fc9 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2019

  1. 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.
    oz123 committed Apr 8, 2019
    Configuration menu
    Copy the full SHA
    2b83c68 View commit details
    Browse the repository at this point in the history
  2. 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
    oz123 committed Apr 8, 2019
    Configuration menu
    Copy the full SHA
    8d41478 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2019

  1. Configuration menu
    Copy the full SHA
    408d405 View commit details
    Browse the repository at this point in the history
  2. Fix import for StringIO

    This is embarrassing.
    oz123 committed Apr 9, 2019
    Configuration menu
    Copy the full SHA
    38894cc View commit details
    Browse the repository at this point in the history
  3. 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.
    oz123 committed Apr 9, 2019
    Configuration menu
    Copy the full SHA
    139848e View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2019

  1. 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.
    oz123 committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    f6566ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3489838 View commit details
    Browse the repository at this point in the history
  3. 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.
    oz123 committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    4fa0e87 View commit details
    Browse the repository at this point in the history
  4. Throw exception from create_from_dict

    This is instead of doing this in create_from_yaml
    oz123 committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    5c912f9 View commit details
    Browse the repository at this point in the history
  5. Remove un-necessary if block

    oz123 committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    ed67d89 View commit details
    Browse the repository at this point in the history
  6. 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)
    oz123 committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    9e40421 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2019

  1. Remove obsolete test

    The current PR no longer support creating from string
    oz123 committed Jul 23, 2019
    Configuration menu
    Copy the full SHA
    ab002f7 View commit details
    Browse the repository at this point in the history
  2. Add optional namespace to create_from_dict

    This follows up on the addition to create_from_yaml, the behavior is the
    same.
    oz123 committed Jul 23, 2019
    Configuration menu
    Copy the full SHA
    6100392 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e867c29 View commit details
    Browse the repository at this point in the history