Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/server/services/network-policy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ class NetworkPolicyService {
return {
ingress: [{
from: [{
namespaceSelector: {
matchLabels: {
'kubernetes.io/metadata.name': Constants.QS_NAMESPACE,
},
},
podSelector: {
matchLabels: {
app: QS_AUTH_PROXY_SERVICE_NAME,
Expand Down
7 changes: 6 additions & 1 deletion src/server/services/network-policy.service.unit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ describe('network-policy.service', () => {
);
});

it('allows ingress from auth proxy to all sandbox ports', () => {
it('allows auth proxy ingress from the quickstack namespace to all sandbox ports', () => {
const policy = networkPolicyService.buildAgentSandboxTemplateNetworkPolicy({
allowInternetAccess: false,
rules: [],
});

expect(policy?.ingress).toEqual([{
from: [{
namespaceSelector: {
matchLabels: {
'kubernetes.io/metadata.name': 'quickstack',
},
},
podSelector: {
matchLabels: {
app: 'qs-auth-proxy',
Expand Down
Loading