public async getNewReplicaSet()

in src/types/kubectl.ts [70:100]


   public async getNewReplicaSet(deployment: string, namespace?: string) {
      const result = await this.describe(
         'deployment',
         deployment,
         true,
         namespace
      )

      let newReplicaSet = ''
      if (result?.stdout) {
         const stdout = result.stdout.split('\n')
         core.debug('stdout from getNewReplicaSet is ' + JSON.stringify(stdout))
         stdout.forEach((line: string) => {
            const newreplicaset = 'newreplicaset'
            if (line && line.toLowerCase().indexOf(newreplicaset) > -1) {
               core.debug(
                  `found string of interest for replicaset, line is ${line}`
               )
               core.debug(
                  `substring is ${line.substring(newreplicaset.length).trim()}`
               )
               newReplicaSet = line
                  .substring(newreplicaset.length)
                  .trim()
                  .split(' ')[0]
            }
         })
      }

      return newReplicaSet
   }