-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pepr operator derived netpol name collisions (#480)
## Description Fixes network policy naming bug that caused name collisions for operator derived network policies. This causes network policies being created for VirtualServices using the same selector and gateway but different ports to be dropped. Multiple legitimate policies would override each other and only the last would survive. There are still gaps in the fundamentals of naming and validation that I came across on different iterations on solutions for this. I will be creating a follow on issue for a deeper dive into that though. This is a small improvement that fixes a specific issue. ... ## Related Issue Fixes #466 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Other (security config, docs update, etc) ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md)(https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md#submitting-a-pull-request) followed
- Loading branch information
1 parent
f967f9a
commit de60e25
Showing
6 changed files
with
86 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,93 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: test-app | ||
name: test-tenant-app | ||
--- | ||
apiVersion: uds.dev/v1alpha1 | ||
kind: Package | ||
metadata: | ||
name: httpbin | ||
namespace: test-app | ||
name: test-tenant-app | ||
namespace: test-tenant-app | ||
spec: | ||
network: | ||
expose: | ||
- service: httpbin | ||
- service: test-tenant-app | ||
selector: | ||
app: httpbin | ||
app: test-tenant-app | ||
gateway: tenant | ||
host: demo | ||
port: 8000 | ||
targetPort: 80 | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: httpbin | ||
namespace: test-app | ||
host: demo-8080 | ||
port: 8080 | ||
- service: test-tenant-app | ||
selector: | ||
app: test-tenant-app | ||
gateway: tenant | ||
host: demo-8081 | ||
port: 8081 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: httpbin | ||
namespace: test-app | ||
name: test-tenant-app | ||
namespace: test-tenant-app | ||
labels: | ||
app: httpbin | ||
service: httpbin | ||
app: test-tenant-app | ||
service: test-tenant-app | ||
spec: | ||
ports: | ||
- name: http | ||
port: 8000 | ||
targetPort: 80 | ||
- name: port8080 | ||
port: 8080 | ||
targetPort: 8080 | ||
- name: port8081 | ||
port: 8081 | ||
targetPort: 8081 | ||
selector: | ||
app: httpbin | ||
app: test-tenant-app | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: httpbin | ||
namespace: test-app | ||
name: http-echo-multi-port | ||
namespace: test-tenant-app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: httpbin | ||
version: v1 | ||
app: test-tenant-app | ||
template: | ||
metadata: | ||
labels: | ||
app: httpbin | ||
version: v1 | ||
app: test-tenant-app | ||
spec: | ||
serviceAccountName: httpbin | ||
containers: | ||
- image: docker.io/kong/httpbin | ||
- name: http-echo-port-8080 | ||
image: hashicorp/http-echo | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- "-text=Hello from port 8080" | ||
- "-status-code=200" | ||
- "-listen=:8080" | ||
resources: | ||
limits: | ||
cpu: 50m | ||
memory: 64Mi | ||
requests: | ||
cpu: 50m | ||
memory: 64Mi | ||
ports: | ||
- containerPort: 8080 | ||
- name: http-echo-port-8081 | ||
image: hashicorp/http-echo | ||
imagePullPolicy: IfNotPresent | ||
name: httpbin | ||
args: | ||
- "-text=Hello from port 8081" | ||
- "-status-code=200" | ||
- "-listen=:8081" | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 128Mi | ||
cpu: 50m | ||
memory: 64Mi | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
cpu: 50m | ||
memory: 64Mi | ||
ports: | ||
- containerPort: 80 | ||
- containerPort: 8081 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters