Remove image build
command
We use phases for building the ephemeral ISO image, so a user can use `phase run` command instead. It is better to remove `image build` subcommand to avoid support of an unnecessary piece of code. Change-Id: Ife9b5fdebc3cdfd5dac3ecccc8fef55811741ce8 Closes: #473
This commit is contained in:
parent
e2af947337
commit
ab5ff1076f
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package image
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"opendev.org/airship/airshipctl/pkg/config"
|
|
||||||
"opendev.org/airship/airshipctl/pkg/phase"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewImageBuildCommand creates a new command with the capability to build ISO image.
|
|
||||||
func NewImageBuildCommand(cfgFactory config.Factory) *cobra.Command {
|
|
||||||
cmd := &cobra.Command{
|
|
||||||
Use: "build",
|
|
||||||
Short: "Build ISO image",
|
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
|
||||||
p := &phase.RunCommand{
|
|
||||||
Factory: cfgFactory,
|
|
||||||
}
|
|
||||||
p.Options.PhaseID.Name = config.BootstrapPhase
|
|
||||||
return p.RunE()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
return cmd
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package image
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
|
|
||||||
"opendev.org/airship/airshipctl/pkg/config"
|
|
||||||
)
|
|
||||||
|
|
||||||
// NewImageCommand creates a new command for managing ISO images using airshipctl.
|
|
||||||
func NewImageCommand(cfgFactory config.Factory) *cobra.Command {
|
|
||||||
imageRootCmd := &cobra.Command{
|
|
||||||
Use: "image",
|
|
||||||
Short: "Manage ISO image creation",
|
|
||||||
}
|
|
||||||
|
|
||||||
imageRootCmd.AddCommand(NewImageBuildCommand(cfgFactory))
|
|
||||||
|
|
||||||
return imageRootCmd
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package image_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"opendev.org/airship/airshipctl/cmd/image"
|
|
||||||
"opendev.org/airship/airshipctl/testutil"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestImage(t *testing.T) {
|
|
||||||
tests := []*testutil.CmdTest{
|
|
||||||
{
|
|
||||||
Name: "image-with-help",
|
|
||||||
CmdLine: "-h",
|
|
||||||
Cmd: image.NewImageCommand(nil),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, tt := range tests {
|
|
||||||
testutil.RunTest(t, tt)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
Manage ISO image creation
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
image [command]
|
|
||||||
|
|
||||||
Available Commands:
|
|
||||||
build Build ISO image
|
|
||||||
help Help about any command
|
|
||||||
|
|
||||||
Flags:
|
|
||||||
-h, --help help for image
|
|
||||||
|
|
||||||
Use "image [command] --help" for more information about a command.
|
|
@ -27,7 +27,6 @@ import (
|
|||||||
"opendev.org/airship/airshipctl/cmd/completion"
|
"opendev.org/airship/airshipctl/cmd/completion"
|
||||||
"opendev.org/airship/airshipctl/cmd/config"
|
"opendev.org/airship/airshipctl/cmd/config"
|
||||||
"opendev.org/airship/airshipctl/cmd/document"
|
"opendev.org/airship/airshipctl/cmd/document"
|
||||||
"opendev.org/airship/airshipctl/cmd/image"
|
|
||||||
"opendev.org/airship/airshipctl/cmd/phase"
|
"opendev.org/airship/airshipctl/cmd/phase"
|
||||||
"opendev.org/airship/airshipctl/cmd/plan"
|
"opendev.org/airship/airshipctl/cmd/plan"
|
||||||
"opendev.org/airship/airshipctl/cmd/secret"
|
"opendev.org/airship/airshipctl/cmd/secret"
|
||||||
@ -75,7 +74,6 @@ func AddDefaultAirshipCTLCommands(cmd *cobra.Command, factory cfg.Factory) *cobr
|
|||||||
cmd.AddCommand(completion.NewCompletionCommand())
|
cmd.AddCommand(completion.NewCompletionCommand())
|
||||||
cmd.AddCommand(document.NewDocumentCommand(factory))
|
cmd.AddCommand(document.NewDocumentCommand(factory))
|
||||||
cmd.AddCommand(config.NewConfigCommand(factory))
|
cmd.AddCommand(config.NewConfigCommand(factory))
|
||||||
cmd.AddCommand(image.NewImageCommand(factory))
|
|
||||||
cmd.AddCommand(secret.NewSecretCommand(factory))
|
cmd.AddCommand(secret.NewSecretCommand(factory))
|
||||||
cmd.AddCommand(phase.NewPhaseCommand(factory))
|
cmd.AddCommand(phase.NewPhaseCommand(factory))
|
||||||
cmd.AddCommand(plan.NewPlanCommand(factory))
|
cmd.AddCommand(plan.NewPlanCommand(factory))
|
||||||
|
@ -10,7 +10,6 @@ Available Commands:
|
|||||||
config Manage the airshipctl config file
|
config Manage the airshipctl config file
|
||||||
document Manage deployment documents
|
document Manage deployment documents
|
||||||
help Help about any command
|
help Help about any command
|
||||||
image Manage ISO image creation
|
|
||||||
phase Manage phases
|
phase Manage phases
|
||||||
plan Manage plans
|
plan Manage plans
|
||||||
secret Manage secrets
|
secret Manage secrets
|
||||||
|
@ -21,7 +21,6 @@ A unified entrypoint to various airship components
|
|||||||
* [airshipctl completion](airshipctl_completion.md) - Generate completion script for the specified shell (bash or zsh)
|
* [airshipctl completion](airshipctl_completion.md) - Generate completion script for the specified shell (bash or zsh)
|
||||||
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file
|
* [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file
|
||||||
* [airshipctl document](airshipctl_document.md) - Manage deployment documents
|
* [airshipctl document](airshipctl_document.md) - Manage deployment documents
|
||||||
* [airshipctl image](airshipctl_image.md) - Manage ISO image creation
|
|
||||||
* [airshipctl phase](airshipctl_phase.md) - Manage phases
|
* [airshipctl phase](airshipctl_phase.md) - Manage phases
|
||||||
* [airshipctl plan](airshipctl_plan.md) - Manage plans
|
* [airshipctl plan](airshipctl_plan.md) - Manage plans
|
||||||
* [airshipctl secret](airshipctl_secret.md) - Manage secrets
|
* [airshipctl secret](airshipctl_secret.md) - Manage secrets
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
## airshipctl image
|
|
||||||
|
|
||||||
Manage ISO image creation
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
Manage ISO image creation
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for image
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--airshipconf string Path to file for airshipctl configuration. (default "$HOME/.airship/config")
|
|
||||||
--debug enable verbose output
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [airshipctl](airshipctl.md) - A unified entrypoint to various airship components
|
|
||||||
* [airshipctl image build](airshipctl_image_build.md) - Build ISO image
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
## airshipctl image build
|
|
||||||
|
|
||||||
Build ISO image
|
|
||||||
|
|
||||||
### Synopsis
|
|
||||||
|
|
||||||
Build ISO image
|
|
||||||
|
|
||||||
```
|
|
||||||
airshipctl image build [flags]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options
|
|
||||||
|
|
||||||
```
|
|
||||||
-h, --help help for build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Options inherited from parent commands
|
|
||||||
|
|
||||||
```
|
|
||||||
--airshipconf string Path to file for airshipctl configuration. (default "$HOME/.airship/config")
|
|
||||||
--debug enable verbose output
|
|
||||||
```
|
|
||||||
|
|
||||||
### SEE ALSO
|
|
||||||
|
|
||||||
* [airshipctl image](airshipctl_image.md) - Manage ISO image creation
|
|
||||||
|
|
@ -16,11 +16,6 @@ package config
|
|||||||
|
|
||||||
import "opendev.org/airship/airshipctl/pkg/remote/redfish"
|
import "opendev.org/airship/airshipctl/pkg/remote/redfish"
|
||||||
|
|
||||||
// Constants related to Phases
|
|
||||||
const (
|
|
||||||
BootstrapPhase = "bootstrap-iso"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Constants defining default values
|
// Constants defining default values
|
||||||
const (
|
const (
|
||||||
AirshipConfig = "config"
|
AirshipConfig = "config"
|
||||||
|
Loading…
Reference in New Issue
Block a user