Skip to content

Commit

Permalink
Revert "Add service intentions as CRDs"
Browse files Browse the repository at this point in the history
This reverts commit 1965c1a.
  • Loading branch information
Ashwin Venkatesh committed Dec 7, 2021
1 parent 1965c1a commit 249e5dc
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 98 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- ../../../bases/partitions/exportedservices-default
- ../../../bases/exportedservices-default

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- ../../../bases/partitions/exportedservices-default
- ../../../bases/exportedservices-default

patchesStrategicMerge:
- patch.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- ../../../bases/partitions/exportedservices-secondary
- ../../../bases/exportedservices-secondary

patchesStrategicMerge:
- patch.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources:
- ../../../bases/partitions/exportedservices-secondary
- ../../../bases/exportedservices-secondary

patchesStrategicMerge:
- patch.yaml
41 changes: 26 additions & 15 deletions acceptance/tests/partitions/partitions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,22 +604,33 @@ func TestPartitions(t *testing.T) {
k8s.CheckStaticServerConnectionFailing(t, clientClusterStaticClientOpts, "http://localhost:1234")
}

logger.Log(t, "creating intention")
if c.destinationNamespace == defaultNamespace {
k8s.KubectlApplyK(t, serverClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-default-default")
k8s.KubectlApplyK(t, clientClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-secondary-default")
helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() {
k8s.KubectlDeleteK(t, serverClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-default-default")
k8s.KubectlDeleteK(t, clientClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-secondary-default")
})
} else {
k8s.KubectlApplyK(t, serverClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-default-namespaces")
k8s.KubectlApplyK(t, clientClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-secondary-namespaces")
helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() {
k8s.KubectlDeleteK(t, serverClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-default-namespaces")
k8s.KubectlDeleteK(t, clientClusterContext.KubectlOptions(t), "../fixtures/cases/crd-partitions/intentions-secondary-namespaces")
})
intention := &api.ServiceIntentionsConfigEntry{
Name: staticServerName,
Kind: api.ServiceIntentions,
Namespace: staticServerNamespace,
Sources: []*api.SourceIntention{
{
Name: staticClientName,
Namespace: staticClientNamespace,
Action: api.IntentionActionAllow,
},
},
}

// Set the destination namespace to be the same
// unless mirrorK8S is true.
if !c.mirrorK8S {
intention.Namespace = c.destinationNamespace
intention.Sources[0].Namespace = c.destinationNamespace
}

logger.Log(t, "creating intention")
intention.Sources[0].Partition = secondaryPartition
_, _, err := consulClient.ConfigEntries().Set(intention, &api.WriteOptions{Partition: defaultPartition})
require.NoError(t, err)
intention.Sources[0].Partition = defaultPartition
_, _, err = consulClient.ConfigEntries().Set(intention, &api.WriteOptions{Partition: secondaryPartition})
require.NoError(t, err)
}

logger.Log(t, "checking that connection is successful")
Expand Down

0 comments on commit 249e5dc

Please sign in to comment.