Skip to content

Commit

Permalink
Remove unused func HasDeletionTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
timebertt committed Jan 29, 2021
1 parent 9005595 commit 914d2fd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
5 changes: 0 additions & 5 deletions pkg/utils/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ func HasMetaDataAnnotation(meta metav1.Object, key, value string) bool {
return ok && val == value
}

// HasDeletionTimestamp checks if an object has a deletion timestamp
func HasDeletionTimestamp(obj client.Object) bool {
return obj.GetDeletionTimestamp() != nil
}

func nameAndNamespace(namespaceOrName string, nameOpt ...string) (namespace, name string) {
if len(nameOpt) > 1 {
panic(fmt.Sprintf("more than name/namespace for key specified: %s/%v", namespaceOrName, nameOpt))
Expand Down
17 changes: 0 additions & 17 deletions pkg/utils/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,6 @@ var _ = Describe("kubernetes", func() {
})
})

Describe("#HasDeletionTimestamp", func() {
var namespace = &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
},
}
It("should return false if no deletion timestamp is set", func() {
Expect(HasDeletionTimestamp(namespace)).To(BeFalse())
})

It("should return true if timestamp is set", func() {
now := metav1.Now()
namespace.ObjectMeta.DeletionTimestamp = &now
Expect(HasDeletionTimestamp(namespace)).To(BeTrue())
})
})

Describe("#CreateTwoWayMergePatch", func() {
It("should fail for two different object types", func() {
_, err := CreateTwoWayMergePatch(&corev1.ConfigMap{}, &corev1.Secret{})
Expand Down

0 comments on commit 914d2fd

Please sign in to comment.