-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking change: unify disk-virt task code and rename their parameters
The disk-virt tasks have almost identical code. This commit keeps only single version of disk-virt code. The params of the tasks were unified and renamed: customizeCommands, sysprepCommands -> virtCommands additionalOptions -> additionalVirtOptions Signed-off-by: Karel Simon <[email protected]>
- Loading branch information
Showing
31 changed files
with
156 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...-sysprep/pkg/execute/virt-sysprep-opts.go → modules/disk-virt/pkg/execute/virt-opts.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...sk-virt-sysprep/pkg/utils/log/log_test.go → modules/disk-virt/pkg/utils/log/log_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package parse | ||
|
||
import ( | ||
"github.com/kubevirt/kubevirt-tekton-tasks/modules/shared/pkg/zutils" | ||
"go.uber.org/zap/zapcore" | ||
) | ||
|
||
const ( | ||
commandsOptionName = "virt-commands" | ||
commandsEnvVarName = "VIRT_COMMANDS" | ||
) | ||
|
||
type CLIOptions struct { | ||
Commands string `arg:"--virt-commands,env:VIRT_COMMANDS" placeholder:"VIRT_COMMANDS" help:"virt script in --commands-from-file format to execute on target pvc."` | ||
AdditionalVirtOptions string `arg:"--additional-virt-options,env:ADDITIONAL_VIRT_OPTIONS" placeholder:"OPTIONS" help:"additional options to pass to virt command"` | ||
Verbose string `arg:"--verbose" placeholder:"true|false" help:"Enable verbose mode and tracing of libguestfs API calls."` | ||
} | ||
|
||
func (c *CLIOptions) GetDebugLevel() zapcore.Level { | ||
if c.IsVerbose() { | ||
return zapcore.DebugLevel | ||
} | ||
return zapcore.InfoLevel | ||
} | ||
|
||
func (c *CLIOptions) IsVerbose() bool { | ||
return zutils.IsTrue(c.Verbose) | ||
} | ||
|
||
func (c *CLIOptions) GetCommands() string { | ||
return c.Commands | ||
} | ||
|
||
func (c *CLIOptions) GetAdditionalVirtOptions() string { | ||
return c.AdditionalVirtOptions | ||
} | ||
|
||
func (c *CLIOptions) Init() error { | ||
if err := c.validateCommands(); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.