infra/google/kubernetes/index.js
function getClusterVersion(request, mCb) {
			delete request.project;
			v1Container().projects.zones.getServerconfig(request, function (err, response) {
				if (err) {
					return mCb(err);
				}
				let version;
				if (response && response.validMasterVersions && Array.isArray(response.validMasterVersions)
					&& response.validMasterVersions.length > 0) {
					response.validMasterVersions.forEach(function (oneVersion) {
						if (oneVersion.substring(0, 3) === "1.7") {
							version = oneVersion;
							options.soajs.log.debug("Initial Cluster version set to :", version);
						}
					});
					
				} else if (response && response.defaultClusterVersion && !version) {
					version = response.defaultClusterVersion;
					options.soajs.log.debug("Initial Cluster version set to default version :", version);
				} else {
					return mCb({"code": 410, "msg": "Invalid or no kubernetes cluster version found!"})
				}
				return mCb(null, version);
			});
		}
function getClusterVersion(request, mCb) {
			delete request.project;
			v1Container().projects.zones.getServerconfig(request, function (err, response) {
				if (err) {
					return mCb(err);
				}
				let version;
				if (response && response.validMasterVersions && Array.isArray(response.validMasterVersions)
					&& response.validMasterVersions.length > 0) {
					response.validMasterVersions.forEach(function (oneVersion) {
						if (oneVersion.substring(0, 3) === "1.7") {
							version = oneVersion;
							options.soajs.log.debug("Initial Cluster version set to :", version);
						}
					});
					
				} else if (response && response.defaultClusterVersion && !version) {
					version = response.defaultClusterVersion;
					options.soajs.log.debug("Initial Cluster version set to default version :", version);
				} else {
					return mCb({"code": 410, "msg": "Invalid or no kubernetes cluster version found!"})
				}
				return mCb(null, version);
			});
		}
function getClusterVersion ( request , mCb ) { delete request . project ; v1Container ( ) . projects . zones . getServerconfig ( request , function ( err , response ) { if ( err ) { return mCb ( err ) ; } let version ; if ( response && response . validMasterVersions && Array . isArray ( response . validMasterVersions ) && response . validMasterVersions . length > 0 ) { response . validMasterVersions . forEach ( function ( oneVersion ) { if ( oneVersion . substring ( 0 , 3 ) === "1.7" ) { version = oneVersion ; options . soajs . log . debug ( "Initial Cluster version set to :" , version ) ; } } ) ; } else if ( response && response . defaultClusterVersion && ! version ) { version = response . defaultClusterVersion ; options . soajs . log . debug ( "Initial Cluster version set to default version :" , version ) ; } else { return mCb ( { "code" : 410 , "msg" : "Invalid or no kubernetes cluster version found!" } ) } return mCb ( null , version ) ; } ) ; }
method used to get cluster version
@returns {*}
method used to get cluster version