Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete-everything-openshift.sh does not delete Application Operator #94

Closed
deleeuwblue opened this issue Jun 13, 2022 · 5 comments
Closed
Assignees

Comments

@deleeuwblue
Copy link
Member

Issue:
The script runs to completion but the Application operator and CRD remain.

Log file:

pw%
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go % pwd
/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go % cd operator-database
oc apply -f config/samples/database.sample_v1alpha1_databasecluster.yaml
Warning: oc apply should be used on resource created by either oc create --save-config or oc apply
namespace/database configured
Warning: oc apply should be used on resource created by either oc create --save-config or oc apply
databasecluster.database.sample.third.party/databasecluster-sample configured
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-database % kubectl create job --from=cronjob/application-scaler manuallytriggered -n application-beta
job.batch/manuallytriggered created
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-database % pwd
/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/operator-database
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-database % cd ..
deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go % sh scripts/delete-everything-openshift.sh


Init logfile delete-all-openshift.log



Delete prometheus configuration


clusterrole.rbac.authorization.k8s.io "prometheus-k8s-role" deleted
clusterrolebinding.rbac.authorization.k8s.io "prometheus-k8s-rolebinding-olm" deleted
clusterrole.rbac.authorization.k8s.io "application-scaler-role" deleted
clusterrolebinding.rbac.authorization.k8s.io "application-scaler-rolebinding" deleted
*** delete secrets
warning: --force is ignored because --grace-period is not 0.
secret "prometheus-token-secret" deleted
warning: --force is ignored because --grace-period is not 0.
secret "prometheus-cert-secret" deleted
Error from server (NotFound): secrets "prometheus-token-secret" not found
Error from server (NotFound): secrets "prometheus-cert-secret" not found


Delete for ci configuration



Delete microservice application (ci)


namespace "application-beta" deleted
application.application.sample.ibm.com "application" deleted
namespace "application-alpha" deleted
Error from server (NotFound): error when deleting "config/samples/application.sample_v1alpha1_application.yaml": applications.application.sample.ibm.com "application" not found
No resources found in application-beta namespace.
No resources found in application-alpha namespace.
No resources found in application-beta namespace.
No resources found in application-alpha namespace.


Delete database instance (ci)


*** delete database instances
database.database.sample.third.party "database" deleted
Error from server (NotFound): error when deleting "config/samples/database.sample_v1alpha1_databasebackup.yaml": databasebackups.database.sample.third.party "databasebackup-manual" not found
namespace "database" deleted
databasecluster.database.sample.third.party "databasecluster-sample" deleted
Error from server (NotFound): namespaces "database" not found


Delete database operator (ci)


*** delete subcription and catalogsource
error: the path "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml" does not exist
error: the path "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml" does not exist
*** delete customresourcedefinition
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
customresourcedefinition.apiextensions.k8s.io "databasebackups.database.sample.third.party" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
customresourcedefinition.apiextensions.k8s.io "databases.database.sample.third.party" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
customresourcedefinition.apiextensions.k8s.io "databaseclusters.database.sample.third.party" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
operator.operators.coreos.com "operator-database.openshift-operators" force deleted
*** delete deployment in namespace: openshift-operators
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
deployment.apps "operator-database-controller-manager" force deleted
*** delete deployment
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
clusterrole.rbac.authorization.k8s.io "operator-database-metrics-reader" force deleted


Delete OLM deployments (ci)


subscription.operators.coreos.com "operator-application-v0-0-1-sub" deleted
catalogsource.operators.coreos.com "operator-application-catalog" deleted
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h17m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h17m
openshift-marketplace operator-database-catalog IBM Build Labs Database Catalog grpc IBM Build Labs 4h33m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h17m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h17m
NAMESPACE NAME PACKAGE SOURCE CHANNEL
openshift-operators operator-database-v0-0-1-sub operator-database operator-database-catalog alpha
*** delete subscription and catalogsource application
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): subscriptions.operators.coreos.com "operator-application-v0-0-1-sub" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): catalogsources.operators.coreos.com "operator-application-catalog" not found
Error: unknown shorthand flag: 'a' in -all-namespaces

Usage:
oc get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]

Examples:

List all pods in ps output format.

oc get pods

List all pods in ps output format with more information (such as node name).

oc get pods -o wide

List a single replication controller with specified NAME in ps output format.

oc get replicationcontroller web

List deployments in JSON output format, in the "v1" version of the "apps" API group:

oc get deployments.v1.apps -o json

List a single pod in JSON output format.

