-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Order the env vars converted from annotations (#164)
This fixes a bug when spec.annotations has multiple annotations. Each annotation is converted to an environment variable in the server container. Prior to this fix, if you had multiple annotations defined the StatefulSet we generate each reconcile cycle could change. This causes the statefulset controller to go into a rolling upgrade -- update pod, wait for it to be ready, update next pod, etc. The StatefulSet wasn't really changing though. It was just the order that we declared the environment variables. The fix is to sort the environment variables so that the order is consistent. That way the StatefulSet we generate doesn't change if the annotations didn't change.
- Loading branch information
spilchen
authored
Mar 2, 2022
1 parent
1acbc98
commit 5cb4db2
Showing
13 changed files
with
84 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## 1.3.1 - 2022-03-02 | ||
### Fixed | ||
* [#164](https://github.com/vertica/vertica-kubernetes/issues/164) Order the environment variables that were converted from annotations. Prior to this fix, it was quite easy to get the statefulset controller to go into a repeated rolling upgrade. The order ensures the statefulset doesn't appear to change between reconcile cycles. | ||
* [#161](https://github.com/vertica/vertica-kubernetes/issues/161) Tolerate slashes being at the end of the communal endpoint url |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
(c) Copyright [2021-2022] Micro Focus or one of its affiliates. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
You may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package controllers | ||
|
||
import ( | ||
"reflect" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
vapi "github.com/vertica/vertica-kubernetes/api/v1beta1" | ||
) | ||
|
||
var _ = Describe("builder", func() { | ||
It("should generate identical k8s containers each time", func() { | ||
vdb := vapi.MakeVDB() | ||
vdb.Spec.Annotations = map[string]string{ | ||
"key1": "val1", | ||
"key2": "val2", | ||
"vertica.com/gitRef": "abcd123", | ||
"1_not_valid_env_var_name": "blah", | ||
} | ||
|
||
baseContainer := makeServerContainer(vdb, &vdb.Spec.Subclusters[0]) | ||
const MaxLoopIteratons = 100 | ||
for i := 1; i < MaxLoopIteratons; i++ { | ||
c := makeServerContainer(vdb, &vdb.Spec.Subclusters[0]) | ||
Expect(reflect.DeepEqual(c, baseContainer)).Should(BeTrue()) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.