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

[ghaction] martix CI for etcd version #1180

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

liangyuanpeng
Copy link
Contributor

@liangyuanpeng liangyuanpeng commented Jun 30, 2023

Martix CI for etcd version,Improve client stability.

We can add CI for etcd 3.6.x after it's released.

import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't use star import

@@ -89,6 +85,10 @@ public Builder withNetwork(Network network) {
}

public EtcdCluster build() {
String imagePro = System.getenv("ETCD_IMAGE");
if (!Strings.isNullOrEmpty(imagePro)) {
image = imagePro;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done in the constructor, otherwise it would override any call to withImage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lburgazzoli PTAL,Thanks.

@liangyuanpeng liangyuanpeng force-pushed the matrix_etcd_ci branch 2 times, most recently from a15ba44 to e64b4db Compare June 30, 2023 09:59
public Builder(){
String image = System.getenv("ETCD_IMAGE");
if (!Strings.isNullOrEmpty(image)) {
withImage(image);
Copy link
Collaborator

@lburgazzoli lburgazzoli Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invoking a non final method from the constructor is usually a bad practice as could lead to unexpected results, better to set the instance variable directly.

As alternative you can create a static utility method that returns the container image, like:

private String image = Etcd.resolveContainerImage();

Signed-off-by: Lan Liang <gcslyp@gmail.com>
@liangyuanpeng
Copy link
Contributor Author

Thanks for review :)

@lburgazzoli lburgazzoli merged commit ca95a0a into etcd-io:main Jun 30, 2023
4 checks passed
@liangyuanpeng liangyuanpeng deleted the matrix_etcd_ci branch July 18, 2023 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants