@@ -35,17 +35,17 @@ export class Oc {
3535 *
3636 * @param resourceType the type of resource to get a list of
3737 * @param namespace the namespace to list the resources of (defaults to the current namespace if none is provided)
38- * @param appName the name of the application
38+ * @param selector a selector string for the k8s object when needed
3939 * @returns a list of all resources of the given type in the given namespace
4040 */
4141 public async getKubernetesObjects (
4242 resourceType : string ,
4343 namespace ?: string ,
44- appName ?: string ,
44+ selector ?: string ,
4545 executionContext ?: ExecutionContext
4646 ) : Promise < KubernetesObject [ ] > {
4747 const result = await CliChannel . getInstance ( ) . executeTool (
48- Oc . getKubernetesObjectCommand ( resourceType , namespace , appName ) ,
48+ Oc . getKubernetesObjectCommand ( resourceType , namespace , selector ) ,
4949 undefined , true , executionContext ) ;
5050 return JSON . parse ( result . stdout ) . items ;
5151 }
@@ -829,13 +829,13 @@ export class Oc {
829829 *
830830 * @param resourceType the resource type to get
831831 * @param namespace the namespace from which to get all the stateful sets
832- * @param appName the name of the application
832+ * @param selector a selector string for the k8s object when needed
833833 * @returns the oc command to list all resources of the given type in the given (or current) namespace
834834 */
835835 private static getKubernetesObjectCommand (
836836 resourceType : string ,
837837 namespace ?: string ,
838- appName ?: string
838+ selector ?: string
839839 ) : CommandText {
840840 if ( ! resourceType ) {
841841 throw new Error ( 'Must pass the resource type to get' ) ;
@@ -844,8 +844,8 @@ export class Oc {
844844 if ( namespace ) {
845845 args . push ( new CommandOption ( '--namespace' , namespace ) ) ;
846846 }
847- if ( appName ) {
848- args . push ( new CommandOption ( '-l' , `app= ${ appName } ` ) ) ;
847+ if ( selector ) {
848+ args . push ( new CommandOption ( '-l' , `${ selector } ` ) ) ;
849849 }
850850 return new CommandText ( 'oc' , `get ${ resourceType } ` , args ) ;
851851 }
0 commit comments