diff --git a/cmd/cluster/init.go b/cmd/cluster/init.go index ad98e05ad..f73ebb9d3 100644 --- a/cmd/cluster/init.go +++ b/cmd/cluster/init.go @@ -25,8 +25,8 @@ const ( initLong = ` Initialize cluster-api providers based on airshipctl document set. document set must contain document of Kind: Clusterctl in phase initinfra. -Path to initinfra phase is built based on airshipctl config -//ephemeral/initinfra. +Path to initinfra phase is defined in the initinfra phase document located +in the manifest repository. Clusterctl document example: --- apiVersion: airshipit.org/v1alpha1 diff --git a/cmd/cluster/testdata/TestNewClusterInitCmdGoldenOutput/cluster-init-cmd-with-help.golden b/cmd/cluster/testdata/TestNewClusterInitCmdGoldenOutput/cluster-init-cmd-with-help.golden index 097566a1a..395394552 100644 --- a/cmd/cluster/testdata/TestNewClusterInitCmdGoldenOutput/cluster-init-cmd-with-help.golden +++ b/cmd/cluster/testdata/TestNewClusterInitCmdGoldenOutput/cluster-init-cmd-with-help.golden @@ -1,8 +1,8 @@ Initialize cluster-api providers based on airshipctl document set. document set must contain document of Kind: Clusterctl in phase initinfra. -Path to initinfra phase is built based on airshipctl config -//ephemeral/initinfra. +Path to initinfra phase is defined in the initinfra phase document located +in the manifest repository. Clusterctl document example: --- apiVersion: airshipit.org/v1alpha1 diff --git a/cmd/config/set_manifest.go b/cmd/config/set_manifest.go index d5c10c25e..d79cbfe4e 100644 --- a/cmd/config/set_manifest.go +++ b/cmd/config/set_manifest.go @@ -35,7 +35,6 @@ airshipctl config set-manifest exampleManifest \ --url https://github.com/site \ --branch master \ --phase \ - --sub-path exampleSubpath \ --target-path exampleTargetpath # Change the phase repo for manifest @@ -43,10 +42,6 @@ airshipctl config set-manifest e2e \ --repo exampleRepo \ --phase -# Change the sub-path for manifest -airshipctl config set-manifest e2e \ - --sub-path treasuremap/manifests/e2e - # Change the target-path for manifest airshipctl config set-manifest e2e \ --target-path /tmp/e2e @@ -135,12 +130,6 @@ func addSetManifestFlags(o *config.ManifestOptions, cmd *cobra.Command) { false, "if set, enable this repository as phase repository to be used with this manifest") - flags.StringVar( - &o.SubPath, - "sub-path", - "", - "the sub path to be set for this manifest") - flags.StringVar( &o.TargetPath, "target-path", diff --git a/cmd/config/set_manifest_test.go b/cmd/config/set_manifest_test.go index 1e786a1bf..2e1725b7b 100644 --- a/cmd/config/set_manifest_test.go +++ b/cmd/config/set_manifest_test.go @@ -32,7 +32,6 @@ const ( mRepoName = "treasuremap" mURL = "https://github.com/airshipit/treasuremap" mBranch = "master" - mSubPath = "manifests/test-site" mTargetPath = "/tmp/airship" mMetadataPath = "manifests/metadata.yaml" @@ -94,7 +93,6 @@ func TestSetManifest(t *testing.T) { "--url " + mURL, "--branch " + mBranch, "--phase", - "--sub-path " + mSubPath, "--target-path " + mTargetPath, "--metadata-path " + mMetadataPath, }, diff --git a/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-few-args.golden b/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-few-args.golden index 5e37be58c..8a528f20e 100644 --- a/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-few-args.golden +++ b/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-few-args.golden @@ -10,7 +10,6 @@ airshipctl config set-manifest exampleManifest \ --url https://github.com/site \ --branch master \ --phase \ - --sub-path exampleSubpath \ --target-path exampleTargetpath # Change the phase repo for manifest @@ -18,10 +17,6 @@ airshipctl config set-manifest e2e \ --repo exampleRepo \ --phase -# Change the sub-path for manifest -airshipctl config set-manifest e2e \ - --sub-path treasuremap/manifests/e2e - # Change the target-path for manifest airshipctl config set-manifest e2e \ --target-path /tmp/e2e @@ -35,7 +30,6 @@ Flags: --metadata-path string the metadata path to be set for this manifest --phase if set, enable this repository as phase repository to be used with this manifest --repo string the name of the repository to be associated with this manifest - --sub-path string the sub path to be set for this manifest --tag string the tag to be associated with repository in this manifest --target-path string the target path to be set for this manifest --url string the repository url to be associated with this manifest diff --git a/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-many-args.golden b/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-many-args.golden index fd471cdc7..fb48ed149 100644 --- a/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-many-args.golden +++ b/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-too-many-args.golden @@ -10,7 +10,6 @@ airshipctl config set-manifest exampleManifest \ --url https://github.com/site \ --branch master \ --phase \ - --sub-path exampleSubpath \ --target-path exampleTargetpath # Change the phase repo for manifest @@ -18,10 +17,6 @@ airshipctl config set-manifest e2e \ --repo exampleRepo \ --phase -# Change the sub-path for manifest -airshipctl config set-manifest e2e \ - --sub-path treasuremap/manifests/e2e - # Change the target-path for manifest airshipctl config set-manifest e2e \ --target-path /tmp/e2e @@ -35,7 +30,6 @@ Flags: --metadata-path string the metadata path to be set for this manifest --phase if set, enable this repository as phase repository to be used with this manifest --repo string the name of the repository to be associated with this manifest - --sub-path string the sub path to be set for this manifest --tag string the tag to be associated with repository in this manifest --target-path string the target path to be set for this manifest --url string the repository url to be associated with this manifest diff --git a/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-with-help.golden b/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-with-help.golden index 9d1fd5a9f..3fcddf00b 100644 --- a/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-with-help.golden +++ b/cmd/config/testdata/TestConfigSetManifestGoldenOutput/config-cmd-set-manifest-with-help.golden @@ -11,7 +11,6 @@ airshipctl config set-manifest exampleManifest \ --url https://github.com/site \ --branch master \ --phase \ - --sub-path exampleSubpath \ --target-path exampleTargetpath # Change the phase repo for manifest @@ -19,10 +18,6 @@ airshipctl config set-manifest e2e \ --repo exampleRepo \ --phase -# Change the sub-path for manifest -airshipctl config set-manifest e2e \ - --sub-path treasuremap/manifests/e2e - # Change the target-path for manifest airshipctl config set-manifest e2e \ --target-path /tmp/e2e @@ -36,7 +31,6 @@ Flags: --metadata-path string the metadata path to be set for this manifest --phase if set, enable this repository as phase repository to be used with this manifest --repo string the name of the repository to be associated with this manifest - --sub-path string the sub path to be set for this manifest --tag string the tag to be associated with repository in this manifest --target-path string the target path to be set for this manifest --url string the repository url to be associated with this manifest diff --git a/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-all-manifests.golden b/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-all-manifests.golden index 12be3d3ad..4529fd5ed 100644 --- a/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-all-manifests.golden +++ b/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-all-manifests.golden @@ -1,15 +1,12 @@ metadataPath: "" phaseRepositoryName: bar_phase_repo -subPath: "" targetPath: bar_target_path metadataPath: "" phaseRepositoryName: baz_phase_repo -subPath: "" targetPath: baz_target_path metadataPath: "" phaseRepositoryName: foo_phase_repo -subPath: "" targetPath: foo_target_path diff --git a/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-manifest.golden b/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-manifest.golden index 2da83f0c9..c4d16b089 100644 --- a/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-manifest.golden +++ b/cmd/config/testdata/TestGetManifestConfigCmdGoldenOutput/get-manifest.golden @@ -1,5 +1,4 @@ metadataPath: "" phaseRepositoryName: foo_phase_repo -subPath: "" targetPath: foo_target_path diff --git a/docs/azure/azure-integration.md b/docs/azure/azure-integration.md index 4ea7d3e40..58237b403 100644 --- a/docs/azure/azure-integration.md +++ b/docs/azure/azure-integration.md @@ -155,7 +155,8 @@ managementConfiguration: type: azure manifests: azure_manifest: - primaryRepositoryName: primary + phaseRepositoryName: primary + metadataPath: manifests/site/az-test-site/metadata.yaml repositories: primary: checkout: @@ -164,10 +165,10 @@ manifests: force: false tag: "" url: https://review.opendev.org/airship/airshipctl - subPath: airshipctl/manifests/site/az-test-site targetPath: /tmp/airship default: - primaryRepositoryName: primary + phaseRepositoryName: primary + metadataPath: manifests/metadata.yaml repositories: primary: checkout: @@ -176,6 +177,5 @@ manifests: force: false tag: "" url: https://opendev.org/airship/treasuremap - subPath: treasuremap/manifests/site targetPath: /tmp/default ``` \ No newline at end of file diff --git a/docs/source/cli/airshipctl_cluster_init.md b/docs/source/cli/airshipctl_cluster_init.md index 827e31862..aedd58b2f 100644 --- a/docs/source/cli/airshipctl_cluster_init.md +++ b/docs/source/cli/airshipctl_cluster_init.md @@ -7,8 +7,8 @@ Deploy cluster-api provider components Initialize cluster-api providers based on airshipctl document set. document set must contain document of Kind: Clusterctl in phase initinfra. -Path to initinfra phase is built based on airshipctl config -//ephemeral/initinfra. +Path to initinfra phase is defined in the initinfra phase document located +in the manifest repository. Clusterctl document example: --- apiVersion: airshipit.org/v1alpha1 diff --git a/docs/source/cli/airshipctl_config_set-manifest.md b/docs/source/cli/airshipctl_config_set-manifest.md index 28af086de..a41926979 100644 --- a/docs/source/cli/airshipctl_config_set-manifest.md +++ b/docs/source/cli/airshipctl_config_set-manifest.md @@ -21,7 +21,6 @@ airshipctl config set-manifest exampleManifest \ --url https://github.com/site \ --branch master \ --phase \ - --sub-path exampleSubpath \ --target-path exampleTargetpath # Change the phase repo for manifest @@ -29,10 +28,6 @@ airshipctl config set-manifest e2e \ --repo exampleRepo \ --phase -# Change the sub-path for manifest -airshipctl config set-manifest e2e \ - --sub-path treasuremap/manifests/e2e - # Change the target-path for manifest airshipctl config set-manifest e2e \ --target-path /tmp/e2e @@ -49,7 +44,6 @@ airshipctl config set-manifest e2e \ --metadata-path string the metadata path to be set for this manifest --phase if set, enable this repository as phase repository to be used with this manifest --repo string the name of the repository to be associated with this manifest - --sub-path string the sub path to be set for this manifest --tag string the tag to be associated with repository in this manifest --target-path string the target path to be set for this manifest --url string the repository url to be associated with this manifest diff --git a/pkg/bootstrap/isogen/testdata/config/config b/pkg/bootstrap/isogen/testdata/config/config new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/cluster/resetsatoken/testdata/airshipconfig.yaml b/pkg/cluster/resetsatoken/testdata/airshipconfig.yaml index fe1b4ecdf..b619b6fdb 100644 --- a/pkg/cluster/resetsatoken/testdata/airshipconfig.yaml +++ b/pkg/cluster/resetsatoken/testdata/airshipconfig.yaml @@ -19,5 +19,4 @@ manifests: remoteRef: "" tag: v1.0.1 url: http://dummy.url.com/primary.git - subPath: site targetPath: testdata diff --git a/pkg/clusterctl/cmd/command_test.go b/pkg/clusterctl/cmd/command_test.go index 0e913b932..df03c70d9 100644 --- a/pkg/clusterctl/cmd/command_test.go +++ b/pkg/clusterctl/cmd/command_test.go @@ -46,7 +46,6 @@ func TestNewCommand(t *testing.T) { manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", - SubPath: "valid", PhaseRepositoryName: "primary", MetadataPath: "metadata.yaml", Repositories: map[string]*config.Repository{ @@ -62,7 +61,6 @@ func TestNewCommand(t *testing.T) { manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", - SubPath: "invalid-path", PhaseRepositoryName: "primary", Repositories: map[string]*config.Repository{ "primary": {}, @@ -77,7 +75,6 @@ func TestNewCommand(t *testing.T) { manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", - SubPath: "no-clusterctl", PhaseRepositoryName: "primary", Repositories: map[string]*config.Repository{ "primary": {}, @@ -89,9 +86,7 @@ func TestNewCommand(t *testing.T) { name: "no phase repo", expectErr: true, manifests: map[string]*config.Manifest{ - manifestName: { - SubPath: "no-clusterctl", - }, + manifestName: {}, }, }, { @@ -101,7 +96,6 @@ func TestNewCommand(t *testing.T) { manifests: map[string]*config.Manifest{ manifestName: { TargetPath: "testdata", - SubPath: "can't build bundle", PhaseRepositoryName: "primary", Repositories: map[string]*config.Repository{ "primary": {}, diff --git a/pkg/clusterctl/cmd/testdata/airshipconfig.yaml b/pkg/clusterctl/cmd/testdata/airshipconfig.yaml index 93ff10e85..33ad2ad95 100644 --- a/pkg/clusterctl/cmd/testdata/airshipconfig.yaml +++ b/pkg/clusterctl/cmd/testdata/airshipconfig.yaml @@ -19,5 +19,4 @@ manifests: remoteRef: "" tag: v1.0.1 url: http://dummy.url.com/primary.git - subPath: site targetPath: testdata diff --git a/pkg/config/config.go b/pkg/config/config.go index 2560f0582..d62f7ff28 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -375,9 +375,6 @@ func (c *Config) ModifyManifest(manifest *Manifest, theManifest *ManifestOptions if theManifest.IsPhase { manifest.PhaseRepositoryName = theManifest.RepoName } - if theManifest.SubPath != "" { - manifest.SubPath = theManifest.SubPath - } if theManifest.TargetPath != "" { manifest.TargetPath = theManifest.TargetPath } diff --git a/pkg/config/constants.go b/pkg/config/constants.go index 95845c4e3..aacaa272b 100644 --- a/pkg/config/constants.go +++ b/pkg/config/constants.go @@ -62,8 +62,6 @@ const ( DefaultTestPhaseRepo = "primary" // DefaultTargetPath holds default target path DefaultTargetPath = "/tmp/default" - // DefaultSubPath holds default sub path - DefaultSubPath = "manifest/default" // DefaultManifestMetadataFile default path to manifest metadata file DefaultManifestMetadataFile = "manifests/site/test-site/metadata.yaml" ) diff --git a/pkg/config/manifest.go b/pkg/config/manifest.go index e9260a455..728d9cfa8 100644 --- a/pkg/config/manifest.go +++ b/pkg/config/manifest.go @@ -26,13 +26,6 @@ type Manifest struct { Repositories map[string]*Repository `json:"repositories,omitempty"` // TargetPath Local Target path for working or home directory for all Manifest Cloned/Returned/Generated TargetPath string `json:"targetPath"` - // SubPath is a path relative to TargetPath + Path where PhaseRepository is cloned and contains - // directories with ClusterType and Phase bundles, example: - // Repositories[PhaseRepositoryName].Url = 'https://github.com/airshipit/treasuremap' - // SubPath = "manifests" - // you would expect that at treasuremap/manifests you would have ephemeral/initinfra and - // ephemera/target directories, containing kustomize.yaml. - SubPath string `json:"subPath"` // MetadataPath path to a metadata file relative to TargetPath MetadataPath string `json:"metadataPath"` } diff --git a/pkg/config/options.go b/pkg/config/options.go index 8b84adf14..e6a562079 100644 --- a/pkg/config/options.go +++ b/pkg/config/options.go @@ -41,7 +41,6 @@ type ManifestOptions struct { RemoteRef string Force bool IsPhase bool - SubPath string TargetPath string MetadataPath string } diff --git a/pkg/config/testdata/config-string.yaml b/pkg/config/testdata/config-string.yaml index e783194b4..c8eebdf41 100644 --- a/pkg/config/testdata/config-string.yaml +++ b/pkg/config/testdata/config-string.yaml @@ -30,7 +30,6 @@ manifests: force: false tag: v1.0.1 url: http://dummy.url.com/manifests.git - subPath: manifests/site/test-site targetPath: /var/tmp/ permissions: DirectoryPermission: 488 diff --git a/pkg/config/testdata/manifest-string.yaml b/pkg/config/testdata/manifest-string.yaml index f4a41b00c..cb67f9432 100644 --- a/pkg/config/testdata/manifest-string.yaml +++ b/pkg/config/testdata/manifest-string.yaml @@ -11,5 +11,4 @@ repositories: force: false tag: v1.0.1 url: http://dummy.url.com/manifests.git -subPath: manifests/site/test-site targetPath: /var/tmp/ diff --git a/pkg/config/utils.go b/pkg/config/utils.go index 50f2c7591..7a180cd91 100644 --- a/pkg/config/utils.go +++ b/pkg/config/utils.go @@ -51,7 +51,6 @@ func NewConfig() *Config { }, TargetPath: "/tmp/" + AirshipDefaultManifest, PhaseRepositoryName: DefaultTestPhaseRepo, - SubPath: AirshipDefaultManifestRepo + "/manifests/site", MetadataPath: DefaultManifestMetadataFile, }, }, @@ -91,7 +90,6 @@ func NewManifest() *Manifest { return &Manifest{ PhaseRepositoryName: DefaultTestPhaseRepo, TargetPath: DefaultTargetPath, - SubPath: DefaultSubPath, Repositories: map[string]*Repository{DefaultTestPhaseRepo: NewRepository()}, MetadataPath: DefaultManifestMetadataFile, } diff --git a/pkg/phase/helper_test.go b/pkg/phase/helper_test.go index bdfbbd787..c5d9212b3 100644 --- a/pkg/phase/helper_test.go +++ b/pkg/phase/helper_test.go @@ -484,7 +484,6 @@ manifests: phaseRepositoryName: primary targetPath: testdata metadataPath: valid_site/metadata.yaml - subPath: valid_site repositories: primary: url: "empty/filename/" diff --git a/pkg/phase/render_test.go b/pkg/phase/render_test.go index c1f87884a..161cb817f 100644 --- a/pkg/phase/render_test.go +++ b/pkg/phase/render_test.go @@ -39,7 +39,6 @@ func TestRender(t *testing.T) { URLString: "", }, } - dummyManifest.SubPath = "" dummyManifest.MetadataPath = "metadata.yaml" fixturePath := "phase" tests := []struct { diff --git a/pkg/phase/testdata/airshipconfig.yaml b/pkg/phase/testdata/airshipconfig.yaml index 3d7f80977..e610942f0 100644 --- a/pkg/phase/testdata/airshipconfig.yaml +++ b/pkg/phase/testdata/airshipconfig.yaml @@ -21,4 +21,3 @@ manifests: remoteRef: "" tag: v1.0.1 url: http://dummy.url.com/primary.git - subPath: valid_site diff --git a/testutil/testconfig.go b/testutil/testconfig.go index 68a2c09b4..0b245c3b5 100644 --- a/testutil/testconfig.go +++ b/testutil/testconfig.go @@ -71,7 +71,6 @@ func DummyManifest() *config.Manifest { m.PhaseRepositoryName = "primary" m.MetadataPath = "metadata.yaml" m.TargetPath = "/var/tmp/" - m.SubPath = "manifests/site/test-site" return m } @@ -153,7 +152,6 @@ func DummyManagementConfiguration() *config.ManagementConfiguration { func DummyManifestOptions() *config.ManifestOptions { return &config.ManifestOptions{ Name: "dummy_manifest", - SubPath: "manifests/dummy_site", TargetPath: "/tmp/dummy_site", IsPhase: true, RepoName: "dummy_repo", diff --git a/tools/deployment/templates/azure_airshipconfig_template b/tools/deployment/templates/azure_airshipconfig_template index e720efa07..05adec07b 100644 --- a/tools/deployment/templates/azure_airshipconfig_template +++ b/tools/deployment/templates/azure_airshipconfig_template @@ -12,7 +12,7 @@ managementConfiguration: type: azure manifests: azure_manifest: - primaryRepositoryName: primary + phaseRepositoryName: primary repositories: primary: checkout: @@ -21,7 +21,6 @@ manifests: force: false tag: "" url: https://review.opendev.org/airship/airshipctl - subPath: manifests/site/az-test-site - targetPath: /home/zuul/src/opendev.org/airship/airshipctl + targetPath: /home/zuul/src/opendev.org/airship users: kind-capi-azure: {} diff --git a/tools/document/validate_site_docs.sh b/tools/document/validate_site_docs.sh index 30f797fcc..ec56fde1c 100755 --- a/tools/document/validate_site_docs.sh +++ b/tools/document/validate_site_docs.sh @@ -46,7 +46,7 @@ export KUSTOMIZE_PLUGIN_HOME export KUBECONFIG # TODO: use `airshipctl config` to do this once all the needed knobs are exposed -# The non-default parts are to set the targetPath and subPath appropriately, +# The non-default parts are to set the targetPath appropriately, # and to craft up cluster/contexts to avoid the need for automatic kubectl reconciliation function generate_airshipconf { cluster=$1