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
2 changes: 1 addition & 1 deletion charts/postiz/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: postiz-app
description: A Social Media Scheduling App
type: application
version: 1.0.4
version: 1.0.5
appVersion: "1.3.0"
maintainers:
- name: jonathan-irvin
Expand Down
5 changes: 4 additions & 1 deletion charts/postiz/templates/postiz-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
name: {{ include "postiz.fullname" . }}-secrets
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.extraContainers }}
{{- toYaml .Values.extraContainers | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -69,4 +72,4 @@ spec:
{{- else }}
- name: uploads-volume
emptyDir: {}
{{- end }}
{{- end }}
5 changes: 4 additions & 1 deletion charts/postiz/templates/postiz-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if .Values.service.additionalPorts }}
{{- toYaml .Values.service.additionalPorts | nindent 4 }}
{{- end }}
Comment on lines +14 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Port name validation is needed for service configuration

The review comment is valid. After examining the codebase:

  1. The service template defines a default http port name
  2. additionalPorts is included without any validation
  3. No validation exists in _helpers.yaml or schema
  4. The default values.yaml shows additionalPorts as an empty array without example structure or documentation

Since Kubernetes requires unique port names within a service, and there's no validation mechanism in place, this could lead to runtime issues if users define additional ports with duplicate names.

  • Add validation in _helpers.yaml to check for unique port names
  • Document the additionalPorts structure in values.yaml with an example
  • Consider adding a values schema file (values.schema.json) with JSON Schema validation
🔗 Analysis chain

Consider adding validation for port names.

While the implementation is correct, there's no validation to ensure that port names in additionalPorts don't conflict with the default http port name. Duplicate port names could cause issues in service discovery.

Let's check if the chart has any validation for this:

Consider adding a helper template to validate port names or include validation in the schema file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for port name validation in the chart

# Look for any validation templates or helpers
fd -e yaml -e tpl "^_.*" charts/postiz/templates/

# Check if there's a schema file
fd "values.schema.json" charts/postiz/

Length of output: 128


Script:

#!/bin/bash
# Check the content of _helpers.yaml for any port validation
cat charts/postiz/templates/_helpers.yaml

# Check values.schema.json content for port validation
cat charts/postiz/values.schema.json

Length of output: 1918


Script:

#!/bin/bash
# Check the default values file to understand the service port structure
cat charts/postiz/values.yaml

# Check the complete service template to understand port configuration
cat charts/postiz/templates/postiz-service.yaml

Length of output: 2622

selector:
{{- include "postiz.selectorLabels" . | nindent 4 }}
{{- include "postiz.selectorLabels" . | nindent 4 }}
3 changes: 3 additions & 0 deletions charts/postiz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ securityContext: {}
service:
type: ClusterIP
port: 80
additionalPorts: []

ingress:
enabled: false # Disabled by default
Expand All @@ -44,6 +45,8 @@ ingress:

resources: {}

extraContainers: []

extraVolumes: []
extraVolumeMounts: []

Expand Down
Loading