@@ -113,46 +113,41 @@ public class MemcachedReconciler implements Reconciler<Memcached> {
113
113
}
114
114
115
115
private Deployment createMemcachedDeployment(Memcached m) {
116
- return new DeploymentBuilder()
117
- .withMetadata(
118
- new ObjectMetaBuilder()
119
- .withName(m.getMetadata().getName())
120
- .withNamespace(m.getMetadata().getNamespace())
121
- .withOwnerReferences(
122
- new OwnerReferenceBuilder()
123
- .withApiVersion("v1")
124
- .withKind("Memcached")
125
- .withName(m.getMetadata().getName())
126
- .withUid(m.getMetadata().getUid())
127
- .build())
128
- .build())
129
- .withSpec(
130
- new DeploymentSpecBuilder()
131
- .withReplicas(m.getSpec().getSize())
132
- .withSelector(
133
- new LabelSelectorBuilder().withMatchLabels(labelsForMemcached(m)).build())
134
- .withTemplate(
135
- new PodTemplateSpecBuilder()
136
- .withMetadata(
137
- new ObjectMetaBuilder().withLabels(labelsForMemcached(m)).build())
138
- .withSpec(
139
- new PodSpecBuilder()
140
- .withContainers(
141
- new ContainerBuilder()
142
- .withImage("memcached:1.4.36-alpine")
143
- .withName("memcached")
144
- .withCommand("memcached", "-m=64", "-o", "modern", "-v")
145
- .withPorts(
146
- new ContainerPortBuilder()
147
- .withContainerPort(11211)
148
- .withName("memcached")
149
- .build())
150
- .build())
151
- .build())
152
- .build())
153
- .build())
154
- .build();
155
- }
116
+ Deployment deployment = new DeploymentBuilder()
117
+ .withMetadata(
118
+ new ObjectMetaBuilder()
119
+ .withName(m.getMetadata().getName())
120
+ .withNamespace(m.getMetadata().getNamespace())
121
+ .build())
122
+ .withSpec(
123
+ new DeploymentSpecBuilder()
124
+ .withReplicas(m.getSpec().getSize())
125
+ .withSelector(
126
+ new LabelSelectorBuilder().withMatchLabels(labelsForMemcached(m)).build())
127
+ .withTemplate(
128
+ new PodTemplateSpecBuilder()
129
+ .withMetadata(
130
+ new ObjectMetaBuilder().withLabels(labelsForMemcached(m)).build())
131
+ .withSpec(
132
+ new PodSpecBuilder()
133
+ .withContainers(
134
+ new ContainerBuilder()
135
+ .withImage("memcached:1.4.36-alpine")
136
+ .withName("memcached")
137
+ .withCommand("memcached", "-m=64", "-o", "modern", "-v")
138
+ .withPorts(
139
+ new ContainerPortBuilder()
140
+ .withContainerPort(11211)
141
+ .withName("memcached")
142
+ .build())
143
+ .build())
144
+ .build())
145
+ .build())
146
+ .build())
147
+ .build();
148
+ deployment.addOwnerReference(m);
149
+ return deployment;
150
+ }
156
151
}
157
152
----
158
153
====
0 commit comments