nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: cdk8s-team/cdk8s-plus
Pull request #4500 (2024-08-08 11:55:27)

feat(service): support `publishNotReadyAddresses` 
add support for publishNotReadyAddresses. for more info:

https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#servicespec-v1-core

this should be backported to 1.29 and 1.28 main branches


Patch:
diff --git a/src/service.ts b/src/service.ts
index 871ab86b..27bb6a5f 100644
--- a/src/service.ts
+++ b/src/service.ts
@@ -94,6 +94,16 @@ export interface ServiceProps extends base.ResourceProps {
    */
   readonly loadBalancerSourceRanges?: string[];
 
+  /**
+   * The publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service
+   * should disregard any indications of ready/not-ready
+   *
+   * More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#servicespec-v1-core
+   *
+   * @default - false
+   */
+  readonly publishNotReadyAddresses?: boolean;
+
 }
 
 /**
@@ -210,6 +220,7 @@ export class Service extends base.Resource {
   private readonly _selector: Record<string, string>;
   private readonly _ports: ServicePort[];
   private readonly _loadBalancerSourceRanges?: string[];
+  private readonly _publishNotReadyAddresses?: boolean;
 
   constructor(scope: Construct, id: string, props: ServiceProps = {}) {
     super(scope, id);
@@ -232,6 +243,7 @@ export class Service extends base.Resource {
     this._ports = [];
     this._selector = { };
     this._loadBalancerSourceRanges = props.loadBalancerSourceRanges;
+    this._publishNotReadyAddresses = props.publishNotReadyAddresses;
 
     if (props.selector) {
       this.select(props.selector);
@@ -337,6 +349,7 @@ export class Service extends base.Resource {
       selector: this._selector,
       ports: ports,
       loadBalancerSourceRanges: this._loadBalancerSourceRanges,
+      publishNotReadyAddresses: this._publishNotReadyAddresses,
     } : {
       type: this.type,
       externalName: this.externalName,


Test patch:
diff --git a/test/service.test.ts b/test/service.test.ts
index 48083e87..106de6bf 100644
--- a/test/service.test.ts
+++ b/test/service.test.ts
@@ -185,3 +185,14 @@ test('can be exposed by an ingress', () => {
   const ingress = Testing.synth(chart)[1];
   expect(ingress).toMatchSnapshot();
 });
+
+test('can set publishNotReadyAddresses', () => {
+  const chart = Testing.chart();
+  new kplus.Service(chart, 'service', {
+    ports: [{ port: 80 }],
+    publishNotReadyAddresses: true,
+  });
+
+  const spec = Testing.synth(chart)[0].spec;
+  expect(spec.publishNotReadyAddresses).toBeTruthy();
+});
Repository: cdk8s-team/cdk8s-plus
Pull request #4510 (2024-08-12 08:51:11)

feat(service): support `publishNotReadyAddresses`  (#4500)
# Backport

This will backport the following commits from `k8s-30/main` to `k8s-28/main`:
 - [feat(service): support `publishNotReadyAddresses`  (#4500)](https://github.com/cdk8s-team/cdk8s-plus/pull/4500)

<!--- Backport version: 8.9.9 -->

### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)


Patch:
diff --git a/src/service.ts b/src/service.ts
index 871ab86b..27bb6a5f 100644
--- a/src/service.ts
+++ b/src/service.ts
@@ -94,6 +94,16 @@ export interface ServiceProps extends base.ResourceProps {
    */
   readonly loadBalancerSourceRanges?: string[];
 
+  /**
+   * The publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service
+   * should disregard any indications of ready/not-ready
+   *
+   * More info: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#servicespec-v1-core
+   *
+   * @default - false
+   */
+  readonly publishNotReadyAddresses?: boolean;
+
 }
 
 /**
@@ -210,6 +220,7 @@ export class Service extends base.Resource {
   private readonly _selector: Record<string, string>;
   private readonly _ports: ServicePort[];
   private readonly _loadBalancerSourceRanges?: string[];
+  private readonly _publishNotReadyAddresses?: boolean;
 
   constructor(scope: Construct, id: string, props: ServiceProps = {}) {
     super(scope, id);
@@ -232,6 +243,7 @@ export class Service extends base.Resource {
     this._ports = [];
     this._selector = { };
     this._loadBalancerSourceRanges = props.loadBalancerSourceRanges;
+    this._publishNotReadyAddresses = props.publishNotReadyAddresses;
 
     if (props.selector) {
       this.select(props.selector);
@@ -337,6 +349,7 @@ export class Service extends base.Resource {
       selector: this._selector,
       ports: ports,
       loadBalancerSourceRanges: this._loadBalancerSourceRanges,
+      publishNotReadyAddresses: this._publishNotReadyAddresses,
     } : {
       type: this.type,
       externalName: this.externalName,


Test patch:
diff --git a/test/service.test.ts b/test/service.test.ts
index 48083e87..106de6bf 100644
--- a/test/service.test.ts
+++ b/test/service.test.ts
@@ -185,3 +185,14 @@ test('can be exposed by an ingress', () => {
   const ingress = Testing.synth(chart)[1];
   expect(ingress).toMatchSnapshot();
 });
+
+test('can set publishNotReadyAddresses', () => {
+  const chart = Testing.chart();
+  new kplus.Service(chart, 'service', {
+    ports: [{ port: 80 }],
+    publishNotReadyAddresses: true,
+  });
+
+  const spec = Testing.synth(chart)[0].spec;
+  expect(spec.publishNotReadyAddresses).toBeTruthy();
+});
Repository: cdk8s-team/cdk8s-plus
Pull request #3764 (2024-02-22 14:48:47)

fix(ingress): add `ingressClassName` to `IngressProps` (#2964)
# Backport

This will backport the following commits from `k8s-27/main` to `k8s-25/main`:
 - [fix(ingress): add `ingressClassName` to `IngressProps` (#2964)](https://github.com/cdk8s-team/cdk8s-plus/pull/2964)

<!--- Backport version: 8.5.0 -->

### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)


Patch:
diff --git a/src/ingress.ts b/src/ingress.ts
index 09bfceb7..983ddbbf 100644
--- a/src/ingress.ts
+++ b/src/ingress.ts
@@ -40,6 +40,14 @@ export interface IngressProps extends base.ResourceProps {
    * extension, if the ingress controller fulfilling the ingress supports SNI.
    */
   readonly tls?: IngressTls[];
+
+  /**
+   * Class Name for this ingress.
+   *
+   * This field is a reference to an IngressClass resource that contains
+   * additional Ingress configuration, including the name of the Ingress controller.
+   */
+  readonly className?: string;
 }
 
 /**
@@ -90,6 +98,7 @@ export class Ingress extends base.Resource {
       metadata: props.metadata,
       spec: {
         defaultBackend: Lazy.any({ produce: () => this._defaultBackend?._toKube() }),
+        ingressClassName: props.className,
         rules: Lazy.any({ produce: () => this.synthRules() }),
         tls: Lazy.any({ produce: () => this.tlsConfig() }),
       },


Test patch:
diff --git a/test/ingress.test.ts b/test/ingress.test.ts
index 8f79dc36..65b63503 100644
--- a/test/ingress.test.ts
+++ b/test/ingress.test.ts
@@ -12,6 +12,36 @@ test('defaultChild', () => {
 
 });
 
+test('IngressClassName can be set', () => {
+  // GIVEN
+  const chart = Testing.chart();
+  const service = new Service(chart, 'my-service', { ports: [{ port: 80 }] } );
+
+  // WHEN
+  new Ingress(chart, 'my-ingress', {
+    defaultBackend: IngressBackend.fromService(service),
+    className: 'myIngressClassName',
+  });
+
+  // THEN
+  expect(Testing.synth(chart).filter(x => x.kind === 'Ingress')).toStrictEqual([
+    {
+      apiVersion: 'networking.k8s.io/v1',
+      kind: 'Ingress',
+      metadata: { name: 'test-my-ingress-c8135042' },
+      spec: {
+        defaultBackend: {
+          service: {
+            name: 'test-my-service-c8493104',
+            port: { number: 80 },
+          },
+        },
+        ingressClassName: 'myIngressClassName',
+      },
+    },
+  ]);
+});
+
 describe('IngressBackend', () => {
   describe('fromService', () => {
     test('if the service exposes a port, it will be used by the ingress', () => {
Repository: cdk8s-team/cdk8s-plus
Pull request #3765 (2024-02-22 14:48:51)

fix(ingress): add `ingressClassName` to `IngressProps` (#2964)
# Backport

This will backport the following commits from `k8s-27/main` to `k8s-26/main`:
 - [fix(ingress): add `ingressClassName` to `IngressProps` (#2964)](https://github.com/cdk8s-team/cdk8s-plus/pull/2964)

<!--- Backport version: 8.5.0 -->

### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)


Patch:
diff --git a/src/ingress.ts b/src/ingress.ts
index 09bfceb7..983ddbbf 100644
--- a/src/ingress.ts
+++ b/src/ingress.ts
@@ -40,6 +40,14 @@ export interface IngressProps extends base.ResourceProps {
    * extension, if the ingress controller fulfilling the ingress supports SNI.
    */
   readonly tls?: IngressTls[];
