Skip to content
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

[SPARK-49831] Provide empty RuntimeVersions object to ClusterSpec.runtimeVersions by default #140

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ClusterSpec extends BaseSpec {
@Required protected RuntimeVersions runtimeVersions;
@Required @Builder.Default protected RuntimeVersions runtimeVersions = new RuntimeVersions();

@Required @Builder.Default
protected ClusterTolerations clusterTolerations = new ClusterTolerations();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.apache.spark.k8s.operator.spec;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

import org.junit.jupiter.api.Test;

Expand All @@ -35,7 +34,9 @@ void testBuilder() {
@Test
void testInitSpecWithDefaults() {
ClusterSpec spec1 = new ClusterSpec();
assertNull(spec1.runtimeVersions);
assertEquals(null, spec1.runtimeVersions.jdkVersion);
assertEquals(null, spec1.runtimeVersions.scalaVersion);
assertEquals(null, spec1.runtimeVersions.sparkVersion);
assertEquals(0, spec1.clusterTolerations.instanceConfig.initWorkers);
assertEquals(0, spec1.clusterTolerations.instanceConfig.minWorkers);
assertEquals(0, spec1.clusterTolerations.instanceConfig.maxWorkers);
Expand Down
Loading