Skip to content

Commit

Permalink
webhook fixup
Browse files Browse the repository at this point in the history
The webhook was being overwritten and not used.
The actual implementation was too aggressive, in not allowing apps with
no version i.e. versionlabel = "" to go through

This fixes both
  • Loading branch information
coconutruben committed Jul 21, 2023
1 parent 11cc795 commit ca764ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions src/app_charts/base/cloud/app-management.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@ webhooks:
resources:
- apps
sideEffects: None
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: app-rollout-controller
annotations:
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/app-rollout-controller
webhooks:
- name: approllouts.apps.cloudrobotics.com
admissionReviewVersions: ["v1"]
failurePolicy: Fail
Expand Down
2 changes: 1 addition & 1 deletion src/go/pkg/controller/approllout/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ func appValidate(cur *apps.App) error {
appName, anok := cur.Labels[labelAppName]
appVersion, avok := cur.Labels[labelAppVersion]
if anok {
if avok {
if avok && appVersion != "" {
// both name and version are defined
ename := strings.ToLower(fmt.Sprintf("%s.v%s", appName, appVersion))
if ename != name {
Expand Down

0 comments on commit ca764ee

Please sign in to comment.