When values that are passed to ConvertEnvironmentToDocker() include the
'$', '\', or '"' characters, escape them using a '\'.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
I was messing around with Jetbrains GoLand and ran it's code inspection
against openshift/source-to-image and it found quite a few things, so
I went through and picked the ones that seemed like good ones to fix
and fixed them.
Some of the issues that were fixed consist of:
- Removing unused function parameters
- Removing unused non-exported function
- Replacing deprecated os.SEEK_SET with io.SeekStart
- Replacing deprecated msg.ProgressMessage with msg.Progress.Current
- Removing duplicate parenthesis
- Renaming variables that could mask imports
- Downcasing the first letter of error messages
I think that is mostly it, I am sure there will need to be some updates
to openshift/origin in response to these updates.
- enable use of cygwin to build and test s2i
- simplify git and file downloaders
- track posix file permissions on windows
- remove unnecessary runtime.GOOS == "windows" checks
- unit test fixes
From now you can create final image that is based on the image that is
different than builder image. To use it provide --runtime-image option
with image that will be used in runtime.
Also specify --runtime-artifact option (one or more times) with a list
of files and directories that will be copied into resulting image.
Alternatively this mapping can be extracted from the
io.openshift.s2i.assemble-input-files annotation on a runtime image.
To execute custom logic to arrange image to a desired state, you can
leverage "assemble-runtime" script. You can 1) put it .s2i/bin directory
with application sources 2) download it from remote location (-s option)
or 3) have it inside a runtime image (but don't forget to add
io.openshift.s2i.scripts-url label on it).
Includes:
- Changes to commentaries to follow godoc conventions;
- Fix shadowing of identifiers;
- Missing error checks;
- Fix incorrect usages of fmt.Print* functions;
- Initialize struct literals from other packages using explicit field
names;
- Rename variables to follow Go conventions.
- strategies/layered/layered.go: add missed bracket to comment
- strategies/layered/layered.go(CreateDockerfile): use variables instead of slice
- strategies/layered/layered.go(CreateDockerfile): extract variable
- strategies/layered/layered.go(CreateDockerfile): use -- for separating options from directories
- DefaultCleaner.Cleanup(): use %q modifier
- DefaultCleaner.Cleanup(): show warnings when error happened
- Use glog.Info instead of glog.Infof
- DefaultCleaner.Cleanup(): add comment with explanation how it works
- pkg/docker/docker.go(dumpContainerInfo): fix a typo in comment
- The majority of the changes in this commit is about removing redundant
trailing '\n', since t.Logf & related methods automatically handle
trailing new lines, and essentially ignore that extra line we're
adding.
- Replace several usages of '%s' where '%q' would be more useful.
- Fix cases where the arguments to format the string were incorrectly
part of the string itself, not arguments.