+
+  /**
+   * Class Name for this ingress.
+   *
+   * This field is a reference to an IngressClass resource that contains
+   * additional Ingress configuration, including the name of the Ingress controller.
+   */
+  readonly className?: string;
 }
 
 /**
@@ -90,6 +98,7 @@ export class Ingress extends base.Resource {
       metadata: props.metadata,
       spec: {
         defaultBackend: Lazy.any({ produce: () => this._defaultBackend?._toKube() }),
+        ingressClassName: props.className,
         rules: Lazy.any({ produce: () => this.synthRules() }),
         tls: Lazy.any({ produce: () => this.tlsConfig() }),
       },


Test patch:
diff --git a/test/ingress.test.ts b/test/ingress.test.ts
index 8f79dc36..65b63503 100644
--- a/test/ingress.test.ts
+++ b/test/ingress.test.ts
@@ -12,6 +12,36 @@ test('defaultChild', () => {
 
 });
 
+test('IngressClassName can be set', () => {
+  // GIVEN
+  const chart = Testing.chart();
+  const service = new Service(chart, 'my-service', { ports: [{ port: 80 }] } );
+
+  // WHEN
+  new Ingress(chart, 'my-ingress', {
+    defaultBackend: IngressBackend.fromService(service),
+    className: 'myIngressClassName',
+  });
+
+  // THEN
+  expect(Testing.synth(chart).filter(x => x.kind === 'Ingress')).toStrictEqual([
+    {
+      apiVersion: 'networking.k8s.io/v1',
+      kind: 'Ingress',
+      metadata: { name: 'test-my-ingress-c8135042' },
+      spec: {
+        defaultBackend: {
+          service: {
+            name: 'test-my-service-c8493104',
+            port: { number: 80 },
+          },
+        },
+        ingressClassName: 'myIngressClassName',
+      },
+    },
+  ]);
+});
+
 describe('IngressBackend', () => {
   describe('fromService', () => {
     test('if the service exposes a port, it will be used by the ingress', () => {
Repository: cdk8s-team/cdk8s-plus
Pull request #3813 (2024-03-01 08:13:32)

fix(role): use rules coming from the roleProps
This fixes a bug where any rule given from roleProps is not used. the for loop exists for clusterRole but was missing on Role. a test is included to prevent breaking in future


Patch:
diff --git a/src/role.ts b/src/role.ts
index 4615a2b6..f0fa773c 100644
--- a/src/role.ts
+++ b/src/role.ts
@@ -104,6 +104,10 @@ export class Role extends base.Resource implements IRole {
       metadata: props.metadata,
       rules: Lazy.any({ produce: () => this.synthesizeRules() }),
     });
+
+    for (const rule of props.rules ?? []) {
+      this.allow(rule.verbs, ...rule.resources);
+    }
   }
 
   /**
@@ -546,4 +550,4 @@ export class ClusterRole extends base.Resource implements IClusterRole, IRole {
 
     return { clusterRoleSelectors: [{ matchLabels: this._labelSelector }] };
   }
-}
\ No newline at end of file
+}


Test patch:
diff --git a/test/role.test.ts b/test/role.test.ts
index d63180de..e2314754 100644
--- a/test/role.test.ts
+++ b/test/role.test.ts
@@ -154,6 +154,32 @@ Array [
 
   });
 
+  test('specify access from props', () => {
+
+    // GIVEN
+    const chart = Testing.chart();
+
+    // WHEN
+    new kplus.Role(chart, 'my-role', {
+      rules: [
+        {
+          verbs: ['get', 'list', 'watch'],
+          resources: [kplus.ApiResource.PODS],
+        },
+      ],
+    });
+
+    // THEN
+    const manifest = Testing.synth(chart);
+    expect(manifest[0].rules).toEqual(expect.arrayContaining([
+      {
+        apiGroups: [''],
+        resources: ['pods'],
+        verbs: ['get', 'list', 'watch'],
+      },
+    ]));
+  });
+
   test('giving access to a single pod and all pods still gives access to all pods', () => {
 
     // GIVEN
@@ -546,4 +572,4 @@ Object {
 
   });
 
-});
\ No newline at end of file
+});
Repository: cdk8s-team/cdk8s-plus
Pull request #3818 (2024-03-01 11:27:25)

feat(probe): add `host` property to HttpGet probes
HttpGet probes has `host` field. Added support for it in cdk8s-plus:
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#httpgetaction-v1-core


Patch:
diff --git a/src/_action.ts b/src/_action.ts
index a1c7bc6c..40bb8d88 100644
--- a/src/_action.ts
+++ b/src/_action.ts
@@ -21,11 +21,16 @@ export class Action {
     return { command };
   }
 
-  public static fromHttpGet(container: Container, path: string, options: { port?: number; scheme?: ConnectionScheme } = { }): k8s.HttpGetAction {
+  public static fromHttpGet(container: Container, path: string, options: {
+    port?: number;
+    scheme?: ConnectionScheme;
+    host?: string;
+  } = {}): k8s.HttpGetAction {
     return {
       path,
       port: k8s.IntOrString.fromNumber(options.port ?? container.portNumber ?? 80),
       scheme: options.scheme ?? ConnectionScheme.HTTP,
+      host: options.host,
     };
   }
-}
\ No newline at end of file
+}
diff --git a/src/probe.ts b/src/probe.ts
index e10fc8e8..048e619c 100644
--- a/src/probe.ts
+++ b/src/probe.ts
@@ -85,6 +85,13 @@ export interface HttpGetProbeOptions extends ProbeOptions {
    *  @default ConnectionScheme.HTTP
    */
   readonly scheme?: ConnectionScheme;
+
+  /**
+   * The host name to connect to on the container.
+   *
+   * @default - defaults to the pod IP
+   */
+  readonly host?: string;
 }
 
 /**


Test patch:
diff --git a/test/probe.test.ts b/test/probe.test.ts
index 17946ea5..8040b027 100644
--- a/test/probe.test.ts
+++ b/test/probe.test.ts
@@ -57,6 +57,7 @@ describe('fromHttpGet()', () => {
       periodSeconds: Duration.seconds(5),
       successThreshold: 3,
       timeoutSeconds: Duration.minutes(2),
+      host: '1.1.1.1',
     });
 
     // THEN
@@ -65,6 +66,7 @@ describe('fromHttpGet()', () => {
         path: '/hello',
         port: k8s.IntOrString.fromNumber(5555),
         scheme: 'HTTP',
+        host: '1.1.1.1',
       },
       failureThreshold: 11,
       initialDelaySeconds: 60,
Repository: cdk8s-team/cdk8s-plus
Pull request #4042 (2024-04-18 07:16:07)

feat(probe): add `host` property to HttpGet probes (#3818)
# Backport

This will backport the following commits from `k8s-29/main` to `k8s-27/main`:
 - [feat(probe): add `host` property to HttpGet probes (#3818)](https://github.com/cdk8s-team/cdk8s-plus/pull/3818)

<!--- Backport version: 8.5.0 -->

### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)


Patch:
diff --git a/src/_action.ts b/src/_action.ts
index a1c7bc6c..40bb8d88 100644
--- a/src/_action.ts
+++ b/src/_action.ts
@@ -21,11 +21,16 @@ export class Action {
     return { command };
   }
 
-  public static fromHttpGet(container: Container, path: string, options: { port?: number; scheme?: ConnectionScheme } = { }): k8s.HttpGetAction {
+  public static fromHttpGet(container: Container, path: string, options: {
+    port?: number;
+    scheme?: ConnectionScheme;
+    host?: string;
+  } = {}): k8s.HttpGetAction {
     return {
       path,
       port: k8s.IntOrString.fromNumber(options.port ?? container.portNumber ?? 80),
       scheme: options.scheme ?? ConnectionScheme.HTTP,
+      host: options.host,
     };
   }
-}
\ No newline at end of file
+}
diff --git a/src/probe.ts b/src/probe.ts
index e10fc8e8..048e619c 100644
--- a/src/probe.ts
+++ b/src/probe.ts
@@ -85,6 +85,13 @@ export interface HttpGetProbeOptions extends ProbeOptions {
    *  @default ConnectionScheme.HTTP
    */
   readonly scheme?: ConnectionScheme;
