Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

"container.v1.ClusterManagerClient" methods returns an "Operation" which is not resolvable to a promise, contradicting the docs. #415

@miguepintor

Description

@miguepintor

Environment details

  • OS: macOS 10.15.7
  • Node.js version: v12.18.4
  • npm version: 6.14.6
  • @google-cloud/container version: 2.2.0

Steps to reproduce

  1. Given this async function:
const container = require('@google-cloud/container');
const client = new container.v1.ClusterManagerClient();
const {
  PROJECT, ZONE, CLUSTER, POOL,
} = process.env;
const config = {
  projectId: PROJECT,
  clusterId: CLUSTER,
  zone: ZONE,
  nodePoolId: POOL,
};
const turnOffCluster = async () => {
  const [operation] = await client.setNodePoolAutoscaling(
    { ...config, autoscaling: { enabled: false } },
  );
  await operation.promise();
  await client.setNodePoolSize({ ...config, nodeCount: 0 });
};
turnOffCluster();
  1. When the function is executed an error is thrown:

(node:58270) UnhandledPromiseRejectionWarning: TypeError: operation.promise is not a function

Expected behaviour

The operation.promise() should return a promise as it is specified in the documentation https://googleapis.dev/nodejs/container/latest/v1.ClusterManagerClient.html#setNodePoolAutoscaling

We need that in order to be able to wait until the autoscaling is completely applied to later be able to resize the pool to 0.

Metadata

Metadata

Assignees

Labels

api: containerIssues related to the googleapis/nodejs-cloud-container API.priority: p3Desirable enhancement or fix. May not be included in next release.samplesIssues that are directly related to samples.type: docsImprovement to the documentation for an API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions