-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-12850] Change order of task picked up on Operator Universe updates
Summary: When multiple edits to Cr are done simultaneously, we saw that if disk resize is not done first, it breaks the update flow. Changed the sequence to run Edit Universe( disk resize ) first. Test Plan: Manually verified Added Unit tests covering scenarios of multiple edits where Edit Universe is picked first. Added Unit tests for parsing KubernetesOverrides. The KubernetesOverrides which contains additional properties looks like this: ``` nodeSelector: label: "selector" master: null tserver: null serviceEndpoints: null resource: master: limits: cpu: 4 foo: bar: "1" ``` Reviewers: anijhawan Reviewed By: anijhawan Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D32706
- Loading branch information
1 parent
ef7cc0c
commit b1319c0
Showing
3 changed files
with
158 additions
and
25 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
34 changes: 34 additions & 0 deletions
34
.../src/main/java/com/yugabyte/yw/common/operator/helpers/KubernetesOverridesSerializer.java
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,34 @@ | ||
package com.yugabyte.yw.common.operator.helpers; | ||
|
||
import com.fasterxml.jackson.core.JsonGenerator; | ||
import com.fasterxml.jackson.databind.SerializerProvider; | ||
import com.fasterxml.jackson.databind.ser.std.StdSerializer; | ||
import io.yugabyte.operator.v1alpha1.ybuniversespec.KubernetesOverrides; | ||
import io.yugabyte.operator.v1alpha1.ybuniversespec.kubernetesoverrides.Resource; | ||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
public class KubernetesOverridesSerializer extends StdSerializer<KubernetesOverrides> { | ||
|
||
public KubernetesOverridesSerializer() { | ||
super(KubernetesOverrides.class); | ||
} | ||
|
||
@Override | ||
public void serialize(KubernetesOverrides value, JsonGenerator gen, SerializerProvider provider) | ||
throws IOException { | ||
Resource resource = value.getResource(); | ||
gen.writeStartObject(); | ||
provider.defaultSerializeField("nodeSelector", value.getNodeSelector(), gen); | ||
provider.defaultSerializeField("master", value.getMaster(), gen); | ||
provider.defaultSerializeField("tserver", value.getTserver(), gen); | ||
provider.defaultSerializeField("serviceEndpoints", value.getServiceEndpoints(), gen); | ||
provider.defaultSerializeField("resource", resource, gen); | ||
if (value.getAdditionalProperties() != null) { | ||
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { | ||
gen.writeObjectField(entry.getKey(), entry.getValue()); | ||
} | ||
} | ||
gen.writeEndObject(); | ||
} | ||
} |
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