diff --git a/rfc7807/errors.go b/rfc7807/errors.go index f5af687..3b7b257 100644 --- a/rfc7807/errors.go +++ b/rfc7807/errors.go @@ -232,4 +232,9 @@ var ( "Message queue is full", http.StatusInternalServerError, ) + FetchDownDatabase = newProblemID( + path.Join(errorEndpointsPrefix, "fetch-down-database"), + "Fetch information from a down database", + http.StatusInternalServerError, + ) ) diff --git a/vclusterops/fetch_node_state.go b/vclusterops/fetch_node_state.go index 41704a0..45d9646 100644 --- a/vclusterops/fetch_node_state.go +++ b/vclusterops/fetch_node_state.go @@ -14,6 +14,8 @@ type VFetchNodeStateOptions struct { // operations: NMAHealth and NMA readCatalogEditor. This is useful // when we cannot get the version for down nodes from a running database GetVersion bool + + SkipDownDatabase bool } func VFetchNodeStateOptionsFactory() VFetchNodeStateOptions { @@ -82,6 +84,10 @@ func (vcc VClusterCommands) VFetchNodeState(options *VFetchNodeStateOptions) ([] } } + if options.SkipDownDatabase { + return []NodeInfo{}, rfc7807.New(rfc7807.FetchDownDatabase) + } + return vcc.fetchNodeStateFromDownDB(options) } @@ -130,6 +136,10 @@ func (vcc VClusterCommands) VFetchNodeState(options *VFetchNodeStateOptions) ([] } if upNodeCount == 0 { + if options.SkipDownDatabase { + return []NodeInfo{}, rfc7807.New(rfc7807.FetchDownDatabase) + } + return vcc.fetchNodeStateFromDownDB(options) }