We cannot terminate namespaces that have accountclaim.aws.managed.openshift.io objects on them.
Finalizers are arbitrary string values, that when present ensure that a hard delete of a resource is not possible while they exist.
The first delete request on an object with finalizers sets a value for the metadata.deletionTimestamp field but does not delete it. Once this value is set, entries in the finalizer list can only be removed.
tl;dr if the finalizer does not succeed, the object cannot be deleted.
In this case we have an object in the namespaces that are to be terminated:
# kubectl get accountclaim.aws.managed.openshift.io/mycluster -o yaml
apiVersion: aws.managed.openshift.io/v1alpha1
kind: AccountClaim
metadata:
creationTimestamp: 2019-08-06T10:01:22Z
deletionGracePeriodSeconds: 0
deletionTimestamp: 2019-08-06T10:48:15Z
finalizers:
- finalizer.aws.managed.openshift.io
once we remove the finalizer from this object, it can be removed and the namespace can be terminated.
{"level":"error","ts":1565089405.1570218,"logger":"controller_accountclaim","msg":"Failed to get claimed account","Request.Namespace":"REDACTED_FOR_ISSUE","Request.Name":"mycluster","error":"Account.aws.managed.openshift.io \"\" not found","stacktrace":"github.com/openshift/aws-account-operator/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\tsrc/github.com/openshift/aws-account-operator/vendor/github.com/go-logr/zapr/zapr.go:128\ngithub.com/openshift/aws-account-operator/pkg/controller/accountclaim.(*ReconcileAccountClaim).Reconcile\n\tsrc/github.com/openshift/aws-account-operator/pkg/controller/accountclaim/accountclaim_controller.go:127\ngithub.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsrc/github.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:215\ngithub.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\tsrc/github.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:158\ngithub.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tsrc/github.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\ngithub.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tsrc/github.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134\ngithub.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\tsrc/github.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}
{"level":"error","ts":1565089405.1570847,"logger":"kubebuilder.controller","msg":"Reconciler error","controller":"accountclaim-controller","request":"REDACTED_FOR_ISSUEr","error":"Secret \"aws\" not found","stacktrace":"github.com/openshift/aws-account-operator/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\tsrc/github.com/openshift/aws-account-operator/vendor/github.com/go-logr/zapr/zapr.go:128\ngithub.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsrc/github.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:217\ngithub.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\tsrc/github.com/openshift/aws-account-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:158\ngithub.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tsrc/github.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\ngithub.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tsrc/github.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134\ngithub.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait.Until\n\tsrc/github.com/openshift/aws-account-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}"