Convert config to *bool
Supports leaving booleans unspecified in YAML. Boolean methods allow the templates to continue using previous names for boolean values. Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -102,7 +102,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
if conf.WWClient != nil && conf.WWClient.Port > 0 {
|
||||
localTCPAddr.Port = int(conf.WWClient.Port)
|
||||
wwlog.Info("Running from configured port %d", conf.WWClient.Port)
|
||||
} else if conf.Warewulf.Secure {
|
||||
} else if conf.Warewulf.Secure() {
|
||||
// Setup local port to something privileged (<1024)
|
||||
localTCPAddr.Port = 987
|
||||
wwlog.Info("Running from trusted port")
|
||||
|
||||
@@ -134,14 +134,14 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
}
|
||||
|
||||
for _, mntPnt := range mountPts {
|
||||
if mntPnt.Copy {
|
||||
if mntPnt.Copy() {
|
||||
continue
|
||||
}
|
||||
wwlog.Debug("bind mounting: %s -> %s", mntPnt.Source, path.Join(containerPath, mntPnt.Dest))
|
||||
err = syscall.Mount(mntPnt.Source, path.Join(containerPath, mntPnt.Dest), "", syscall.MS_BIND, "")
|
||||
if err != nil {
|
||||
wwlog.Warn("Couldn't mount %s to %s: %s", mntPnt.Source, mntPnt.Dest, err)
|
||||
} else if mntPnt.ReadOnly {
|
||||
} else if mntPnt.ReadOnly() {
|
||||
err = syscall.Mount(mntPnt.Source, path.Join(containerPath, mntPnt.Dest), "", syscall.MS_REMOUNT|syscall.MS_RDONLY|syscall.MS_BIND, "")
|
||||
if err != nil {
|
||||
wwlog.Warn("failed to following mount readonly: %s", mntPnt.Source)
|
||||
@@ -191,7 +191,7 @@ the invalid mount points. Directories always have '/' as suffix
|
||||
func checkMountPoints(containerName string, binds []*warewulfconf.MountEntry) (overlayObjects []string) {
|
||||
overlayObjects = []string{}
|
||||
for _, b := range binds {
|
||||
if b.Copy {
|
||||
if b.Copy() {
|
||||
continue
|
||||
}
|
||||
_, err := os.Stat(b.Source)
|
||||
|
||||
@@ -229,7 +229,7 @@ Check the objects we want to copy in, instead of mounting
|
||||
*/
|
||||
func getCopyFiles(binds []*warewulfconf.MountEntry) (copyObjects []*copyFile) {
|
||||
for _, bind := range binds {
|
||||
if bind.Copy {
|
||||
if bind.Copy() {
|
||||
copyObjects = append(copyObjects, ©File{
|
||||
fileName: bind.Dest,
|
||||
src: bind.Source,
|
||||
|
||||
@@ -71,7 +71,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
|
||||
}
|
||||
|
||||
if BuildHost && controller.Warewulf.EnableHostOverlay {
|
||||
if BuildHost && controller.Warewulf.EnableHostOverlay() {
|
||||
err := overlay.BuildHostOverlay()
|
||||
if err != nil {
|
||||
return fmt.Errorf("host overlay could not be built: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user