(ctx context.Context, id, content string, file types.FileReferenceConfig)
| 123 | } |
| 124 | |
| 125 | func (s *composeService) copyFileToContainer(ctx context.Context, id, content string, file types.FileReferenceConfig) error { |
| 126 | b, err := createTar(content, file) |
| 127 | if err != nil { |
| 128 | return err |
| 129 | } |
| 130 | |
| 131 | _, err = s.apiClient().CopyToContainer(ctx, id, client.CopyToContainerOptions{ |
| 132 | DestinationPath: "/", |
| 133 | Content: &b, |
| 134 | CopyUIDGID: file.UID != "" || file.GID != "", |
| 135 | }) |
| 136 | return err |
| 137 | } |
| 138 | |
| 139 | func createTar(env string, config types.FileReferenceConfig) (bytes.Buffer, error) { |
| 140 | value := []byte(env) |
no test coverage detected