(api sync.ClusterAPI, namespace string, podAdditions *v1alpha1.PodAdditions)
| 35 | var data string |
| 36 | |
| 37 | func ProvisionSshAskPass(api sync.ClusterAPI, namespace string, podAdditions *v1alpha1.PodAdditions) error { |
| 38 | sshAskPassConfigMap := constructSshAskPassCM(namespace) |
| 39 | if _, err := sync.SyncObjectWithCluster(sshAskPassConfigMap, api); err != nil { |
| 40 | switch err.(type) { |
| 41 | case *sync.NotInSyncError: // Ignore the object created error |
| 42 | default: |
| 43 | return dwerrors.WrapSyncError(err) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | sshAskPassVolumeMounts, sshAskPassVolumes, err := getSshAskPassVolumesAndVolumeMounts() |
| 48 | if err != nil { |
| 49 | return err |
| 50 | } |
| 51 | podAdditions.VolumeMounts = append(podAdditions.VolumeMounts, sshAskPassVolumeMounts...) |
| 52 | podAdditions.Volumes = append(podAdditions.Volumes, sshAskPassVolumes...) |
| 53 | return nil |
| 54 | } |
| 55 | |
| 56 | func constructSshAskPassCM(namespace string) *corev1.ConfigMap { |
| 57 | askPassConfigMap := &corev1.ConfigMap{ |
nothing calls this directly
no test coverage detected