-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from replicatedhq/host-preflgihts-ux
Host preflight ux improvements
- Loading branch information
Showing
48 changed files
with
640 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package analyzer | ||
|
||
import troubleshootv1beta2 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta2" | ||
|
||
type HostAnalyzer interface { | ||
Title() string | ||
IsExcluded() (bool, error) | ||
Analyze(getFile func(string) ([]byte, error)) (*AnalyzeResult, error) | ||
} | ||
|
||
func GetHostAnalyzer(analyzer *troubleshootv1beta2.HostAnalyze) (HostAnalyzer, bool) { | ||
switch { | ||
case analyzer.CPU != nil: | ||
return &AnalyzeHostCPU{analyzer.CPU}, true | ||
case analyzer.Memory != nil: | ||
return &AnalyzeHostMemory{analyzer.Memory}, true | ||
case analyzer.TCPLoadBalancer != nil: | ||
return &AnalyzeHostTCPLoadBalancer{analyzer.TCPLoadBalancer}, true | ||
case analyzer.HTTPLoadBalancer != nil: | ||
return &AnalyzeHostHTTPLoadBalancer{analyzer.HTTPLoadBalancer}, true | ||
case analyzer.DiskUsage != nil: | ||
return &AnalyzeHostDiskUsage{analyzer.DiskUsage}, true | ||
case analyzer.TCPPortStatus != nil: | ||
return &AnalyzeHostTCPPortStatus{analyzer.TCPPortStatus}, true | ||
case analyzer.HTTP != nil: | ||
return &AnalyzeHostHTTP{analyzer.HTTP}, true | ||
case analyzer.Time != nil: | ||
return &AnalyzeHostTime{analyzer.Time}, true | ||
case analyzer.BlockDevices != nil: | ||
return &AnalyzeHostBlockDevices{analyzer.BlockDevices}, true | ||
case analyzer.TCPConnect != nil: | ||
return &AnalyzeHostTCPConnect{analyzer.TCPConnect}, true | ||
case analyzer.IPV4Interfaces != nil: | ||
return &AnalyzeHostIPV4Interfaces{analyzer.IPV4Interfaces}, true | ||
case analyzer.FilesystemPerformance != nil: | ||
return &AnalyzeHostFilesystemPerformance{analyzer.FilesystemPerformance}, true | ||
case analyzer.Certificate != nil: | ||
return &AnalyzeHostCertificate{analyzer.Certificate}, true | ||
default: | ||
return nil, false | ||
} | ||
} | ||
|
||
func hostAnalyzerTitleOrDefault(meta troubleshootv1beta2.AnalyzeMeta, defaultTitle string) string { | ||
if meta.CheckName != "" { | ||
return meta.CheckName | ||
} | ||
return defaultTitle | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.