All files / src/commands/k8s k8s.version.update.command.js

88.88% Statements 16/18
100% Branches 1/1
0% Functions 0/1
88.88% Lines 16/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x     193x 193x  
import { defineCommand } from '../../lib/define-command.js';
import { k8sUpdateVersion } from '../../lib/k8s.js';
import { orgaIdOrNameOption, targetVersionOption } from '../global.options.js';
import { k8sIdOrNameArg } from './k8s.args.js';
 
export const k8sVersionUpdateCommand = defineCommand({
  description: 'Update a Kubernetes cluster to a target version',
  since: '4.9.0',
  options: {
    org: orgaIdOrNameOption,
    target: targetVersionOption,
  },
  args: [k8sIdOrNameArg],
  async handler(options, clusterIdOrName) {
    const { target, org: orgIdOrName } = options;
    await k8sUpdateVersion(orgIdOrName, clusterIdOrName, target);
  },
});