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

rework label selector and resource identifier type #3

Merged
merged 3 commits into from
Aug 15, 2023
Merged

Commits on Aug 14, 2023

  1. rework parsing of the KubeSpec in prep for Action

    reworks the parsing of the KubeSpec struct and identifying parse errors
    earlier (along with a line/column for the failure of `With` struct
    parsing).
    
    Signed-off-by: Jay Pipes <jaypipes@gmail.com>
    jaypipes committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    6e2b71c View commit details
    Browse the repository at this point in the history
  2. separate Action into own file and parsing

    Introducing the `on.fail` field for the kube gdt plugin involves parsing
    a kubernetes action (get, create, apply, etc) separate from the main
    `kube` field in the KubeSpec. So, in this patch we separate out the
    Action and then embed the Action struct inside the KubeSpec, separating
    out the parsing of the Action struct.
    
    Signed-off-by: Jay Pipes <jaypipes@gmail.com>
    jaypipes committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    54b193e View commit details
    Browse the repository at this point in the history
  3. rework label selector and resource identifier type

    **This introduces a breaking API change**
    
    Previously, the following YAML was used to select (or delete) resources
    in a `gdt-kube` test spec:
    
    ```yaml
    tests:
     - kube.get: pods
       with:
         labels:
           app: nginx
    ```
    
    This functionality has been changed to use the following format instead:
    
    ```yaml
    tests:
     - kube:
         get:
           type: pods
           labels:
             app: nginx
    ```
    
    or using the `kube.get` shortcut, like so:
    
    ```yaml
    tests:
     - kube.get:
         type: pods
           labels:
             app: nginx
    ```
    
    This was changed in order to better accomodate additional Kubernetes
    actions coming in future PRs, including `logs` and `exec` actions, as
    well as to standardize the parsing of resource identifiers and label
    selectors.
    
    Signed-off-by: Jay Pipes <jaypipes@gmail.com>
    jaypipes committed Aug 14, 2023
    Configuration menu
    Copy the full SHA
    42953f0 View commit details
    Browse the repository at this point in the history