Skip to content

Commit

Permalink
Merge pull request quarkusio#27825 from Sgitario/kubernetes_fix_stateful
Browse files Browse the repository at this point in the history
Kubernetes: Add default template.metadata in StatefulSet resource
  • Loading branch information
geoand authored Sep 9, 2022
2 parents 83c210b + f92c4ea commit cf0cbca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ private void initStatefulSetResourceWithDefaults(StatefulSetBuilder builder) {
.editOrNewTemplate()
.editOrNewSpec()
.endSpec()
.editOrNewMetadata()
.endMetadata()
.endTemplate();

// defaults for:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public void assertGeneratedResources() throws IOException {
assertThat(podSpec.getTerminationGracePeriodSeconds()).isEqualTo(10);
assertThat(podSpec.getContainers()).allMatch(c -> APP_NAME.equals(c.getName()));
});
assertThat(t.getMetadata()).satisfies(metadata -> {
assertThat(metadata.getLabels()).containsEntry("app.kubernetes.io/name", APP_NAME);
});
});
assertThat(statefulSetSpec.getSelector()).satisfies(ls -> {
assertThat(ls.getMatchLabels()).containsEntry("app.kubernetes.io/name", APP_NAME);
Expand Down

0 comments on commit cf0cbca

Please sign in to comment.