argocd-operator
argocd-operator copied to clipboard
Fix that new host name isn't applied to ingress
trafficstars
What type of PR is this? /kind bug
What does this PR do / why we need it:
Fixed a problem where changes to .spec.server.host in the ArgoCD CR were not reflected in the Ingress resource by changing the order of processing in reconcileArgoServerIngress().
Have you updated the necessary documentation?
- [ ] Documentation update is required by this PR.
- [ ] Documentation has been updated.
Which issue(s) this PR fixes:
Fixes #558
How to test changes / Special notes to the reviewer:
I have added a test scenario in ingress_test.go. You can be verified by a test run.
If you want to check manually, you can do so as follows.
$ cat <<EOF | kubectl apply -f -
apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
name: argocd-sample
spec:
server:
host: before.example.com
ingress:
enabled: true
EOF
argocd.argoproj.io/argocd-sample configured
$ kubectl get ingress argocd-sample-server -o yaml
...
spec:
rules:
- host: before.example.com
http:
paths:
- backend:
service:
name: argocd-sample-server
port:
name: http
path: /
pathType: ImplementationSpecific
tls:
- hosts:
- before.example.com
secretName: argocd-secret
$ cat <<EOF | kubectl apply -f -
apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
name: argocd-sample
spec:
server:
host: after.example.com
ingress:
enabled: true
EOF
argocd.argoproj.io/argocd-sample configured
$ kubectl get ingress argocd-sample-server -o yaml
...
spec:
rules:
- host: after.example.com
http:
paths:
- backend:
service:
name: argocd-sample-server
port:
name: http
path: /
pathType: ImplementationSpecific
tls:
- hosts:
- after.example.com
secretName: argocd-secret
bump. this also applies to HTTPRoutes from the Kubernetes Gateway API