Skip to content

Commit 828c3ae

Browse files
Merge pull request #436 from typeid/ignore_nonexistant_clusters
Fix: ignore non-existant clusters
2 parents 25ccd3f + a34f7ff commit 828c3ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cadctl/cmd/investigate/investigate.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,13 @@ func run(cmd *cobra.Command, _ []string) error {
116116

117117
cluster, err := ocmClient.GetClusterInfo(clusterID)
118118
if err != nil {
119+
if strings.Contains(err.Error(), "no cluster found") {
120+
logging.Warnf("No cluster found with ID '%s'. Exiting.", clusterID)
121+
return pdClient.EscalateIncidentWithNote("CAD was unable to find the incident cluster in OCM. An alert for a non-existing cluster is unexpected. Please investigate manually.")
122+
}
119123
return fmt.Errorf("could not retrieve cluster info for %s: %w", clusterID, err)
120124
}
125+
121126
// From this point on, we normalize to internal ID, as this ID always exists.
122127
// For installing clusters, externalID can be empty.
123128
internalClusterID := cluster.ID()

0 commit comments

Comments
 (0)