cns-deploy retrieves wrong minor version if hostname includes "oc"

Solution Verified - Updated -

Issue

  • cns-deploy fails with below error is hostname containoc:
Using OpenShift CLI. 
/usr/bin/cns-deploy: line 414: [[: 5
ov: syntax error in expression (error token is "ov")
</snip>

due to line 414 in /usr/bin/cns-deploy:
oc_minor_version=$(${CLI} version | grep oc | awk '{ print $2 }' | cut -d '.' -f2)

Environment

  • Openshift Container Platform
  • cns-deploy-3.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content