Environment:
OCP: 4.8.9
GitOps: 1.3.2
Trying to delete the resources "kind: Template" it gives a "the server could not find the requested resource" even when marking "Prune" when syncing manually. I tried removing other resources like namespaces without issues. Here are the steps to reproduce the behaviour:
Creating a template.yaml with the following(Already tried with namespace on the yaml too since I thought the problem could be due to that but not.. ):
~~~
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: redis-template-gitops
annotations:
description: "Description"
iconClass: "icon-redis"
tags: "database,nosql"
objects:
- apiVersion: v1
kind: Pod
metadata:
name: redis-master
spec:
containers: - env:
- name: REDIS_PASSWORD
value: ${REDIS_PASSWORD}
image: dockerfile/redis
name: master
ports: - containerPort: 6379
protocol: TCP
parameters: - description: Password used for Redis authentication
from: '[A-Z0-9] {8}'
generate: expression
name: REDIS_PASSWORD
labels:
redis: master
~~~
Creating an App on ArgoCD:
~~~
project: default
source:
repoURL: 'https://github.com/NelsonLomboPaez/testnamespace'
path: test
targetRevision: HEAD
destination:
server: 'https://kubernetes.default.svc'
namespace: testdos
syncPolicy:
syncOptions:
- PruneLast=true
~~~
Click on Sync and the template is created on the "testdos" namespace:
~~~
$ oc get template -n testdos
NAME DESCRIPTION PARAMETERS OBJECTS
redis-template-gitops-testdos Description 1 (1 generated) 1
~~~
Then modify the repository removing the yaml and creating a new one or updating the content, in this case it was modify to add a label to a namespace:
~~~
apiVersion: v1
kind: Namespace
metadata:
name: test
labels:
argocd.argoproj.io/managed-by: openshift-gitops
~~~
After marking the sync button with "Prune" and "Prune Last" the error is the following:
~~~
the server could not find the requested resource
~~~
But the resource is still present on the cluster:
~~~
$ oc get template -n testdos
NAME DESCRIPTION PARAMETERS OBJECTS
redis-template-gitops-testdos Description 1 (1 generated) 1
~~~
So it's not able to delete the kind:template. The same mechanism works when deleting a Namespace for example. At first, I thought it could be because of the template.yaml didn't have the namespace on the yaml but I tried and the behaviour is the same, not sure if there is any limitation on Templates or if I'm doing something wrong, If its needed any clarification, please, feel free to ping me.
Thank you very much!
Regards,
- duplicates
-
GITOPS-1671 argoCD integrated with github repo
- Closed
- mentioned on