mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-05-13 04:36:51 +00:00
DeploymentResult -> ControllerResult
This commit is contained in:
@@ -21,11 +21,12 @@ import (
|
||||
)
|
||||
|
||||
// ValidateDeployment validates a single deployment, returns a PodResult.
|
||||
func ValidateDeployment(conf conf.Configuration, deploy *appsv1.Deployment) DeploymentResult {
|
||||
func ValidateDeployment(conf conf.Configuration, deploy *appsv1.Deployment) ControllerResult {
|
||||
pod := deploy.Spec.Template.Spec
|
||||
podResult := ValidatePod(conf, &pod)
|
||||
return DeploymentResult{
|
||||
return ControllerResult{
|
||||
Name: deploy.Name,
|
||||
Type: "Deployment",
|
||||
PodResult: podResult,
|
||||
}
|
||||
}
|
||||
@@ -47,7 +48,7 @@ func ValidateDeployments(config conf.Configuration, k8sAPI *kube.API) (Namespace
|
||||
return nsResults, nil
|
||||
}
|
||||
|
||||
func addResult(deploymentResult DeploymentResult, nsResults NamespacedResults, nsName string) NamespacedResults {
|
||||
func addResult(deploymentResult ControllerResult, nsResults NamespacedResults, nsName string) NamespacedResults {
|
||||
nsResult := &NamespaceResult{}
|
||||
|
||||
// If there is already data stored for this namespace name,
|
||||
@@ -56,7 +57,7 @@ func addResult(deploymentResult DeploymentResult, nsResults NamespacedResults, n
|
||||
case nil:
|
||||
nsResult = &NamespaceResult{
|
||||
Summary: &ResultSummary{},
|
||||
DeploymentResults: []DeploymentResult{},
|
||||
DeploymentResults: []ControllerResult{},
|
||||
}
|
||||
nsResults[nsName] = nsResult
|
||||
default:
|
||||
|
||||
@@ -35,7 +35,7 @@ type NamespacedResults map[string]*NamespaceResult
|
||||
type NamespaceResult struct {
|
||||
Name string
|
||||
Summary *ResultSummary
|
||||
DeploymentResults []DeploymentResult
|
||||
DeploymentResults []ControllerResult
|
||||
}
|
||||
|
||||
// CountSummary provides a high level overview of success, warnings, and errors.
|
||||
@@ -73,9 +73,10 @@ func (rs *ResultSummary) appendResults(toAppend ResultSummary) {
|
||||
}
|
||||
}
|
||||
|
||||
// DeploymentResult provides a wrapper around a PodResult
|
||||
type DeploymentResult struct {
|
||||
// ControllerResult provides a wrapper around a PodResult
|
||||
type ControllerResult struct {
|
||||
Name string
|
||||
Type string
|
||||
PodResult PodResult
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user