-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial * State * State * configuration test suite * State * State * State * State * State * State * State * One more test * More tests * remove stdoutlogger * State * Docs + RN * error on Kyma pod restart warnings * Do not return error on warnings also do not log it * Update internal/restarter/predicates/image_resources_test.go Co-authored-by: Marek Kołodziejczak <[email protected]> * Review adjustments * Fix mustMatch and optional predicate case * Improve logs on controller reconcile terminating for different cases * Improve logs and requeue in a minuate for the customer sidecar restart error case (warning) * Update docs/contributor/04-10-technical-design.md Co-authored-by: Natalia Sitko <[email protected]> * Update docs/contributor/04-10-technical-design.md Co-authored-by: Natalia Sitko <[email protected]> * Update docs/contributor/04-10-technical-design.md Co-authored-by: Natalia Sitko <[email protected]> * Update docs/release-notes/1.14.0.md Co-authored-by: Natalia Sitko <[email protected]> --------- Co-authored-by: Marek Kołodziejczak <[email protected]> Co-authored-by: Natalia Sitko <[email protected]>
- Loading branch information
1 parent
f99be84
commit b7c63aa
Showing
40 changed files
with
1,623 additions
and
512 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,3 @@ | ||
## New Features | ||
|
||
- Restarting sidecars is now divided into two phases. In the first phase, only Kyma workloads are restarted. If this phase fails, the Istio Custom Resource (CR) is set to the `Error` state. In the second phase, customer workloads are restarted in chunks. If any iteration of this phase fails, the Istio CR is set to the `Warning` state. |
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
88 changes: 88 additions & 0 deletions
88
internal/reconciliations/istio/configuration/configuration_test.go
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,88 @@ | ||
package configuration_test | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
operatorv1alpha2 "github.com/kyma-project/istio/operator/api/v1alpha2" | ||
"github.com/kyma-project/istio/operator/internal/reconciliations/istio/configuration" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
|
||
"github.com/kyma-project/istio/operator/internal/tests" | ||
"github.com/onsi/ginkgo/v2/types" | ||
) | ||
|
||
const ( | ||
mockIstioTag string = "1.16.1-distroless" | ||
lastAppliedConfiguration string = "operator.kyma-project.io/lastAppliedConfiguration" | ||
) | ||
|
||
func TestRestarter(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
|
||
RunSpecs(t, "Istio Configuration Suite") | ||
} | ||
|
||
var _ = ReportAfterSuite("custom reporter", func(report types.Report) { | ||
tests.GenerateGinkgoJunitReport("istio-configuration-suite", report) | ||
}) | ||
|
||
var _ = Describe("Istio Configuration", func() { | ||
Context("LastAppliedConfiguration", func() { | ||
It("should update lastAppliedConfiguration and is able to unmarshal it back from annotation", func() { | ||
// given | ||
numTrustedProxies := 1 | ||
istioCR := operatorv1alpha2.Istio{Spec: operatorv1alpha2.IstioSpec{Config: operatorv1alpha2.Config{NumTrustedProxies: &numTrustedProxies}}} | ||
|
||
// when | ||
err := configuration.UpdateLastAppliedConfiguration(&istioCR, mockIstioTag) | ||
|
||
// then | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
Expect(istioCR.Annotations).To(Not(BeEmpty())) | ||
Expect(istioCR.Annotations[lastAppliedConfiguration]).To(Equal(fmt.Sprintf(`{"config":{"numTrustedProxies":1},"IstioTag":"%s"}`, mockIstioTag))) | ||
|
||
appliedConfig, err := configuration.GetLastAppliedConfiguration(&istioCR) | ||
|
||
Expect(err).ShouldNot(HaveOccurred()) | ||
Expect(*appliedConfig.Config.NumTrustedProxies).To(Equal(1)) | ||
}) | ||
}) | ||
|
||
Context("CheckIstioVersionUpdate", func() { | ||
It("should return nil when target version is the same as current version", func() { | ||
err := configuration.CheckIstioVersionUpdate("1.10.0", "1.10.0") | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
}) | ||
|
||
It("should return nil when target version is one minor version higher than current version", func() { | ||
err := configuration.CheckIstioVersionUpdate("1.10.0", "1.11.0") | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
}) | ||
|
||
It("should return error when target version is lower than current version", func() { | ||
err := configuration.CheckIstioVersionUpdate("1.11.0", "1.10.0") | ||
Expect(err).Should(HaveOccurred()) | ||
Expect(err.Error()).To(ContainSubstring("downgrade not supported")) | ||
}) | ||
|
||
It("should return error when target version is more than one minor version higher than current version", func() { | ||
err := configuration.CheckIstioVersionUpdate("1.10.0", "1.12.0") | ||
Expect(err).Should(HaveOccurred()) | ||
Expect(err.Error()).To(ContainSubstring("the difference between versions exceed one minor version")) | ||
}) | ||
|
||
It("should return error when target version has a different major version", func() { | ||
err := configuration.CheckIstioVersionUpdate("1.10.0", "2.10.0") | ||
Expect(err).Should(HaveOccurred()) | ||
Expect(err.Error()).To(ContainSubstring("major version upgrade is not supported")) | ||
}) | ||
|
||
It("should return nil when target version is a pre-release of the same version", func() { | ||
err := configuration.CheckIstioVersionUpdate("1.10.0", "1.10.0-beta.1") | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.