diff --git a/cmd/image/build.go b/cmd/image/build.go deleted file mode 100644 index a59a6ceff..000000000 --- a/cmd/image/build.go +++ /dev/null @@ -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 -} diff --git a/cmd/image/image.go b/cmd/image/image.go deleted file mode 100644 index ab13cfe0f..000000000 --- a/cmd/image/image.go +++ /dev/null @@ -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 -} diff --git a/cmd/image/image_test.go b/cmd/image/image_test.go deleted file mode 100644 index 5d919d878..000000000 --- a/cmd/image/image_test.go +++ /dev/null @@ -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) - } -} diff --git a/cmd/image/testdata/TestImageGoldenOutput/image-with-help.golden b/cmd/image/testdata/TestImageGoldenOutput/image-with-help.golden deleted file mode 100644 index fc06a0708..000000000 --- a/cmd/image/testdata/TestImageGoldenOutput/image-with-help.golden +++ /dev/null @@ -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. diff --git a/cmd/root.go b/cmd/root.go index 245f622c3..21d6f3c97 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,7 +27,6 @@ import ( "opendev.org/airship/airshipctl/cmd/completion" "opendev.org/airship/airshipctl/cmd/config" "opendev.org/airship/airshipctl/cmd/document" - "opendev.org/airship/airshipctl/cmd/image" "opendev.org/airship/airshipctl/cmd/phase" "opendev.org/airship/airshipctl/cmd/plan" "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(document.NewDocumentCommand(factory)) cmd.AddCommand(config.NewConfigCommand(factory)) - cmd.AddCommand(image.NewImageCommand(factory)) cmd.AddCommand(secret.NewSecretCommand(factory)) cmd.AddCommand(phase.NewPhaseCommand(factory)) cmd.AddCommand(plan.NewPlanCommand(factory)) diff --git a/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden b/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden index 8625f14bc..5faaec4d3 100644 --- a/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden +++ b/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden @@ -10,7 +10,6 @@ Available Commands: config Manage the airshipctl config file document Manage deployment documents help Help about any command - image Manage ISO image creation phase Manage phases plan Manage plans secret Manage secrets diff --git a/docs/source/cli/airshipctl.md b/docs/source/cli/airshipctl.md index f3839709f..cdbdd3415 100644 --- a/docs/source/cli/airshipctl.md +++ b/docs/source/cli/airshipctl.md @@ -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 config](airshipctl_config.md) - Manage the airshipctl config file * [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 plan](airshipctl_plan.md) - Manage plans * [airshipctl secret](airshipctl_secret.md) - Manage secrets diff --git a/docs/source/cli/airshipctl_image.md b/docs/source/cli/airshipctl_image.md deleted file mode 100644 index b17721a20..000000000 --- a/docs/source/cli/airshipctl_image.md +++ /dev/null @@ -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 - diff --git a/docs/source/cli/airshipctl_image_build.md b/docs/source/cli/airshipctl_image_build.md deleted file mode 100644 index a243292a9..000000000 --- a/docs/source/cli/airshipctl_image_build.md +++ /dev/null @@ -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 - diff --git a/pkg/config/constants.go b/pkg/config/constants.go index 4ce93f1c1..1d62caeb8 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -16,11 +16,6 @@ package config import "opendev.org/airship/airshipctl/pkg/remote/redfish" -// Constants related to Phases -const ( - BootstrapPhase = "bootstrap-iso" -) - // Constants defining default values const ( AirshipConfig = "config"