oc get -o json pod web-pod-13je7

List a pod identified by type and name specified in "pod.yaml" in JSON output format.

oc get -f pod.yaml -o json

List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml.

oc get -k dir/

Return only the phase value of the specified pod.

oc get -o template pod/web-pod-13je7 --template={{.status.phase}}

List resource information in custom columns.

oc get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image

List all replication controllers and services together in ps output format.

oc get rc,services

List one or more resources by their type and names.

oc get rc/web service/frontend pods/web-pod-13je7

Options:
-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
--allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.
--ignore-not-found=false: If the requested object does not exist the command will return exit code 0.
-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.
-L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...
--no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).
-o, --output='': Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
--raw='': Raw URI to request from the server. Uses the transport specified by the kubeconfig file.
-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
--server-print=true: If true, have the server return the appropriate table output. Supports extension APIs and CRDs.
--show-kind=false: If present, list the resource type for the requested object(s).
--show-labels=false: When printing, show all labels as the last column (default hide labels column)
--sort-by='': If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
--template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
-w, --watch=false: After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.
--watch-only=false: Watch for changes to the requested object(s), without listing/getting first.

Use "oc options" for a list of global command-line options (applies to all commands).

grep: openshift-marketplace: No such file or directory
*** delete subscription and catalogsource database
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
subscription.operators.coreos.com "operator-database-v0-0-1-sub" force deleted
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
catalogsource.operators.coreos.com "operator-database-catalog" force deleted
No resources found.
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h17m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h17m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h17m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h17m
*** delete clusterserviceversion database
warning: --force is ignored because --grace-period is not 0.
clusterserviceversion.operators.coreos.com "operator-database.v0.0.1" deleted
grep: openshift-operators: No such file or directory
*** delete cluster service versions


Check operator-database.v0.0.1
*** Status:
2022-06-13 15:17:26 Status: operator-database.v0.0.1 is deleted

*** delete subscription and catalogsource database
Error from server (NotFound): error when deleting "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml": subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
Error from server (NotFound): error when deleting "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml": catalogsources.operators.coreos.com "operator-database-catalog" not found
No resources found in openshift-operators namespace.
NAME DISPLAY TYPE PUBLISHER AGE
certified-operators Certified Operators grpc Red Hat 6h18m
community-operators Community Operators grpc Red Hat 6h18m
redhat-marketplace Red Hat Marketplace grpc Red Hat 6h18m
redhat-operators Red Hat Operators grpc Red Hat 6h18m
*** delete clusterserviceversion database
error: the path "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/bundle/manifests/operator-database.clusterserviceversion.yaml" does not exist
Error from server (NotFound): namespaces "application-beta" not found


Delete namespaces related to application operator (ci)


*** delete project application
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-alpha" not found
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-beta" not found


Check application-alpha
Error from server (NotFound): namespaces "application-alpha" not found
Status:
2022-06-13 15:17:32 Status: application-alpha is deleted


Check application-beta
Error from server (NotFound): namespaces "application-beta" not found
Status:
2022-06-13 15:17:33 Status: application-beta is deleted


Delete database application (ci)


*** delete project database
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "database" not found


Check database
Error from server (NotFound): namespaces "database" not found
Status:
2022-06-13 15:17:35 Status: database is deleted


Delete for local configuration



Delete microservice application (local)


Error from server (NotFound): error when deleting "config/samples/application.sample_v1beta1_application.yaml": namespaces "application-beta" not found
Error from server (NotFound): error when deleting "config/samples/application.sample_v1beta1_application.yaml": applications.application.sample.ibm.com "application" not found
Error from server (NotFound): error when deleting "config/samples/application.sample_v1alpha1_application.yaml": namespaces "application-alpha" not found
Error from server (NotFound): error when deleting "config/samples/application.sample_v1alpha1_application.yaml": applications.application.sample.ibm.com "application" not found
No resources found in application-beta namespace.
No resources found in application-alpha namespace.
No resources found in application-beta namespace.
No resources found in application-alpha namespace.


Delete database instance (local)


*** delete database instances
error: unable to recognize "config/samples/database.sample_v1alpha1_database.yaml": no matches for kind "Database" in version "database.sample.third.party/v1alpha1"
error: unable to recognize "config/samples/database.sample_v1alpha1_databasebackup.yaml": no matches for kind "DatabaseBackup" in version "database.sample.third.party/v1alpha1"
Error from server (NotFound): error when deleting "config/samples/database.sample_v1alpha1_databasecluster.yaml": namespaces "database" not found
unable to recognize "config/samples/database.sample_v1alpha1_databasecluster.yaml": no matches for kind "DatabaseCluster" in version "database.sample.third.party/v1alpha1"
error: the server doesn't have a resource type "databasecluster"


