@@ -104,10 +104,13 @@ describe('metadata', function() {
104104 } ) ;
105105
106106 describe ( 'getGKEDescriptor' , function ( ) {
107+ var CLUSTER_NAME = 'gke-cluster-name' ;
108+
107109 it ( 'should return the correct descriptor' , function ( ) {
108- assert . deepEqual ( Metadata . getGKEDescriptor ( PROJECT_ID ) , {
110+ assert . deepEqual ( Metadata . getGKEDescriptor ( PROJECT_ID , CLUSTER_NAME ) , {
109111 type : 'container' ,
110112 labels : {
113+ cluster_name : CLUSTER_NAME ,
111114 project_id : PROJECT_ID
112115 }
113116 } ) ;
@@ -246,16 +249,19 @@ describe('metadata', function() {
246249
247250 describe ( 'container engine' , function ( ) {
248251 it ( 'should return correct descriptor' , function ( done ) {
252+ var RETURNED_CLUSTER_NAME = 'fake-cluster' ;
249253 var DESCRIPTOR = { } ;
250254
251- Metadata . getGKEDescriptor = function ( projectId ) {
255+ Metadata . getGKEDescriptor = function ( projectId , clusterName ) {
252256 assert . strictEqual ( projectId , RETURNED_PROJECT_ID ) ;
257+ assert . strictEqual ( clusterName , RETURNED_CLUSTER_NAME ) ;
253258 return DESCRIPTOR ;
254259 } ;
255260
256261 metadata . logging . auth . getEnvironment = function ( callback ) {
257262 callback ( null , {
258- IS_CONTAINER_ENGINE : true
263+ IS_CONTAINER_ENGINE : true ,
264+ clusterName : RETURNED_CLUSTER_NAME
259265 } ) ;
260266 } ;
261267
0 commit comments