Skip to content

Commit

Permalink
Add expected annotations/labels to PodBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
multimac committed Jul 2, 2021
1 parent 1ea5f2e commit 6b7de05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chaoskube/chaoskube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ func (suite *Suite) setupWithPods(interval time.Duration, labelSelector labels.S
pods := []v1.Pod{
util.NewPodBuilder("default", "foo").Build(),
util.NewPodBuilder("testing", "bar").Build(),
util.NewPodBuilder("testing", "baz").Build(), // Non-running pods are ignored
util.NewPodBuilder("testing", "baz").WithPhase(v1.PodPending).Build(), // Non-running pods are ignored
}

for _, pod := range pods {
Expand Down
6 changes: 3 additions & 3 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
Kitchen24 = "15:04"
// a time format that just cares about the day and month.
YearDay = "Jan_2"

// default annotation prefix for configuration overrides
DefaultBaseAnnotation = "chaos.alpha.kubernetes.io"
)

Expand Down Expand Up @@ -212,8 +212,8 @@ func NewPodBuilder(namespace string, name string) PodBuilder {
Phase: v1.PodRunning,
CreationTime: nil,
OwnerReference: nil,
Annotations: make(map[string]string),
Labels: make(map[string]string),
Annotations: map[string]string{"chaos": name},
Labels: map[string]string{"app": name},
}
}

Expand Down

0 comments on commit 6b7de05

Please sign in to comment.