fix some typos.
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
5d3ae7f989
commit
34b82a69b9
|
@ -89,7 +89,7 @@ func InstallDefault(name string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsLoaded checks if a passed profile as been loaded into the kernel.
|
// IsLoaded checks if a passed profile has been loaded into the kernel.
|
||||||
func IsLoaded(name string) error {
|
func IsLoaded(name string) error {
|
||||||
file, err := os.Open("/sys/kernel/security/apparmor/profiles")
|
file, err := os.Open("/sys/kernel/security/apparmor/profiles")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -18,7 +18,7 @@ func GetDefaultProfile() (*configs.Seccomp, error) {
|
||||||
return setupSeccomp(DefaultProfile)
|
return setupSeccomp(DefaultProfile)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadProfile takes a file path a decodes the seccomp profile.
|
// LoadProfile takes a file path and decodes the seccomp profile.
|
||||||
func LoadProfile(body string) (*configs.Seccomp, error) {
|
func LoadProfile(body string) (*configs.Seccomp, error) {
|
||||||
var config types.Seccomp
|
var config types.Seccomp
|
||||||
if err := json.Unmarshal([]byte(body), &config); err != nil {
|
if err := json.Unmarshal([]byte(body), &config); err != nil {
|
||||||
|
|
|
@ -145,14 +145,14 @@ func (s *Service) tlsConfigForMirror(mirrorURL *url.URL) (*tls.Config, error) {
|
||||||
return s.TLSConfig(mirrorURL.Host)
|
return s.TLSConfig(mirrorURL.Host)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LookupPullEndpoints creates an list of endpoints to try to pull from, in order of preference.
|
// LookupPullEndpoints creates a list of endpoints to try to pull from, in order of preference.
|
||||||
// It gives preference to v2 endpoints over v1, mirrors over the actual
|
// It gives preference to v2 endpoints over v1, mirrors over the actual
|
||||||
// registry, and HTTPS over plain HTTP.
|
// registry, and HTTPS over plain HTTP.
|
||||||
func (s *Service) LookupPullEndpoints(hostname string) (endpoints []APIEndpoint, err error) {
|
func (s *Service) LookupPullEndpoints(hostname string) (endpoints []APIEndpoint, err error) {
|
||||||
return s.lookupEndpoints(hostname)
|
return s.lookupEndpoints(hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
// LookupPushEndpoints creates an list of endpoints to try to push to, in order of preference.
|
// LookupPushEndpoints creates a list of endpoints to try to push to, in order of preference.
|
||||||
// It gives preference to v2 endpoints over v1, and HTTPS over plain HTTP.
|
// It gives preference to v2 endpoints over v1, and HTTPS over plain HTTP.
|
||||||
// Mirrors are not included.
|
// Mirrors are not included.
|
||||||
func (s *Service) LookupPushEndpoints(hostname string) (endpoints []APIEndpoint, err error) {
|
func (s *Service) LookupPushEndpoints(hostname string) (endpoints []APIEndpoint, err error) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
networktypes "github.com/docker/engine-api/types/network"
|
networktypes "github.com/docker/engine-api/types/network"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ContainerConfigWrapper is a Config wrapper that hold the container Config (portable)
|
// ContainerConfigWrapper is a Config wrapper that holds the container Config (portable)
|
||||||
// and the corresponding HostConfig (non-portable).
|
// and the corresponding HostConfig (non-portable).
|
||||||
type ContainerConfigWrapper struct {
|
type ContainerConfigWrapper struct {
|
||||||
*container.Config
|
*container.Config
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
networktypes "github.com/docker/engine-api/types/network"
|
networktypes "github.com/docker/engine-api/types/network"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ContainerConfigWrapper is a Config wrapper that hold the container Config (portable)
|
// ContainerConfigWrapper is a Config wrapper that holds the container Config (portable)
|
||||||
// and the corresponding HostConfig (non-portable).
|
// and the corresponding HostConfig (non-portable).
|
||||||
type ContainerConfigWrapper struct {
|
type ContainerConfigWrapper struct {
|
||||||
*container.Config
|
*container.Config
|
||||||
|
|
|
@ -71,7 +71,7 @@ func Register(extension volume.Driver, name string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unregister dissociates the name from it's driver, if the association exists.
|
// Unregister dissociates the name from its driver, if the association exists.
|
||||||
func Unregister(name string) bool {
|
func Unregister(name string) bool {
|
||||||
drivers.Lock()
|
drivers.Lock()
|
||||||
defer drivers.Unlock()
|
defer drivers.Unlock()
|
||||||
|
@ -114,7 +114,7 @@ func Lookup(name string) (volume.Driver, error) {
|
||||||
return d, nil
|
return d, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDriver returns a volume driver by it's name.
|
// GetDriver returns a volume driver by its name.
|
||||||
// If the driver is empty, it looks for the local driver.
|
// If the driver is empty, it looks for the local driver.
|
||||||
func GetDriver(name string) (volume.Driver, error) {
|
func GetDriver(name string) (volume.Driver, error) {
|
||||||
if name == "" {
|
if name == "" {
|
||||||
|
|
|
@ -54,7 +54,7 @@ type VolumeStore struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// List proxies to all registered volume drivers to get the full list of volumes
|
// List proxies to all registered volume drivers to get the full list of volumes
|
||||||
// If a driver returns a volume that has name which conflicts with a another volume from a different driver,
|
// If a driver returns a volume that has name which conflicts with another volume from a different driver,
|
||||||
// the first volume is chosen and the conflicting volume is dropped.
|
// the first volume is chosen and the conflicting volume is dropped.
|
||||||
func (s *VolumeStore) List() ([]volume.Volume, []string, error) {
|
func (s *VolumeStore) List() ([]volume.Volume, []string, error) {
|
||||||
vols, warnings, err := s.list()
|
vols, warnings, err := s.list()
|
||||||
|
@ -244,7 +244,7 @@ func (s *VolumeStore) Get(name string) (volume.Volume, error) {
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// get requests the volume, if the driver info is stored it just access that driver,
|
// getVolume requests the volume, if the driver info is stored it just accesses that driver,
|
||||||
// if the driver is unknown it probes all drivers until it finds the first volume with that name.
|
// if the driver is unknown it probes all drivers until it finds the first volume with that name.
|
||||||
// it is expected that callers of this function hold any necessary locks
|
// it is expected that callers of this function hold any necessary locks
|
||||||
func (s *VolumeStore) getVolume(name string) (volume.Volume, error) {
|
func (s *VolumeStore) getVolume(name string) (volume.Volume, error) {
|
||||||
|
|
|
@ -93,7 +93,7 @@ func (m *MountPoint) Path() string {
|
||||||
return m.Source
|
return m.Source
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseVolumesFrom ensure that the supplied volumes-from is valid.
|
// ParseVolumesFrom ensures that the supplied volumes-from is valid.
|
||||||
func ParseVolumesFrom(spec string) (string, string, error) {
|
func ParseVolumesFrom(spec string) (string, string, error) {
|
||||||
if len(spec) == 0 {
|
if len(spec) == 0 {
|
||||||
return "", "", fmt.Errorf("malformed volumes-from specification: %s", spec)
|
return "", "", fmt.Errorf("malformed volumes-from specification: %s", spec)
|
||||||
|
|
|
@ -32,7 +32,7 @@ func GetPropagation(mode string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasPropagation checks if there is a valid propagation mode present in
|
// HasPropagation checks if there is a valid propagation mode present in
|
||||||
// passed string. Returns true if a valid propagatio mode specifier is
|
// passed string. Returns true if a valid propagation mode specifier is
|
||||||
// present, false otherwise.
|
// present, false otherwise.
|
||||||
func HasPropagation(mode string) bool {
|
func HasPropagation(mode string) bool {
|
||||||
for _, o := range strings.Split(mode, ",") {
|
for _, o := range strings.Split(mode, ",") {
|
||||||
|
|
|
@ -15,7 +15,7 @@ func GetPropagation(mode string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasPropagation checks if there is a valid propagation mode present in
|
// HasPropagation checks if there is a valid propagation mode present in
|
||||||
// passed string. Returns true if a valid propagatio mode specifier is
|
// passed string. Returns true if a valid propagation mode specifier is
|
||||||
// present, false otherwise.
|
// present, false otherwise.
|
||||||
func HasPropagation(mode string) bool {
|
func HasPropagation(mode string) bool {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -161,7 +161,7 @@ func ValidMountMode(mode string) bool {
|
||||||
|
|
||||||
// ReadWrite tells you if a mode string is a valid read-write mode or not.
|
// ReadWrite tells you if a mode string is a valid read-write mode or not.
|
||||||
// If there are no specifications w.r.t read write mode, then by default
|
// If there are no specifications w.r.t read write mode, then by default
|
||||||
// it returs true.
|
// it returns true.
|
||||||
func ReadWrite(mode string) bool {
|
func ReadWrite(mode string) bool {
|
||||||
if !ValidMountMode(mode) {
|
if !ValidMountMode(mode) {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue