UNCLASSIFIED - NO CUI

Skip to content

Resolve "Convert all output to using that client for `cmd/preflight_check.go`"

Ryan Daily requested to merge 143-preflight-check-output-client into main

General MR

Summary

Converts preflight checkout output to be compatible with the output client and adds support for JSON and YAMl formats.

Relevant logs/screenshots

Running against the dogfood cluster yields the following output:

YAML Output
name: Preflight Check Summary
steps:
- name: Metrics Server Check
  output:
  - Checking metrics server...
  - Check Passed - Metrics API available
  - Metrics Server is running in the cluster for Horizontal Pod Autoscaler to work.
  status: Passed
- name: Default Storage Class Check
  output:
  - Checking default storage class...
  - Check Passed - Default storage class ebs found
  - Default Storage Class exists for Stateful workloads to work.
  status: Passed
- name: Flux Controller Check
  output:
  - Checking flux installation...
  - Check Passed - flux helm-controller pod running
  - Check Passed - flux kustomize-controller pod running
  - Check Passed - flux source-controller pod running
  - Check Passed - flux notification-controller pod running
  - Flux Controller is running and allows for successful installation of Big Bang
    packages using GitOps.
  status: Passed
- name: System Parameters Check
  output:
  - Checking system parameters...
  - Creating namespace for command execution...
  - namespaces "preflight-check" already exists
  - Namespace preflight-check already exists... It will be recreated
  - 'object is being deleted: namespaces "preflight-check" already exists'
  - 'object is being deleted: namespaces "preflight-check" already exists'
  - Creating registry secret for command execution...
  - Creating job for command execution...
  - Waiting for job preflightcheck to be ready...
  - Timeout waiting for command execution job to be ready
  - 'Failed to create resources for command execution: Timeout waiting for command
    execution job to be ready'
  - System Error Occured - Execute command again to retry
  status: Unknown
JSON Output
{
  "Name": "Preflight Check Summary",
  "Steps": [
    {
      "Name": "Metrics Server Check",
      "Output": [
        "Checking metrics server...",
        "Check Passed - Metrics API available",
        "Metrics Server is running in the cluster for Horizontal Pod Autoscaler to work."
      ],
      "Status": "Passed"
    },
    {
      "Name": "Default Storage Class Check",
      "Output": [
        "Checking default storage class...",
        "Check Passed - Default storage class ebs found",
        "Default Storage Class exists for Stateful workloads to work."
      ],
      "Status": "Passed"
    },
    {
      "Name": "Flux Controller Check",
      "Output": [
        "Checking flux installation...",
        "Check Passed - flux helm-controller pod running",
        "Check Passed - flux kustomize-controller pod running",
        "Check Passed - flux source-controller pod running",
        "Check Passed - flux notification-controller pod running",
        "Flux Controller is running and allows for successful installation of Big Bang packages using GitOps."
      ],
      "Status": "Passed"
    },
    {
      "Name": "System Parameters Check",
      "Output": [
        "Checking system parameters...",
        "Creating namespace for command execution...",
        "namespaces \"preflight-check\" already exists",
        "Namespace preflight-check already exists... It will be recreated",
        "object is being deleted: namespaces \"preflight-check\" already exists",
        "object is being deleted: namespaces \"preflight-check\" already exists",
        "Creating registry secret for command execution...",
        "Creating job for command execution...",
        "Waiting for job preflightcheck to be ready...",
        "Timeout waiting for command execution job to be ready",
        "Failed to create resources for command execution: Timeout waiting for command execution job to be ready",
        "System Error Occured - Execute command again to retry"
      ],
      "Status": "Unknown"
    }
  ]
}
TEXT Output
Preflight Check Summary

Steps: [

Name: Metrics Server Check
Output:
    Checking metrics server...
    Check Passed - Metrics API available
    Metrics Server is running in the cluster for Horizontal Pod Autoscaler to work.
Status: Passed


Name: Default Storage Class Check
Output:
    Checking default storage class...
    Check Passed - Default storage class ebs found
    Default Storage Class exists for Stateful workloads to work.
Status: Passed


Name: Flux Controller Check
Output:
    Checking flux installation...
    Check Passed - flux helm-controller pod running
    Check Passed - flux kustomize-controller pod running
    Check Passed - flux source-controller pod running
    Check Passed - flux notification-controller pod running
    Flux Controller is running and allows for successful installation of Big Bang packages using GitOps.
Status: Passed


Name: System Parameters Check
Output:
    Checking system parameters...
    Creating namespace for command execution...
    namespaces "preflight-check" already exists
    Namespace preflight-check already exists... It will be recreated
    object is being deleted: namespaces "preflight-check" already exists
    object is being deleted: namespaces "preflight-check" already exists
    Creating registry secret for command execution...
    Creating job for command execution...
    Waiting for job preflightcheck to be ready...
    Timeout waiting for command execution job to be ready
    Failed to create resources for command execution: Timeout waiting for command execution job to be ready
    System Error Occured - Execute command again to retry
Status: Unknown
]

Linked Issue

#143 (closed)

Upgrade Notices

N/A

Closes #143 (closed)

Edited by Ryan Daily

Merge request reports

Loading