+
+  /**
+   * The host name to connect to on the container.
+   *
+   * @default - defaults to the pod IP
+   */
+  readonly host?: string;
 }
 
 /**


Test patch:
diff --git a/test/probe.test.ts b/test/probe.test.ts
index 17946ea5..8040b027 100644
--- a/test/probe.test.ts
+++ b/test/probe.test.ts
@@ -57,6 +57,7 @@ describe('fromHttpGet()', () => {
       periodSeconds: Duration.seconds(5),
       successThreshold: 3,
       timeoutSeconds: Duration.minutes(2),
+      host: '1.1.1.1',
     });
 
     // THEN
@@ -65,6 +66,7 @@ describe('fromHttpGet()', () => {
         path: '/hello',
         port: k8s.IntOrString.fromNumber(5555),
         scheme: 'HTTP',
+        host: '1.1.1.1',
       },
       failureThreshold: 11,
       initialDelaySeconds: 60,
Repository: cdk8s-team/cdk8s-plus
Pull request #4043 (2024-04-18 07:16:11)

feat(probe): add `host` property to HttpGet probes (#3818)
# Backport

This will backport the following commits from `k8s-29/main` to `k8s-28/main`:
 - [feat(probe): add `host` property to HttpGet probes (#3818)](https://github.com/cdk8s-team/cdk8s-plus/pull/3818)

<!--- Backport version: 8.5.0 -->

### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)


Patch:
diff --git a/src/_action.ts b/src/_action.ts
index a1c7bc6c..40bb8d88 100644
--- a/src/_action.ts
+++ b/src/_action.ts
@@ -21,11 +21,16 @@ export class Action {
     return { command };
   }
 
-  public static fromHttpGet(container: Container, path: string, options: { port?: number; scheme?: ConnectionScheme } = { }): k8s.HttpGetAction {
+  public static fromHttpGet(container: Container, path: string, options: {
+    port?: number;
+    scheme?: ConnectionScheme;
+    host?: string;
+  } = {}): k8s.HttpGetAction {
     return {
       path,
       port: k8s.IntOrString.fromNumber(options.port ?? container.portNumber ?? 80),
       scheme: options.scheme ?? ConnectionScheme.HTTP,
+      host: options.host,
     };
   }
-}
\ No newline at end of file
+}
diff --git a/src/probe.ts b/src/probe.ts
index e10fc8e8..048e619c 100644
--- a/src/probe.ts
+++ b/src/probe.ts
@@ -85,6 +85,13 @@ export interface HttpGetProbeOptions extends ProbeOptions {
    *  @default ConnectionScheme.HTTP
    */
   readonly scheme?: ConnectionScheme;
