some more renames

This commit is contained in:
Tejal Desai 2020-06-02 16:08:46 -07:00
parent cbf3073fda
commit 994a412d0b
5 changed files with 10 additions and 10 deletions

View File

@ -83,8 +83,8 @@ var RootCmd = &cobra.Command{
if len(opts.Destinations) == 0 && opts.ImageNameDigestFile != "" { if len(opts.Destinations) == 0 && opts.ImageNameDigestFile != "" {
return errors.New("You must provide --destination if setting ImageNameDigestFile") return errors.New("You must provide --destination if setting ImageNameDigestFile")
} }
// Update skipped paths // Update ignored paths
util.UpdateInitialIgnoreList(opts.SkipVarRun) util.UpdateInitialIgnoreList(opts.IgnoreVarRun)
} }
return nil return nil
}, },
@ -160,7 +160,7 @@ func addKanikoOptionsFlags() {
opts.RegistriesCertificates = make(map[string]string) opts.RegistriesCertificates = make(map[string]string)
RootCmd.PersistentFlags().VarP(&opts.RegistriesCertificates, "registry-certificate", "", "Use the provided certificate for TLS communication with the given registry. Expected format is 'my.registry.url=/path/to/the/server/certificate'.") RootCmd.PersistentFlags().VarP(&opts.RegistriesCertificates, "registry-certificate", "", "Use the provided certificate for TLS communication with the given registry. Expected format is 'my.registry.url=/path/to/the/server/certificate'.")
RootCmd.PersistentFlags().StringVarP(&opts.RegistryMirror, "registry-mirror", "", "", "Registry mirror to use has pull-through cache instead of docker.io.") RootCmd.PersistentFlags().StringVarP(&opts.RegistryMirror, "registry-mirror", "", "", "Registry mirror to use has pull-through cache instead of docker.io.")
RootCmd.PersistentFlags().BoolVarP(&opts.SkipVarRun, "whitelist-var-run", "", true, "Ignore /var/run directory when taking image snapshot. Set it to false to preserve /var/run/ in destination image. (Default true).") RootCmd.PersistentFlags().BoolVarP(&opts.IgnoreVarRun, "whitelist-var-run", "", true, "Ignore /var/run directory when taking image snapshot. Set it to false to preserve /var/run/ in destination image. (Default true).")
RootCmd.PersistentFlags().VarP(&opts.Labels, "label", "", "Set metadata for an image. Set it repeatedly for multiple labels.") RootCmd.PersistentFlags().VarP(&opts.Labels, "label", "", "Set metadata for an image. Set it repeatedly for multiple labels.")
RootCmd.PersistentFlags().BoolVarP(&opts.SkipUnusedStages, "skip-unused-stages", "", false, "Build only used stages if defined to true. Otherwise it builds by default all stages, even the unnecessaries ones until it reaches the target stage / end of Dockerfile") RootCmd.PersistentFlags().BoolVarP(&opts.SkipUnusedStages, "skip-unused-stages", "", false, "Build only used stages if defined to true. Otherwise it builds by default all stages, even the unnecessaries ones until it reaches the target stage / end of Dockerfile")
} }

View File

@ -46,7 +46,7 @@ COPY --from=0 /usr/local/bin/docker-credential-gcr /kaniko/docker-credential-gcr
COPY --from=0 /go/src/github.com/awslabs/amazon-ecr-credential-helper/bin/linux-amd64/docker-credential-ecr-login /kaniko/docker-credential-ecr-login COPY --from=0 /go/src/github.com/awslabs/amazon-ecr-credential-helper/bin/linux-amd64/docker-credential-ecr-login /kaniko/docker-credential-ecr-login
COPY --from=0 /usr/local/bin/docker-credential-acr-linux /kaniko/docker-credential-acr COPY --from=0 /usr/local/bin/docker-credential-acr-linux /kaniko/docker-credential-acr
COPY --from=1 /distroless/bazel-bin/experimental/busybox/busybox/ /busybox/ COPY --from=1 /distroless/bazel-bin/experimental/busybox/busybox/ /busybox/
# Declare /busybox as a volume to get it automatically in the path to skip # Declare /busybox as a volume to get it automatically in the path to ignore
VOLUME /busybox VOLUME /busybox
COPY files/ca-certificates.crt /kaniko/ssl/certs/ COPY files/ca-certificates.crt /kaniko/ssl/certs/
COPY --from=0 /kaniko/.docker /kaniko/.docker COPY --from=0 /kaniko/.docker /kaniko/.docker

View File

@ -588,14 +588,14 @@ func filterMetaDiff(metaDiff []string) []string {
func filterFileDiff(f []fileDiff) []fileDiff { func filterFileDiff(f []fileDiff) []fileDiff {
var newDiffs []fileDiff var newDiffs []fileDiff
for _, diff := range f { for _, diff := range f {
isSkipped := false isIgnored := false
for _, p := range allowedDiffPaths { for _, p := range allowedDiffPaths {
if util.HasFilepathPrefix(diff.Name, p, false) { if util.HasFilepathPrefix(diff.Name, p, false) {
isSkipped = true isIgnored = true
break break
} }
} }
if !isSkipped { if !isIgnored {
newDiffs = append(newDiffs, diff) newDiffs = append(newDiffs, diff)
} }
} }

View File

@ -55,7 +55,7 @@ type KanikoOptions struct {
NoPush bool NoPush bool
Cache bool Cache bool
Cleanup bool Cleanup bool
SkipVarRun bool IgnoreVarRun bool
SkipUnusedStages bool SkipUnusedStages bool
} }

View File

@ -55,13 +55,13 @@ var initialIgnoreList = []IgnoreListEntry{
PrefixMatchOnly: false, PrefixMatchOnly: false,
}, },
{ {
// similarly, we skip /etc/mtab, since there is no way to know if the file was mounted or came // similarly, we ignore /etc/mtab, since there is no way to know if the file was mounted or came
// from the base image // from the base image
Path: "/etc/mtab", Path: "/etc/mtab",
PrefixMatchOnly: false, PrefixMatchOnly: false,
}, },
{ {
// we skip /tmp/apt-key-gpghome, since the apt keys are added temporarily in this directory. // we ingore /tmp/apt-key-gpghome, since the apt keys are added temporarily in this directory.
// from the base image // from the base image
Path: "/tmp/apt-key-gpghome", Path: "/tmp/apt-key-gpghome",
PrefixMatchOnly: true, PrefixMatchOnly: true,