fix issues from code review

This commit is contained in:
Nestor
2019-01-17 15:49:35 +01:00
parent 6dd599a983
commit 6d56c1750f
8 changed files with 50 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 The Kubernetes Authors.
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -17,14 +17,14 @@ limitations under the License.
package image
// Append appends a slice of type Tag to slice of type Image
func Append(images []Image, tags ...Tag) []Image {
func Append(images []Image, tags ...ImageTag) []Image {
for _, tag := range tags {
images = append(images, toImage(tag))
}
return images
}
func toImage(tag Tag) Image {
func toImage(tag ImageTag) Image {
return Image{
Name: tag.Name,
NewTag: tag.NewTag,

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 The Kubernetes Authors.
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package image provides struct definitions and libraries
// for image overwriting of names, tags and digest.
package image
// Image contains an image name, a new name, a new tag or digest,

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 The Kubernetes Authors.
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,9 +16,9 @@ limitations under the License.
package image
// Tag contains an image and a new tag, which will replace the original tag.
// Tag usage is deprecated, instead use ImageTag.
type Tag struct {
// ImageTag contains an image and a new tag, which will replace the original tag.
// Deprecated, instead use Image.
type ImageTag struct {
// Name is a tag-less image name.
Name string `json:"name,omitempty" yaml:"name,omitempty"`