async openwhiskSupports()

in src/agentmgr.js [579:605]


    async openwhiskSupports(feature) {
        const FEATURES = {
            // guesstimated
            activationListFilterOnlyBasename: v => v.startsWith("2018") || v.startsWith("2017"),
            // hack
            nodejs8: v => !v.startsWith("2018") && !v.startsWith("2017"),
            // concurrency: async (_, wsk) => {
            //     // check swagger api docs instead of version to see if concurrency is supported
            //     try {
            //         const swagger = await wsk.actions.client.request("GET", "/api/v1/api-docs");

            //         if (swagger && swagger.definitions && swagger.definitions.ActionLimits && swagger.definitions.ActionLimits.properties) {
            //             return swagger.definitions.ActionLimits.properties.concurrency;
            //         }
            //     } catch (e) {
            //         log.warn('Could not read /api/v1/api-docs, setting max action concurrency to 1')
            //         return false;
            //     }
            // }
        };
        const checker = FEATURES[feature];
        if (checker) {
            return checker(await this.getOpenWhiskVersion(), this.wsk);
        } else {
            throw new Error("Unknown feature " + feature);
        }
    }