Skip to content

Commit

Permalink
Merge pull request projectsveltos#578 from gianlucam76/customsplit-test
Browse files Browse the repository at this point in the history
Extend customSplit test
  • Loading branch information
gianlucam76 authored Jun 10, 2024
2 parents 4c6df06 + b5f8baf commit 4ab8294
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions controllers/handlers_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,40 @@ var _ = Describe("HandlersUtils", func() {
sections, err = controllers.CustomSplit(piraeus)
Expect(err).To(BeNil())
Expect(len(sections)).To(Equal(3))

multipleResources := `
apiVersion: v1
kind: Service
metadata:
labels:
app: nats
tailscale.com/proxy-class: default
annotations:
tailscale.com/tailnet-fqdn: nats-cluster-1
name: nats-cluster-1
spec:
externalName: placeholder
type: ExternalName
---
apiVersion: v1
kind: Service
metadata:
labels:
app: nats
tailscale.com/proxy-class: default
annotations:
tailscale.com/tailnet-fqdn: nats-cluster-2
name: nats-cluster-2
spec:
externalName: placeholder
type: ExternalName
---
`
sections, err = controllers.CustomSplit(multipleResources)
Expect(err).To(BeNil())
Expect(len(sections)).To(Equal(2))
})

It("canDelete returns false when ClusterProfile is not referencing the policies anymore", func() {
Expand Down

0 comments on commit 4ab8294

Please sign in to comment.