Skip to content

Commit 8f92a91

Browse files
committed
Do not call a precheck an investigation.
1 parent b66adb8 commit 8f92a91

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cadctl/cmd/investigate/investigate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func run(cmd *cobra.Command, _ []string) error {
125125
return investigationErr
126126
}
127127

128-
precheck := precheck.Investigation{}
128+
precheck := precheck.ClusterStatePrecheck{}
129129
result, err := precheck.Run(builder)
130130
if err = handleClusterNotFound(err); err != nil || result.StopInvestigations {
131131
return err

pkg/investigations/precheck/precheck.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import (
66
"github.com/openshift/configuration-anomaly-detection/pkg/logging"
77
)
88

9-
type Investigation struct{}
9+
type ClusterStatePrecheck struct{}
1010

1111
// Checks pre-requisites for a cluster investigation:
1212
// - the cluster's state is supported by CAD for an investigation (= not uninstalling)
1313
// - the cloud provider is supported by CAD (cluster is AWS)
1414
// Performs according pagerduty actions and returns whether CAD needs to investigate the cluster
15-
func (c *Investigation) Run(rb investigation.ResourceBuilder) (investigation.InvestigationResult, error) {
15+
func (c *ClusterStatePrecheck) Run(rb investigation.ResourceBuilder) (investigation.InvestigationResult, error) {
1616
result := investigation.InvestigationResult{}
1717
r, err := rb.Build()
1818
if err != nil {

pkg/investigations/precheck/precheck_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ func TestInvestigation_Run(t *testing.T) {
2020
}
2121
tests := []struct {
2222
name string
23-
c *Investigation
23+
c *ClusterStatePrecheck
2424
args args
2525
want investigation.InvestigationResult
2626
wantErr bool
2727
}{
2828
{
2929
"cloud provider unsupported stops investigation",
30-
&Investigation{},
30+
&ClusterStatePrecheck{},
3131
args{rb: &investigation.ResourceBuilderMock{
3232
Resources: &investigation.Resources{
3333
Cluster: &cmv1.Cluster{},
@@ -41,7 +41,7 @@ func TestInvestigation_Run(t *testing.T) {
4141
}
4242
for _, tt := range tests {
4343
t.Run(tt.name, func(t *testing.T) {
44-
c := &Investigation{}
44+
c := &ClusterStatePrecheck{}
4545
got, err := c.Run(tt.args.rb)
4646
if (err != nil) != tt.wantErr {
4747
t.Errorf("Investigation.Run() error = %v, wantErr %v", err, tt.wantErr)

0 commit comments

Comments
 (0)