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

Add enabled property for gcp.project.dataproc. Only query clusters if… #940

Merged
merged 1 commit into from
Feb 15, 2023

Commits on Feb 15, 2023

  1. Add enabled property for gcp.project.dataproc. Only query clusters if…

    … service's enabled (#939)
    
    Fixes #938, the `DataProc Cloud` service can also be disabled for a
    project, which means we cannot fetch clusters from it.
    To fix this, I am adding an `enabled` field to the service and skipping
    clusters retrieval if the service is disabled:
    
    On a GCP with DataProc disabled
    ```
    cnquery> gcp.project.dataproc.enabled
    [failed] gcp.project.dataproc.enabled
      expected: == true
      actual:   false
    
    cnquery> gcp.project.dataproc.clusters
    ! DataProc Cloud API is not enabled, not querying clusters
    gcp.project.dataproc.clusters: []
    ```
    
    On a GCP with DataProc enabled
    ```
    cnquery> gcp.project.dataproc.enabled
    [ok] value: true
    
    cnquery> gcp.project.dataproc.clusters
    gcp.project.dataproc.clusters: []
    ```
    
    We should probably do this for all GCP services since most of them can
    be disabled
    
    
     - [x] Test with a `cnspec scan`
    preslavgerchev committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    009b93c View commit details
    Browse the repository at this point in the history