Skip to content

Commit e9a5a92

Browse files
committed
doc(expand CRDs): Clean comments
1 parent 8ecc71c commit e9a5a92

File tree

3 files changed

+1
-14
lines changed

3 files changed

+1
-14
lines changed

pkg/apis/vaultwebhook.uswitch.com/v1alpha1/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ type DatabaseCredentialBindingSpec struct {
2222
OutputFile string `json:"outputFile"`
2323
ServiceAccount string `json:"serviceAccount"`
2424
Container Container `json:"container,omitempty"`
25-
// InitContainer Container `json:"initcontainer,omitempty"` // TODO: Fix support for initcontainer's Lifecycle hooks ( Go dep to be updated )
2625
}
2726

2827
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

vault.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ func addVault(pod *corev1.Pod, namespace string, databases []database) (patch []
2626
for _, databaseInfo := range databases {
2727

2828
vaultContainerSpec := databaseInfo.vaultContainer
29-
//initVaultContainerSpec := databaseInfo.initVaultContainer // TODO: Fix support for initcontainer's Lifecycle hooks ( Go dep to be updated )
3029

3130
database := databaseInfo.database
3231
role := databaseInfo.role
@@ -109,7 +108,6 @@ func addVault(pod *corev1.Pod, namespace string, databases []database) (patch []
109108
initContainer := vaultContainer
110109

111110
// Configure Lifecycle Hooks if spec exists
112-
// initContainer = addLifecycleHook(initContainer, initVaultContainerSpec) // TODO: Fix support for initcontainer's Lifecycle hooks ( Go dep to be updated )
113111
vaultContainer = addLifecycleHook(vaultContainer, vaultContainerSpec)
114112

115113
jobLikeOwnerReferencesKinds := map[string]bool{"Job": true, "Workflow": true}
@@ -220,12 +218,5 @@ func addLifecycleHook(container corev1.Container, containerSpec v1alpha1.Contain
220218
}
221219

222220
}
223-
// TODO: Fix support for initcontainer's Lifecycle hooks ( Go dep to be updated )
224-
// Init containers must have RestartPolicy=Always to be able to support Lifecycle hooks
225-
// if isInit {
226-
// restartPolicy := corev1.ContainerRestartPolicyAlways
227-
// container.RestartPolicy = &restartPolicy
228-
// }
229-
//}
230221
return container
231222
}

webhook.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ type database struct {
4343
outputPath string
4444
outputFile string
4545
vaultContainer v1alpha1.Container
46-
// initVaultContainer v1alpha1.Container // TODO: Fix support for initcontainer's Lifecycle hooks ( Go dep to be updated )
4746
}
4847

4948
func (srv webHookServer) serve(w http.ResponseWriter, r *http.Request) {
@@ -199,15 +198,13 @@ func matchBindings(bindings []v1alpha1.DatabaseCredentialBinding, serviceAccount
199198
output = "/etc/database"
200199
}
201200
log.Infof("[matchBindings] Printing content of Container: %+v", binding.Spec.Container)
202-
//log.Infof("[matchBindings] Printing content of InitContainer: %+v", binding.Spec.InitContainer)
203201

204202
matchedBindings = appendIfMissing(matchedBindings, database{
205203
role: binding.Spec.Role,
206204
database: binding.Spec.Database,
207205
outputPath: output,
208206
outputFile: binding.Spec.OutputFile,
209207
vaultContainer: binding.Spec.Container,
210-
//initVaultContainer: binding.Spec.InitContainer, // TODO: Fix support for initcontainer's Lifecycle hooks ( Go dep to be updated )
211208
})
212209
}
213210
}
@@ -216,7 +213,7 @@ func matchBindings(bindings []v1alpha1.DatabaseCredentialBinding, serviceAccount
216213

217214
func appendIfMissing(slice []database, d database) []database {
218215
for _, ele := range slice {
219-
// No need to compare the Container and InitContainer fields.
216+
// No need to compare Container fields.
220217
if ele.role == d.role &&
221218
ele.database == d.database &&
222219
ele.outputPath == d.outputPath &&

0 commit comments

Comments
 (0)