Delete database operator (local)


*** delete subcription and catalogsource
Error from server (NotFound): error when deleting "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml": subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
error: the path "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml" does not exist
*** delete customresourcedefinition
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "databasebackups.database.sample.third.party" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "databases.database.sample.third.party" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
warning: deleting cluster-scoped resources, not scoped to the provided namespace
Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "databaseclusters.database.sample.third.party" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
operator.operators.coreos.com "operator-database.openshift-operators" force deleted
*** delete deployment in namespace: openshift-operators
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): deployments.apps "operator-database-controller-manager" not found
*** delete deployment
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): clusterroles.rbac.authorization.k8s.io "operator-database-metrics-reader" not found


Delete OLM deployments (local)


Error from server (NotFound): error when deleting "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-application-subscription.yaml": subscriptions.operators.coreos.com "operator-application-v0-0-1-sub" not found
Error from server (NotFound): error when deleting "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-application-catalogsource.yaml": catalogsources.operators.coreos.com "operator-application-catalog" not found
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h18m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h18m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h18m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h18m
No resources found.
*** delete subscription and catalogsource application
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): subscriptions.operators.coreos.com "operator-application-v0-0-1-sub" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): catalogsources.operators.coreos.com "operator-application-catalog" not found
Error: unknown shorthand flag: 'a' in -all-namespaces

Usage:
oc get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]

Examples:

List all pods in ps output format.

oc get pods

List all pods in ps output format with more information (such as node name).

oc get pods -o wide

List a single replication controller with specified NAME in ps output format.

oc get replicationcontroller web

List deployments in JSON output format, in the "v1" version of the "apps" API group:

oc get deployments.v1.apps -o json

List a single pod in JSON output format.

oc get -o json pod web-pod-13je7

List a pod identified by type and name specified in "pod.yaml" in JSON output format.

oc get -f pod.yaml -o json

List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml.

oc get -k dir/

Return only the phase value of the specified pod.

oc get -o template pod/web-pod-13je7 --template={{.status.phase}}

List resource information in custom columns.

oc get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image

List all replication controllers and services together in ps output format.

oc get rc,services

List one or more resources by their type and names.

oc get rc/web service/frontend pods/web-pod-13je7

Options:
-A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
--allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
--chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
--field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
-f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.
--ignore-not-found=false: If the requested object does not exist the command will return exit code 0.
-k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.
-L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...
--no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).
-o, --output='': Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
--raw='': Raw URI to request from the server. Uses the transport specified by the kubeconfig file.
-R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
-l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
--server-print=true: If true, have the server return the appropriate table output. Supports extension APIs and CRDs.
--show-kind=false: If present, list the resource type for the requested object(s).
--show-labels=false: When printing, show all labels as the last column (default hide labels column)
--sort-by='': If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
--template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
-w, --watch=false: After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.
--watch-only=false: Watch for changes to the requested object(s), without listing/getting first.

Use "oc options" for a list of global command-line options (applies to all commands).

grep: openshift-marketplace: No such file or directory
*** delete subscription and catalogsource database
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (NotFound): catalogsources.operators.coreos.com "operator-database-catalog" not found
No resources found.
NAMESPACE NAME DISPLAY TYPE PUBLISHER AGE
openshift-marketplace certified-operators Certified Operators grpc Red Hat 6h19m
openshift-marketplace community-operators Community Operators grpc Red Hat 6h19m
openshift-marketplace redhat-marketplace Red Hat Marketplace grpc Red Hat 6h19m
openshift-marketplace redhat-operators Red Hat Operators grpc Red Hat 6h19m
*** delete clusterserviceversion database
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): clusterserviceversions.operators.coreos.com "operator-database.v0.0.1" not found
grep: openshift-operators: No such file or directory
*** delete cluster service versions


Check operator-database.v0.0.1
*** Status:
2022-06-13 15:18:35 Status: operator-database.v0.0.1 is deleted

*** delete subscription and catalogsource database
Error from server (NotFound): error when deleting "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-subscription.yaml": subscriptions.operators.coreos.com "operator-database-v0-0-1-sub" not found
Error from server (NotFound): error when deleting "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/scripts/openshift-database-catalogsource.yaml": catalogsources.operators.coreos.com "operator-database-catalog" not found
No resources found in openshift-operators namespace.
NAME DISPLAY TYPE PUBLISHER AGE
certified-operators Certified Operators grpc Red Hat 6h19m
community-operators Community Operators grpc Red Hat 6h19m
redhat-marketplace Red Hat Marketplace grpc Red Hat 6h19m
redhat-operators Red Hat Operators grpc Red Hat 6h19m
*** delete clusterserviceversion database
error: the path "/Users/deleeuw@uk.ibm.com/Documents/Work/Code/operator-sample-go-automationscript/operator-sample-go/bundle/manifests/operator-database.clusterserviceversion.yaml" does not exist
Error from server (NotFound): namespaces "application-beta" not found


Delete namespaces related to application operator (local)


*** delete project application
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-alpha" not found
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "application-beta" not found


Check application-alpha
Error from server (NotFound): namespaces "application-alpha" not found
Status:
2022-06-13 15:18:41 Status: application-alpha is deleted


Check application-beta
Error from server (NotFound): namespaces "application-beta" not found
Status:
2022-06-13 15:18:42 Status: application-beta is deleted


Delete database application (local)


*** delete project database
warning: --force is ignored because --grace-period is not 0.
Error from server (NotFound): namespaces "database" not found


Check database
Error from server (NotFound): namespaces "database" not found
Status:
2022-06-13 15:18:44 Status: database is deleted


Delete cert manager


customresourcedefinition.apiextensions.k8s.io "certificaterequests.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "certificates.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "challenges.acme.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "clusterissuers.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "issuers.cert-manager.io" deleted
customresourcedefinition.apiextensions.k8s.io "orders.acme.cert-manager.io" deleted
namespace "cert-manager" deleted
serviceaccount "cert-manager-cainjector" deleted
serviceaccount "cert-manager" deleted
serviceaccount "cert-manager-webhook" deleted
configmap "cert-manager-webhook" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-cainjector" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-issuers" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-clusterissuers" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-certificates" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-orders" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-challenges" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-ingress-shim" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-view" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-edit" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-approve:cert-manager-io" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-controller-certificatesigningrequests" deleted
clusterrole.rbac.authorization.k8s.io "cert-manager-webhook:subjectaccessreviews" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-cainjector" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-issuers" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-clusterissuers" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-certificates" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-orders" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-challenges" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-ingress-shim" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-approve:cert-manager-io" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-controller-certificatesigningrequests" deleted
clusterrolebinding.rbac.authorization.k8s.io "cert-manager-webhook:subjectaccessreviews" deleted
role.rbac.authorization.k8s.io "cert-manager-cainjector:leaderelection" deleted
role.rbac.authorization.k8s.io "cert-manager:leaderelection" deleted
role.rbac.authorization.k8s.io "cert-manager-webhook:dynamic-serving" deleted
rolebinding.rbac.authorization.k8s.io "cert-manager-cainjector:leaderelection" deleted
rolebinding.rbac.authorization.k8s.io "cert-manager:leaderelection" deleted
rolebinding.rbac.authorization.k8s.io "cert-manager-webhook:dynamic-serving" deleted
service "cert-manager" deleted
service "cert-manager-webhook" deleted
deployment.apps "cert-manager-cainjector" deleted
deployment.apps "cert-manager" deleted
deployment.apps "cert-manager-webhook" deleted
mutatingwebhookconfiguration.admissionregistration.k8s.io "cert-manager-webhook" deleted
validatingwebhookconfiguration.admissionregistration.k8s.io "cert-manager-webhook" deleted


Check cert-manager
Error from server (NotFound): namespaces "cert-manager" not found
Status:
2022-06-13 15:19:11 Status: cert-manager is deleted


All delete commands were executed


deleeuw@uk.ibm.com@Adams-MacBook-Pro operator-sample-go %

Link to the documentation:

@thomassuedbroecker
Copy link
Collaborator

thomassuedbroecker commented Jun 13, 2022

Issue is related to: #93

Commits:
ba41b00
c161117

@deleeuwblue
Copy link
Member Author

Hi @thomassuedbroecker I tested again. The script now successfully removes the Application Operator, but the Application CRD still remains.

@thomassuedbroecker
Copy link
Collaborator

@deleeuwblue This is fixed in this commit: 9c72777

@thomassuedbroecker
Copy link
Collaborator

@vishal-ramani can you please verify the fix?

@vishal-ramani
Copy link
Member

Verified this script is working in deleting all components along with CRDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants