Skip to content

Commit

Permalink
Remove ownerReferences from create to avoid pkgrevs getting DeletionT…
Browse files Browse the repository at this point in the history
…imestamps from k8s
  • Loading branch information
kushnaidu committed Aug 19, 2024
1 parent a358f84 commit 6b3da56
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions pkg/meta/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,15 @@ func (c *crdMetadataStore) Create(ctx context.Context, pkgRevMeta PackageRevisio
}
labels[PkgRevisionRepoLabel] = repoName

ownerReferences := append(pkgRevMeta.OwnerReferences, metav1.OwnerReference{
APIVersion: packageRevisionGVK.GroupVersion().String(),
Kind: packageRevisionGVK.Kind,
Name: pkgRevMeta.Name,
UID: pkgRevUID,
})

finalizers := append(pkgRevMeta.Finalizers, PkgRevisionFinalizer)

internalPkgRev := internalapi.PackageRev{
ObjectMeta: metav1.ObjectMeta{
Name: pkgRevMeta.Name,
Namespace: pkgRevMeta.Namespace,
Labels: labels,
Annotations: pkgRevMeta.Annotations,
Finalizers: finalizers,
OwnerReferences: ownerReferences,
Name: pkgRevMeta.Name,
Namespace: pkgRevMeta.Namespace,
Labels: labels,
Annotations: pkgRevMeta.Annotations,
Finalizers: finalizers,
},
}
klog.Infof("Creating packagerev %s/%s", internalPkgRev.Namespace, internalPkgRev.Name)
Expand Down

0 comments on commit 6b3da56

Please sign in to comment.