cleanup return if appliedmainfestWork is notfound (#312)

Signed-off-by: Zhiwei Yin <zyin@redhat.com>

Signed-off-by: Zhiwei Yin <zyin@redhat.com>
This commit is contained in:
Zhiwei Yin
2023-01-19 11:06:02 +08:00
committed by GitHub
parent 8033805662
commit 539b6ee334

View File

@@ -167,6 +167,9 @@ func (r *managedReconcile) clean(ctx context.Context, klusterlet *operatorapiv1.
// the hash of the given hub host.
func (r *managedReconcile) cleanUpAppliedManifestWorks(ctx context.Context, klusterlet *operatorapiv1.Klusterlet, config klusterletConfig) error {
appliedManifestWorks, err := r.managedClusterClients.appliedManifestWorkClient.List(ctx, metav1.ListOptions{})
if errors.IsNotFound(err) {
return nil
}
if err != nil {
return fmt.Errorf("unable to list AppliedManifestWorks: %w", err)
}