Skip to content

Commit

Permalink
Create custom namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kravciak committed Nov 22, 2023
1 parent b6ff311 commit 11f3651
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions tests/e2e/40-policies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,12 @@ for (const PolicyPage of pageTypes) {
const ps: PolicyServer = { name: 'ps-custom' }
const p: Policy = { ...pMinimal, mode: 'Monitor', audit: 'Off', server: ps.name, module: 'ghcr.io/kubewarden/policies/pod-privileged:v0.2.6' }

if (isAP(polPage)) p.namespace = 'ns-custom'

// Create custom server
const psPage = new PolicyServersPage(page)
await psPage.create(ps)

// Create custom namespace
if (isAP(polPage)) {
p.namespace = 'ns-custom'
await shell.run(`k create ns ${p.namespace}`)
}

// Create and check policy
const row = await polPage.create(p)
await checkPolicy(p, polPage, ui)
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/pages/policies.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export class AdmissionPoliciesPage extends BasePolicyPage {
}

async setNamespace(namespace: string) {
await this.ui.select('Namespace*', namespace)
await this.ui.select('Namespace*', /^Create a [nN]ew Namespace$/)
await this.ui.input('Namespace*').fill(namespace)
}

@step
Expand Down

0 comments on commit 11f3651

Please sign in to comment.