chore: update function names to be correct and representative of functionality (#2720)

This commit is contained in:
Aaron Prindle 2023-09-20 10:55:40 -07:00 committed by GitHub
parent 735499f495
commit 3d1ad4c64a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -58,7 +58,7 @@ func ParseStages(opts *config.KanikoOptions) ([]instructions.Stage, []instructio
return nil, nil, errors.Wrap(err, "parsing dockerfile")
}
metaArgs, err = expandNested(metaArgs, opts.BuildArgs)
metaArgs, err = expandNestedArgs(metaArgs, opts.BuildArgs)
if err != nil {
return nil, nil, errors.Wrap(err, "expanding meta ARGs")
}
@ -102,8 +102,8 @@ func Parse(b []byte) ([]instructions.Stage, []instructions.ArgCommand, error) {
return stages, metaArgs, nil
}
// expandNested tries to resolve nested ARG value against the previously defined ARGs
func expandNested(metaArgs []instructions.ArgCommand, buildArgs []string) ([]instructions.ArgCommand, error) {
// expandNestedArgs tries to resolve nested ARG value against the previously defined ARGs
func expandNestedArgs(metaArgs []instructions.ArgCommand, buildArgs []string) ([]instructions.ArgCommand, error) {
var prevArgs []string
for i, marg := range metaArgs {
for j, arg := range marg.Args {

View File

@ -345,7 +345,7 @@ func ExtractFile(dest string, hdr *tar.Header, cleanedName string, tr io.Reader)
return err
}
if err = writeSecurityXattrToToFile(path, hdr); err != nil {
if err = writeSecurityXattrToTarFile(path, hdr); err != nil {
return err
}

View File

@ -148,9 +148,9 @@ const (
securityCapabilityXattr = "security.capability"
)
// writeSecurityXattrToToFile writes security.capability
// writeSecurityXattrToTarFile writes security.capability
// xattrs from a tar header to filesystem
func writeSecurityXattrToToFile(path string, hdr *tar.Header) error {
func writeSecurityXattrToTarFile(path string, hdr *tar.Header) error {
if hdr.Xattrs == nil {
return nil
}