-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KO-293] - Adding support for dynamic config change. #262
Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
495db95
Adding support for dynamic config change.
tanmayja 3751956
Code structure change
tanmayja 7de7c95
Supporting logging dynamic changes.
tanmayja f62c38f
Moving dynamic field validation in management lib.
tanmayja 4a31423
version 2, handing diff in more detailed way
tanmayja 8422b3b
Merge branch 'master' into dynamicConfig
tanmayja 0eac6fa
Disallow DC and Namespace addition/removal dynamically from xdr.
tanmayja 7ec3d63
storing status in annotation of pod for error handling
tanmayja a18475d
Giving pod update permission in cluster role and adding testcases.
tanmayja d5feeef
Merge branch 'master' into dynamicConfig
tanmayja c064dfe
Merge branch 'master' into dynamicConfig
tanmayja 05ffaef
adressing comments
tanmayja 5ebb6f2
fixing lint
tanmayja b73f541
addressing comments
tanmayja 2573a38
addressing comments
tanmayja ea10a6f
fixing tests
tanmayja afe0e13
fixing failed pod handling
tanmayja 22a4781
Merge branch 'master' into dynamicConfig
tanmayja 4f28102
Merge branch 'master' into dynamicConfig
tanmayja c52d173
Merge branch 'master' into dynamicConfig
tanmayja dd8412f
Using latest lib and disallowing dynamic config change in xdr
tanmayja 5fdde7c
Modifying test case
tanmayja 46ce1ae
address comments
tanmayja 53aa9ca
Merge branch 'master' into dynamicConfig
tanmayja ce05234
fixing testcases
tanmayja d612203
addressing comments and adding testcases
tanmayja 3ee87e1
Updating init tag
tanmayja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -74,9 +74,68 @@ var _ = Describe( | |
ScaleDownWithMigrateFillDelay(ctx) | ||
}, | ||
) | ||
Context( | ||
"UpdateClusterPre600", func() { | ||
UpdateClusterPre600(ctx) | ||
}, | ||
) | ||
}, | ||
) | ||
|
||
func UpdateClusterPre600(ctx goctx.Context) { | ||
Context( | ||
"UpdateClusterPre600", func() { | ||
clusterNamespacedName := getNamespacedName( | ||
"deploy-cluster-pre6", namespace, | ||
) | ||
|
||
BeforeEach( | ||
func() { | ||
image := fmt.Sprintf( | ||
"aerospike/aerospike-server-enterprise:%s", pre6Version, | ||
) | ||
aeroCluster, err := getAeroClusterConfig( | ||
clusterNamespacedName, image, | ||
) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
err = deployCluster(k8sClient, ctx, aeroCluster) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}, | ||
) | ||
|
||
AfterEach( | ||
func() { | ||
aeroCluster, err := getCluster( | ||
k8sClient, ctx, clusterNamespacedName, | ||
) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
_ = deleteCluster(k8sClient, ctx, aeroCluster) | ||
}, | ||
) | ||
|
||
It( | ||
"UpdateReplicationFactor: should fail for updating namespace replication-factor on server"+ | ||
"before 6.0.0. Cannot be updated", func() { | ||
aeroCluster, err := getCluster(k8sClient, ctx, clusterNamespacedName) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
namespaceConfig := | ||
aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{})[0].(map[string]interface{}) | ||
namespaceConfig["replication-factor"] = 5 | ||
aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{})[0] = namespaceConfig | ||
|
||
err = k8sClient.Update( | ||
ctx, aeroCluster, | ||
) | ||
Expect(err).Should(HaveOccurred()) | ||
}, | ||
) | ||
}, | ||
) | ||
} | ||
|
||
func ScaleDownWithMigrateFillDelay(ctx goctx.Context) { | ||
Context( | ||
"ScaleDownWithMigrateFillDelay", func() { | ||
|
@@ -920,6 +979,24 @@ func UpdateClusterTest(ctx goctx.Context) { | |
) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
By("UpdateReplicationFactor: should update namespace replication-factor on non-SC namespace") | ||
|
||
aeroCluster, err := getCluster( | ||
k8sClient, ctx, | ||
clusterNamespacedName, | ||
) | ||
Expect(err).ToNot(HaveOccurred()) | ||
nsList := aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{}) | ||
namespaceConfig := nsList[len(nsList)-1].(map[string]interface{}) | ||
// aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{})[0].(map[string]interface{}) | ||
namespaceConfig["replication-factor"] = 3 | ||
aeroCluster.Spec.AerospikeConfig.Value["namespaces"].([]interface{})[len(nsList)-1] = namespaceConfig | ||
|
||
err = k8sClient.Update( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use update with wait. The current call will only check for validation and not actual dynamic setting of rf |
||
ctx, aeroCluster, | ||
) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
By("Scaling up along with modifying Namespace storage Dynamically") | ||
|
||
err = scaleUpClusterTestWithNSDeviceHandling( | ||
|
@@ -1067,7 +1144,8 @@ func UpdateClusterTest(ctx goctx.Context) { | |
Context( | ||
"Namespace", func() { | ||
It( | ||
"UpdateReplicationFactor: should fail for updating namespace replication-factor. Cannot be updated", | ||
"UpdateReplicationFactor: should fail for updating namespace"+ | ||
"replication-factor on SC namespace. Cannot be updated", | ||
func() { | ||
aeroCluster, err := getCluster( | ||
k8sClient, ctx, | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a new init tag and use that. Init changes are merged.