Browse Source

Fix typos

Alfonso Acosta 1 month ago
parent
commit
5a845a35bf

+ 2
- 2
registry/cache/memcached/integration_test.go View File

@@ -70,14 +70,14 @@ Loop:
70 70
 		case <-timeout.C:
71 71
 			t.Fatal("Cache timeout")
72 72
 		case <-tick.C:
73
-			_, err := r.GetImageRespositoryMetadata(id.Name)
73
+			_, err := r.GetImageRepositoryMetadata(id.Name)
74 74
 			if err == nil {
75 75
 				break Loop
76 76
 			}
77 77
 		}
78 78
 	}
79 79
 
80
-	repoMetadata, err := r.GetImageRespositoryMetadata(id.Name)
80
+	repoMetadata, err := r.GetImageRepositoryMetadata(id.Name)
81 81
 	assert.NoError(t, err)
82 82
 	assert.True(t, len(repoMetadata.Images) > 0, "Length of returned images should be > 0")
83 83
 	assert.Equal(t, len(repoMetadata.Images), len(repoMetadata.Tags), "the length of tags and images should match")

+ 2
- 2
registry/cache/registry.go View File

@@ -31,9 +31,9 @@ type Cache struct {
31 31
 	Reader Reader
32 32
 }
33 33
 
34
-// GetImageRespositoryMetadata returns the metadata from an image
34
+// GetImageRepositoryMetadata returns the metadata from an image
35 35
 // repository (e.g,. at "quay.io/weaveworks/flux")
36
-func (c *Cache) GetImageRespositoryMetadata(id image.Name) (image.RepositoryMetadata, error) {
36
+func (c *Cache) GetImageRepositoryMetadata(id image.Name) (image.RepositoryMetadata, error) {
37 37
 	repoKey := NewRepositoryKey(id.CanonicalName())
38 38
 	bytes, _, err := c.Reader.GetKey(repoKey)
39 39
 	if err != nil {

+ 2
- 2
registry/cache/warming.go View File

@@ -317,8 +317,8 @@ func (w *Warmer) warm(ctx context.Context, now time.Time, logger log.Logger, id
317 317
 						fetchMx.Lock()
318 318
 						manifestUnknownCount++
319 319
 						fetchMx.Unlock()
320
-						errorLogger.Log("warn", fmt.Sprintf("manifest for tag %s missing in registry %s", imageID.Tag, imageID.Name),
321
-							"impact", "flux will fail to auto-release workloads with matching images, ask the respository administrator to fix the inconsistency")
320
+						errorLogger.Log("warn", fmt.Sprintf("manifest for tag %s missing in repository %s", imageID.Tag, imageID.Name),
321
+							"impact", "flux will fail to auto-release workloads with matching images, ask the repository administrator to fix the inconsistency")
322 322
 					default:
323 323
 						errorLogger.Log("err", err, "ref", imageID)
324 324
 					}

+ 2
- 2
registry/cache/warming_test.go View File

@@ -74,7 +74,7 @@ func TestWarmThenQuery(t *testing.T) {
74 74
 	warmer.warm(context.TODO(), now, logger, repo, registry.NoCredentials())
75 75
 
76 76
 	registry := &Cache{Reader: cache}
77
-	repoInfo, err := registry.GetImageRespositoryMetadata(ref.Name)
77
+	repoInfo, err := registry.GetImageRepositoryMetadata(ref.Name)
78 78
 	assert.NoError(t, err)
79 79
 
80 80
 	// Otherwise, we should get what we put in ...
@@ -115,7 +115,7 @@ func TestWarmManifestUnknown(t *testing.T) {
115 115
 	warmer.warm(context.TODO(), now, logger, repo, registry.NoCredentials())
116 116
 
117 117
 	registry := &Cache{Reader: cache}
118
-	repoInfo, err := registry.GetImageRespositoryMetadata(repo)
118
+	repoInfo, err := registry.GetImageRepositoryMetadata(repo)
119 119
 	assert.NoError(t, err)
120 120
 
121 121
 	assert.Len(t, repoInfo.Tags, 1)

+ 1
- 1
registry/mock/mock.go View File

@@ -44,7 +44,7 @@ type Registry struct {
44 44
 	Err    error
45 45
 }
46 46
 
47
-func (m *Registry) GetImageRespositoryMetadata(id image.Name) (image.RepositoryMetadata, error) {
47
+func (m *Registry) GetImageRepositoryMetadata(id image.Name) (image.RepositoryMetadata, error) {
48 48
 	result := image.RepositoryMetadata{
49 49
 		Images: map[string]image.Info{},
50 50
 	}

+ 2
- 2
registry/monitoring.go View File

@@ -46,9 +46,9 @@ func NewInstrumentedRegistry(next Registry) Registry {
46 46
 	}
47 47
 }
48 48
 
49
-func (m *instrumentedRegistry) GetImageRespositoryMetadata(id image.Name) (res image.RepositoryMetadata, err error) {
49
+func (m *instrumentedRegistry) GetImageRepositoryMetadata(id image.Name) (res image.RepositoryMetadata, err error) {
50 50
 	start := time.Now()
51
-	res, err = m.next.GetImageRespositoryMetadata(id)
51
+	res, err = m.next.GetImageRepositoryMetadata(id)
52 52
 	registryDuration.With(
53 53
 		fluxmetrics.LabelSuccess, strconv.FormatBool(err == nil),
54 54
 	).Observe(time.Since(start).Seconds())

+ 1
- 1
registry/registry.go View File

@@ -12,7 +12,7 @@ var (
12 12
 
13 13
 // Registry is a store of image metadata.
14 14
 type Registry interface {
15
-	GetImageRespositoryMetadata(image.Name) (image.RepositoryMetadata, error)
15
+	GetImageRepositoryMetadata(image.Name) (image.RepositoryMetadata, error)
16 16
 	GetImage(image.Ref) (image.Info, error)
17 17
 }
18 18
 

+ 1
- 1
update/images.go View File

@@ -152,7 +152,7 @@ func FetchImageRepos(reg registry.Registry, cs containers, logger log.Logger) (I
152 152
 		}
153 153
 	}
154 154
 	for repo := range imageRepos {
155
-		images, err := reg.GetImageRespositoryMetadata(repo.Name)
155
+		images, err := reg.GetImageRepositoryMetadata(repo.Name)
156 156
 		if err != nil {
157 157
 			// Not an error if missing. Use empty images.
158 158
 			if !fluxerr.IsMissing(err) {

+ 1
- 1
update/images_test.go View File

@@ -21,7 +21,7 @@ var (
21 21
 
22 22
 func buildImageRepos(t *testing.T) ImageRepos {
23 23
 	registry := mock.Registry{Images: infos}
24
-	repoMetadata, err := registry.GetImageRespositoryMetadata(name.Name)
24
+	repoMetadata, err := registry.GetImageRepositoryMetadata(name.Name)
25 25
 	assert.NoError(t, err)
26 26
 	return ImageRepos{
27 27
 		imageRepos: imageReposMap{name.Name.CanonicalName(): repoMetadata},

Loading…
Cancel
Save