Refactor openshift buildconfig CLI options.
- Remove --buildconfig, -bc option. Create buildconfig if service has build info - Rename --branch to --build-branch - Rename --repo to --build-repo
This commit is contained in:
+7
-3
@@ -63,7 +63,8 @@ func ValidateFlags(bundle string, args []string, cmd *cobra.Command, opt *kobjec
|
||||
|
||||
// OpenShift specific flags
|
||||
deploymentConfig := cmd.Flags().Lookup("deployment-config").Changed
|
||||
buildConfig := cmd.Flags().Lookup("build-config").Changed
|
||||
buildRepo := cmd.Flags().Lookup("build-repo").Changed
|
||||
buildBranch := cmd.Flags().Lookup("build-branch").Changed
|
||||
|
||||
// Kubernetes specific flags
|
||||
chart := cmd.Flags().Lookup("chart").Changed
|
||||
@@ -90,8 +91,11 @@ func ValidateFlags(bundle string, args []string, cmd *cobra.Command, opt *kobjec
|
||||
if deploymentConfig {
|
||||
logrus.Fatalf("--deployment-config is an OpenShift only flag")
|
||||
}
|
||||
if buildConfig {
|
||||
logrus.Fatalf("--build-config is an Openshift only flag")
|
||||
if buildRepo {
|
||||
logrus.Fatalf("--build-repo is an Openshift only flag")
|
||||
}
|
||||
if buildBranch {
|
||||
logrus.Fatalf("--build-branch is an Openshift only flag")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,8 @@ type ConvertOptions struct {
|
||||
CreateRC bool
|
||||
CreateDS bool
|
||||
CreateDeploymentConfig bool
|
||||
CreateBuildConfig bool
|
||||
Repo string
|
||||
Branch string
|
||||
BuildRepo string
|
||||
BuildBranch string
|
||||
CreateChart bool
|
||||
GenerateYaml bool
|
||||
EmptyVols bool
|
||||
|
||||
@@ -305,8 +305,8 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C
|
||||
objects = append(objects, o.initImageStream(name, service))
|
||||
}
|
||||
|
||||
if opt.CreateBuildConfig && service.Build != "" {
|
||||
objects = append(objects, initBuildConfig(name, service, opt.InputFile, opt.Repo, opt.Branch)) // Openshift BuildConfigs
|
||||
if service.Build != "" {
|
||||
objects = append(objects, initBuildConfig(name, service, opt.InputFile, opt.BuildRepo, opt.BuildBranch)) // Openshift BuildConfigs
|
||||
}
|
||||
|
||||
// If ports not provided in configuration we will not make service
|
||||
|
||||
Reference in New Issue
Block a user