Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Package Flag and Mark Package-Dir as Deprecated #309

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pkg/cmd/create/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ var (
kubeVersion string
extraPortsMapping string
kindConfigPath string
// TODO: Remove extraPackagesDirs after 0.6.0 release
extraPackagesDirs []string
extraPackages []string
packageCustomizationFiles []string
noExit bool
protocol string
Expand Down Expand Up @@ -56,7 +58,10 @@ func init() {
CreateCmd.PersistentFlags().StringVar(&protocol, "protocol", "https", "Protocol to use to access web UIs. http or https.")
CreateCmd.PersistentFlags().StringVar(&port, "port", "8443", "Port number under which idpBuilder tools are accessible.")
CreateCmd.PersistentFlags().BoolVar(&pathRouting, "use-path-routing", false, "When set to true, web UIs are exposed under single domain name.")
// TODO: Remove package-dir and deprecation notice after 0.6.0 release
CreateCmd.Flags().StringSliceVarP(&extraPackagesDirs, "package-dir", "p", []string{}, "Paths to directories containing custom packages")
CreateCmd.Flags().MarkDeprecated("package-dir", "use --package instead")
CreateCmd.Flags().StringSliceVar(&extraPackages, "package", []string{}, "Paths to locations containing custom packages")
blakeromano marked this conversation as resolved.
Show resolved Hide resolved
CreateCmd.Flags().StringSliceVarP(&packageCustomizationFiles, "package-custom-file", "c", []string{}, "Name of the package and the path to file to customize the package with. e.g. argocd:/tmp/argocd.yaml")
// idpbuilder related flags
CreateCmd.Flags().BoolVarP(&noExit, "no-exit", "n", true, "When set, idpbuilder will not exit after all packages are synced. Useful for continuously syncing local directories.")
Expand Down Expand Up @@ -86,6 +91,7 @@ func create(cmd *cobra.Command, args []string) error {
var absDirPaths []string
var remotePaths []string

// TODO: Remove this block after deprecation
if len(extraPackagesDirs) > 0 {
r, l, pErr := helpers.ParsePackageStrings(extraPackagesDirs)
if pErr != nil {
Expand All @@ -95,6 +101,15 @@ func create(cmd *cobra.Command, args []string) error {
remotePaths = r
}

if len(extraPackages) > 0 {
r, l, pErr := helpers.ParsePackageStrings(extraPackages)
if pErr != nil {
return pErr
}
absDirPaths = l
remotePaths = r
}

o := make(map[string]v1alpha1.PackageCustomization)
for i := range packageCustomizationFiles {
c, pErr := getPackageCustomFile(packageCustomizationFiles[i])
Expand Down
Loading