Skip to content

Commit

Permalink
Move defer before the apply (#815)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbuto authored Mar 17, 2021
1 parent 6f5944e commit a53c621
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/k8s/replicaset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func TestGetReplicaSets(t *testing.T) {
uniqueID := strings.ToLower(random.UniqueId())
options := NewKubectlOptions("", "", uniqueID)
configData := fmt.Sprintf(EXAMPLE_REPLICASET_YAML_TEMPLATE, uniqueID, uniqueID)
KubectlApplyFromString(t, options, configData)
defer KubectlDeleteFromString(t, options, configData)
KubectlApplyFromString(t, options, configData)

replicaSet := GetReplicaSet(t, options, "sample-rs")
require.Equal(t, replicaSet.Name, "sample-rs")
Expand All @@ -47,8 +47,8 @@ func TestListReplicaSets(t *testing.T) {
uniqueID := strings.ToLower(random.UniqueId())
options := NewKubectlOptions("", "", uniqueID)
configData := fmt.Sprintf(EXAMPLE_REPLICASET_YAML_TEMPLATE, uniqueID, uniqueID)
KubectlApplyFromString(t, options, configData)
defer KubectlDeleteFromString(t, options, configData)
KubectlApplyFromString(t, options, configData)

replicaSets := ListReplicaSets(t, options, metav1.ListOptions{})
require.Equal(t, len(replicaSets), 1)
Expand Down

0 comments on commit a53c621

Please sign in to comment.