5
5
import com .github .containersolutions .operator .api .ResourceController ;
6
6
import io .fabric8 .kubernetes .api .model .*;
7
7
import io .fabric8 .kubernetes .api .model .apps .Deployment ;
8
+ import io .fabric8 .kubernetes .api .model .apps .DoneableDeployment ;
9
+ import io .fabric8 .kubernetes .client .dsl .Resource ;
10
+ import io .fabric8 .kubernetes .client .dsl .RollableScalableResource ;
11
+ import io .fabric8 .kubernetes .client .dsl .ServiceResource ;
8
12
import io .fabric8 .kubernetes .client .utils .Serialization ;
9
13
import org .apache .commons .lang3 .StringUtils ;
10
14
import org .slf4j .Logger ;
@@ -79,7 +83,7 @@ public Optional<WebServer> createOrUpdateResource(WebServer webServer, Context<W
79
83
}
80
84
}
81
85
82
- var status = new WebServerStatus ();
86
+ WebServerStatus status = new WebServerStatus ();
83
87
status .setHtmlConfigMap (htmlConfigMap .getMetadata ().getName ());
84
88
status .setAreWeGood ("Yes!" );
85
89
webServer .setStatus (status );
@@ -92,23 +96,23 @@ public boolean deleteResource(WebServer nginx, Context<WebServer> context) {
92
96
log .info ("Execution deleteResource for: {}" , nginx .getMetadata ().getName ());
93
97
94
98
log .info ("Deleting ConfigMap {}" , configMapName (nginx ));
95
- var configMap = context .getK8sClient ().configMaps ()
99
+ Resource < ConfigMap , DoneableConfigMap > configMap = context .getK8sClient ().configMaps ()
96
100
.inNamespace (nginx .getMetadata ().getNamespace ())
97
101
.withName (configMapName (nginx ));
98
102
if (configMap .get () != null ) {
99
103
configMap .delete ();
100
104
}
101
105
102
106
log .info ("Deleting Deployment {}" , deploymentName (nginx ));
103
- var deployment = context .getK8sClient ().apps ().deployments ()
107
+ RollableScalableResource < Deployment , DoneableDeployment > deployment = context .getK8sClient ().apps ().deployments ()
104
108
.inNamespace (nginx .getMetadata ().getNamespace ())
105
109
.withName (deploymentName (nginx ));
106
110
if (deployment .get () != null ) {
107
111
deployment .cascading (true ).delete ();
108
112
}
109
113
110
114
log .info ("Deleting Service {}" , serviceName (nginx ));
111
- var service = context .getK8sClient ().services ()
115
+ ServiceResource < Service , DoneableService > service = context .getK8sClient ().services ()
112
116
.inNamespace (nginx .getMetadata ().getNamespace ())
113
117
.withName (serviceName (nginx ));
114
118
if (service .get () != null ) {
0 commit comments