Narwhal.Lib/Narwhal.cs
/// <summary>
/// Loads a tar.gz into the volume provided
/// </summary>
/// <param name="volumeName">volume of the name to load into</param>
/// <param name="pathToTar">the path of the tarball to load</param>
/// <returns></returns>
Loads a tar.gz into the volume provided
Loads a tar . gz into the volume provided
public IEnumerable<string> Load(string volumeName, string pathToTar)
        {
            var errors = new List<string>();
            var name = "narwhal-mounting-" + Guid.NewGuid();
            try
            {
                StartContainer(name, volumeName, "alpine");
                try
                {
                    CopyToContainer(name, pathToTar);
                    UnzipVolume(name, pathToTar);
                }
                catch (Exception e)
                {
                    errors.Add(e.Message);
                }
                finally
                {
                    KillContainer(name);
                    RemoveContainer(name);
                }
            }
            catch (Exception e)
            {
                errors.Add(e.Message);
            }
            return errors;
        }
public IEnumerable < string > Load ( string volumeName , string pathToTar ) { var errors = new List < string > ( ) ; var name = " " + Guid . NewGuid ( ) ; try { StartContainer ( name , volumeName , " " ) ; try { CopyToContainer ( name , pathToTar ) ; UnzipVolume ( name , pathToTar ) ; } catch ( Exception e ) { errors . Add ( e . Message ) ; } finally { KillContainer ( name ) ; RemoveContainer ( name ) ; } } catch ( Exception e ) { errors . Add ( e . Message ) ; } return errors ; }
Loads a tar.gz into the volume provided
Loads a tar . gz into the volume provided
None
volumeName
string
volume of the name to load into
volume of the name to load into
pathToTar
string
the path of the tarball to load
the path of the tarball to load