+
+  /**
+   * The host name to connect to on the container.
+   *
+   * @default - defaults to the pod IP
+   */
+  readonly host?: string;
 }
 
 /**


Test patch:
diff --git a/test/probe.test.ts b/test/probe.test.ts
index 17946ea5..8040b027 100644
--- a/test/probe.test.ts
+++ b/test/probe.test.ts
@@ -57,6 +57,7 @@ describe('fromHttpGet()', () => {
       periodSeconds: Duration.seconds(5),
       successThreshold: 3,
       timeoutSeconds: Duration.minutes(2),
+      host: '1.1.1.1',
     });
 
     // THEN
@@ -65,6 +66,7 @@ describe('fromHttpGet()', () => {
         path: '/hello',
         port: k8s.IntOrString.fromNumber(5555),
         scheme: 'HTTP',
+        host: '1.1.1.1',
       },
       failureThreshold: 11,
       initialDelaySeconds: 60,
Repository: cdk8s-team/cdk8s-plus
Pull request #4046 (2024-04-18 07:26:13)

fix(role): use rules coming from the roleProps (#3813)
# Backport

This will backport the following commits from `k8s-29/main` to `k8s-27/main`:
 - [fix(role): use rules coming from the roleProps (#3813)](https://github.com/cdk8s-team/cdk8s-plus/pull/3813)

<!--- Backport version: 8.5.0 -->

### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)


Patch:
diff --git a/src/role.ts b/src/role.ts
index bdf4eb93..0da4b118 100644
--- a/src/role.ts
+++ b/src/role.ts
@@ -104,6 +104,10 @@ export class Role extends base.Resource implements IRole {
       metadata: props.metadata,
       rules: Lazy.any({ produce: () => this.synthesizeRules() }),
     });
+
+    for (const rule of props.rules ?? []) {
+      this.allow(rule.verbs, ...rule.resources);
+    }
   }
 
   /**
@@ -546,4 +550,4 @@ export class ClusterRole extends base.Resource implements IClusterRole, IRole {
 
     return { clusterRoleSelectors: [{ matchLabels: this._labelSelector }] };
   }
-}
\ No newline at end of file
+}


Test patch:
diff --git a/test/role.test.ts b/test/role.test.ts
index d63180de..e2314754 100644
--- a/test/role.test.ts
+++ b/test/role.test.ts
@@ -154,6 +154,32 @@ Array [
 
   });
 
+  test('specify access from props', () => {
+
+    // GIVEN
+    const chart = Testing.chart();
+
+    // WHEN
+    new kplus.Role(chart, 'my-role', {
+      rules: [
+        {
+          verbs: ['get', 'list', 'watch'],
+          resources: [kplus.ApiResource.PODS],
+        },
+      ],
+    });
+
+    // THEN
+    const manifest = Testing.synth(chart);
+    expect(manifest[0].rules).toEqual(expect.arrayContaining([
+      {
+        apiGroups: [''],
+        resources: ['pods'],
+        verbs: ['get', 'list', 'watch'],
+      },
+    ]));
+  });
+
   test('giving access to a single pod and all pods still gives access to all pods', () => {
 
     // GIVEN
@@ -546,4 +572,4 @@ Object {
 
   });
 
-});
\ No newline at end of file
+});
Repository: cdk8s-team/cdk8s-plus
Pull request #4047 (2024-04-18 07:26:16)

fix(role): use rules coming from the roleProps (#3813)
# Backport

This will backport the following commits from `k8s-29/main` to `k8s-28/main`:
 - [fix(role): use rules coming from the roleProps (#3813)](https://github.com/cdk8s-team/cdk8s-plus/pull/3813)

<!--- Backport version: 8.5.0 -->

### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)


Patch:
diff --git a/src/role.ts b/src/role.ts
index bdf4eb93..0da4b118 100644
--- a/src/role.ts
+++ b/src/role.ts
@@ -104,6 +104,10 @@ export class Role extends base.Resource implements IRole {
       metadata: props.metadata,
       rules: Lazy.any({ produce: () => this.synthesizeRules() }),
     });
+
+    for (const rule of props.rules ?? []) {
+      this.allow(rule.verbs, ...rule.resources);
+    }
   }
 
   /**
@@ -546,4 +550,4 @@ export class ClusterRole extends base.Resource implements IClusterRole, IRole {
 
     return { clusterRoleSelectors: [{ matchLabels: this._labelSelector }] };
   }
-}
\ No newline at end of file
+}


Test patch:
diff --git a/test/role.test.ts b/test/role.test.ts
index d63180de..e2314754 100644
--- a/test/role.test.ts
+++ b/test/role.test.ts
@@ -154,6 +154,32 @@ Array [
 
   });
 
+  test('specify access from props', () => {
+
+    // GIVEN
+    const chart = Testing.chart();
+
+    // WHEN
+    new kplus.Role(chart, 'my-role', {
+      rules: [
+        {
+          verbs: ['get', 'list', 'watch'],
+          resources: [kplus.ApiResource.PODS],
+        },
+      ],
+    });
+
+    // THEN
+    const manifest = Testing.synth(chart);
+    expect(manifest[0].rules).toEqual(expect.arrayContaining([
+      {
+        apiGroups: [''],
+        resources: ['pods'],
+        verbs: ['get', 'list', 'watch'],
+      },
+    ]));
+  });
+
   test('giving access to a single pod and all pods still gives access to all pods', () => {
 
     // GIVEN
@@ -546,4 +572,4 @@ Object {
 
   });
 
-});
\ No newline at end of file
+});