Skip to content

Commit

Permalink
Introduce ResAccumulator.
Browse files Browse the repository at this point in the history
  • Loading branch information
monopole committed Jan 4, 2019
1 parent aeb2adb commit 50a8b27
Show file tree
Hide file tree
Showing 10 changed files with 508 additions and 217 deletions.
3 changes: 3 additions & 0 deletions pkg/target/baseandoverlaymedium_test.go
Expand Up @@ -211,6 +211,9 @@ spec:
if err != nil {
t.Fatalf("Err: %v", err)
}
// TODO(#669): The name of the patched Deployment is
// test-infra-baseprefix-mungebot, retaining the base
// prefix (example of correct behavior).
th.assertActualEqualsExpected(m, `
apiVersion: v1
data:
Expand Down
3 changes: 3 additions & 0 deletions pkg/target/baseandoverlaysmall_test.go
Expand Up @@ -136,6 +136,9 @@ spec:
if err != nil {
t.Fatalf("Err: %v", err)
}
// TODO(#669): The name of the patched Deployment is
// b-a-myDeployment, retaining the base prefix
// (example of correct behavior).
th.assertActualEqualsExpected(m, `
apiVersion: v1
kind: Service
Expand Down
6 changes: 3 additions & 3 deletions pkg/target/crd_test.go
Expand Up @@ -293,7 +293,7 @@ spec:
if err != nil {
t.Fatalf("Err: %v", err)
}
// TODO(#605): Some output here is wrong due to #605
// TODO(#669): Bee's name should be "prod-x-bee", not "prod-bee".
th.assertActualEqualsExpected(m, `
apiVersion: v1
data:
Expand All @@ -308,9 +308,9 @@ metadata:
name: prod-x-mykind
spec:
beeRef:
name: bee
name: prod-bee
secretRef:
name: crdsecret
name: prod-x-crdsecret
---
apiVersion: v1beta1
kind: Bee
Expand Down
21 changes: 7 additions & 14 deletions pkg/target/customconfig_test.go
Expand Up @@ -221,9 +221,7 @@ spec:
`)
}

// TODO: Test demonstrates bug #605.
// The customization supplied in a base isn't available to the overlay.
func TestBug605(t *testing.T) {
func TestFixedBug605_BaseCustomizationAvailableInOverlay(t *testing.T) {
th := NewKustTestHarness(t, "/app/overlay")
makeBaseReferencingCustomConfig(th)
th.writeDefaultConfigs("/app/base/config/defaults.yaml")
Expand Down Expand Up @@ -274,13 +272,8 @@ spec:
if err != nil {
t.Fatalf("Err: %v", err)
}
// Problems in the expected result:
// - The variables are not replaced in the "food" fields.
// - The name of the AnimalPark should be x-o-sandiego, since
// AnimalPark appears in the base.
// - The giraffe and gorilla name are incorrect in AnimalPark;
// they should be o-x-april and o-ursus respectively. The
// Gorilla ursus doesn't get an x because it's not in the base.
// TODO(#669): The name of AnimalPark should be x-o-sandiego,
// not o-sandiego, since AnimalPark appears in the base.
th.assertActualEqualsExpected(m, `
kind: AnimalPark
metadata:
Expand All @@ -290,12 +283,12 @@ metadata:
name: o-sandiego
spec:
food:
- $(APRIL_DIET)
- $(KOKO_DIET)
- mimosa
- bambooshoots
giraffeRef:
name: april
name: o-x-april
gorillaRef:
name: ursus
name: o-ursus
---
kind: Giraffe
metadata:
Expand Down

0 comments on commit 50a8b27

Please sign in to comment.