Skip to main content

Function: isResourceServed()

function isResourceServed(
cluster: string,
apiVersions: string | string[],
apiName: string): Promise<boolean>;

Defined in: lib/k8s/resourceAvailability.ts:32

Whether a cluster serves a resource under one of the given group versions.

This asks each version's discovery document directly instead of using the aggregated discovery, because that only reports the preferred version of a group and a resource may only be served by a newer or older one.

Parameters​

ParameterTypeDescription
clusterstringThe cluster to check.
apiVersionsstring | string[]The group versions the resource may be served by, newest first.
apiNamestringThe plural name of the resource to look for.

Returns​

Promise<boolean>

true when one of the versions serves the resource.