Skip to content

Commit 78671b1

Browse files
committed
refactor: rename OperatorProperties to ClientProperties
1 parent 285ad61 commit 78671b1

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,55 @@
33
import org.springframework.boot.context.properties.ConfigurationProperties;
44

55
@ConfigurationProperties(prefix = "operator.kubernetes.client")
6-
public class OperatorProperties {
7-
6+
public class ClientProperties {
7+
88
private boolean openshift = false;
99
private String username;
1010
private String password;
1111
private String masterUrl;
1212
private boolean trustSelfSignedCertificates = false;
13-
13+
1414
public boolean isOpenshift() {
1515
return openshift;
1616
}
17-
18-
public OperatorProperties setOpenshift(boolean openshift) {
17+
18+
public ClientProperties setOpenshift(boolean openshift) {
1919
this.openshift = openshift;
2020
return this;
2121
}
2222

2323
public String getUsername() {
2424
return username;
2525
}
26-
27-
public OperatorProperties setUsername(String username) {
26+
27+
public ClientProperties setUsername(String username) {
2828
this.username = username;
2929
return this;
3030
}
3131

3232
public String getPassword() {
3333
return password;
3434
}
35-
36-
public OperatorProperties setPassword(String password) {
35+
36+
public ClientProperties setPassword(String password) {
3737
this.password = password;
3838
return this;
3939
}
4040

4141
public String getMasterUrl() {
4242
return masterUrl;
4343
}
44-
45-
public OperatorProperties setMasterUrl(String masterUrl) {
44+
45+
public ClientProperties setMasterUrl(String masterUrl) {
4646
this.masterUrl = masterUrl;
4747
return this;
4848
}
4949

5050
public boolean isTrustSelfSignedCertificates() {
5151
return trustSelfSignedCertificates;
5252
}
53-
54-
public OperatorProperties setTrustSelfSignedCertificates(boolean trustSelfSignedCertificates) {
53+
54+
public ClientProperties setTrustSelfSignedCertificates(boolean trustSelfSignedCertificates) {
5555
this.trustSelfSignedCertificates = trustSelfSignedCertificates;
5656
return this;
5757
}

spring-boot-starter/src/main/java/io/javaoperatorsdk/operator/springboot/starter/OperatorAutoConfiguration.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@
1919
import org.springframework.context.annotation.Configuration;
2020

2121
@Configuration
22-
@EnableConfigurationProperties({OperatorProperties.class, RetryProperties.class})
22+
@EnableConfigurationProperties({ClientProperties.class, RetryProperties.class})
2323
public class OperatorAutoConfiguration {
2424
private static final Logger log = LoggerFactory.getLogger(OperatorAutoConfiguration.class);
25-
25+
2626
@Bean
2727
@ConditionalOnMissingBean
28-
public KubernetesClient kubernetesClient(OperatorProperties operatorProperties) {
28+
public KubernetesClient kubernetesClient(ClientProperties clientProperties) {
2929
ConfigBuilder config = new ConfigBuilder();
30-
config.withTrustCerts(operatorProperties.isTrustSelfSignedCertificates());
31-
if (StringUtils.isNotBlank(operatorProperties.getUsername())) {
32-
config.withUsername(operatorProperties.getUsername());
30+
config.withTrustCerts(clientProperties.isTrustSelfSignedCertificates());
31+
if (StringUtils.isNotBlank(clientProperties.getUsername())) {
32+
config.withUsername(clientProperties.getUsername());
3333
}
34-
if (StringUtils.isNotBlank(operatorProperties.getPassword())) {
35-
config.withUsername(operatorProperties.getPassword());
34+
if (StringUtils.isNotBlank(clientProperties.getPassword())) {
35+
config.withUsername(clientProperties.getPassword());
3636
}
37-
if (StringUtils.isNotBlank(operatorProperties.getMasterUrl())) {
38-
config.withMasterUrl(operatorProperties.getMasterUrl());
37+
if (StringUtils.isNotBlank(clientProperties.getMasterUrl())) {
38+
config.withMasterUrl(clientProperties.getMasterUrl());
3939
}
40-
return operatorProperties.isOpenshift() ? new DefaultOpenShiftClient(config.build()) : new DefaultKubernetesClient(config.build());
40+
return clientProperties.isOpenshift() ? new DefaultOpenShiftClient(config.build()) : new DefaultKubernetesClient(config.build());
4141
}
4242

4343
@Bean

spring-boot-starter/src/test/java/io/javaoperatorsdk/operator/springboot/starter/AutoConfigurationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class AutoConfigurationTest {
2525
private RetryProperties retryProperties;
2626

2727
@Autowired
28-
private OperatorProperties operatorProperties;
28+
private ClientProperties operatorProperties;
2929

3030
@MockBean
3131
private Operator operator;

0 commit comments

Comments
 (0)