Move tarsum utilities out of common package
In preparation for removing the common package, the tarsum utilities are being moved to the more relevant digest package. This functionality will probably go away in the future, but it's maintained here for the time being. Signed-off-by: Stephen J Day <stephen.day@docker.com>master
							parent
							
								
									1266f13afa
								
							
						
					
					
						commit
						8be20212f1
					
				| 
						 | 
					@ -10,7 +10,6 @@ import (
 | 
				
			||||||
	"regexp"
 | 
						"regexp"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/docker/distribution/common"
 | 
					 | 
				
			||||||
	"github.com/docker/docker/pkg/tarsum"
 | 
						"github.com/docker/docker/pkg/tarsum"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -105,7 +104,7 @@ func FromBytes(p []byte) (Digest, error) {
 | 
				
			||||||
func (d Digest) Validate() error {
 | 
					func (d Digest) Validate() error {
 | 
				
			||||||
	s := string(d)
 | 
						s := string(d)
 | 
				
			||||||
	// Common case will be tarsum
 | 
						// Common case will be tarsum
 | 
				
			||||||
	_, err := common.ParseTarSum(s)
 | 
						_, err := ParseTarSum(s)
 | 
				
			||||||
	if err == nil {
 | 
						if err == nil {
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
package common
 | 
					package digest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
package common
 | 
					package digest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"reflect"
 | 
						"reflect"
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,6 @@ import (
 | 
				
			||||||
	"path"
 | 
						"path"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/docker/distribution/common"
 | 
					 | 
				
			||||||
	"github.com/docker/distribution/digest"
 | 
						"github.com/docker/distribution/digest"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -189,7 +188,7 @@ func digestPathComoponents(dgst digest.Digest) ([]string, error) {
 | 
				
			||||||
		hex,
 | 
							hex,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if tsi, err := common.ParseTarSum(dgst.String()); err == nil {
 | 
						if tsi, err := digest.ParseTarSum(dgst.String()); err == nil {
 | 
				
			||||||
		// We have a tarsum!
 | 
							// We have a tarsum!
 | 
				
			||||||
		version := tsi.Version
 | 
							version := tsi.Version
 | 
				
			||||||
		if version == "" {
 | 
							if version == "" {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue