Skip to content

Commit 3dac0e2

Browse files
chore: update remaining flags, docs, and remove most openshift references (#357)
1 parent e1b98da commit 3dac0e2

22 files changed

+111
-71
lines changed

cmd/deploy.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use 'lagoon deploy latest' instead`,
4141
if err != nil {
4242
return err
4343
}
44-
returnData, err := cmd.Flags().GetBool("returnData")
44+
returnData, err := cmd.Flags().GetBool("returndata")
4545
if err != nil {
4646
return err
4747
}
@@ -107,7 +107,7 @@ var deployPromoteCmd = &cobra.Command{
107107
if err != nil {
108108
return err
109109
}
110-
returnData, err := cmd.Flags().GetBool("returnData")
110+
returnData, err := cmd.Flags().GetBool("returndata")
111111
if err != nil {
112112
return err
113113
}
@@ -161,7 +161,7 @@ This environment should already exist in lagoon. It is analogous with the 'Deplo
161161
},
162162
RunE: func(cmd *cobra.Command, args []string) error {
163163

164-
returnData, err := cmd.Flags().GetBool("returnData")
164+
returnData, err := cmd.Flags().GetBool("returndata")
165165
if err != nil {
166166
return err
167167
}
@@ -233,23 +233,23 @@ This pullrequest may not already exist as an environment in lagoon.`,
233233
if err != nil {
234234
return err
235235
}
236-
baseBranchName, err := cmd.Flags().GetString("baseBranchName")
236+
baseBranchName, err := cmd.Flags().GetString("base-branch-name")
237237
if err != nil {
238238
return err
239239
}
240-
baseBranchRef, err := cmd.Flags().GetString("baseBranchRef")
240+
baseBranchRef, err := cmd.Flags().GetString("base-branch-ref")
241241
if err != nil {
242242
return err
243243
}
244-
headBranchName, err := cmd.Flags().GetString("headBranchName")
244+
headBranchName, err := cmd.Flags().GetString("head-branch-name")
245245
if err != nil {
246246
return err
247247
}
248-
headBranchRef, err := cmd.Flags().GetString("headBranchRef")
248+
headBranchRef, err := cmd.Flags().GetString("head-branch-ref")
249249
if err != nil {
250250
return err
251251
}
252-
if err := requiredInputCheck("Project name", cmdProjectName, "Pullrequest title", prTitle, "Pullrequest number", strconv.Itoa(int(prNumber)), "baseBranchName", baseBranchName, "baseBranchRef", baseBranchRef, "headBranchName", headBranchName, "headBranchRef", headBranchRef); err != nil {
252+
if err := requiredInputCheck("Project name", cmdProjectName, "Pullrequest title", prTitle, "Pullrequest number", strconv.Itoa(int(prNumber)), "Base branch name", baseBranchName, "Base branch ref", baseBranchRef, "Head branch name", headBranchName, "Head branch ref", headBranchRef); err != nil {
253253
return err
254254
}
255255
buildVarStrings, err := cmd.Flags().GetStringArray("buildvar")
@@ -261,7 +261,7 @@ This pullrequest may not already exist as an environment in lagoon.`,
261261
return err
262262
}
263263

264-
returnData, err := cmd.Flags().GetBool("returnData")
264+
returnData, err := cmd.Flags().GetBool("returndata")
265265
if err != nil {
266266
return err
267267
}
@@ -304,25 +304,25 @@ func init() {
304304
deployCmd.AddCommand(deployPullrequestCmd)
305305

306306
const returnDataUsageText = "Returns the build name instead of success text"
307-
deployLatestCmd.Flags().Bool("returnData", false, returnDataUsageText)
307+
deployLatestCmd.Flags().Bool("returndata", false, returnDataUsageText)
308308
deployLatestCmd.Flags().StringArray("buildvar", []string{}, "Add one or more build variables to deployment (--buildvar KEY1=VALUE1 [--buildvar KEY2=VALUE2])")
309309

310310
deployBranchCmd.Flags().StringP("branch", "b", "", "Branch name to deploy")
311-
deployBranchCmd.Flags().StringP("branchRef", "r", "", "Branch ref to deploy")
312-
deployBranchCmd.Flags().Bool("returnData", false, returnDataUsageText)
311+
deployBranchCmd.Flags().StringP("branch-ref", "r", "", "Branch ref to deploy")
312+
deployBranchCmd.Flags().Bool("returndata", false, returnDataUsageText)
313313
deployBranchCmd.Flags().StringArray("buildvar", []string{}, "Add one or more build variables to deployment (--buildvar KEY1=VALUE1 [--buildvar KEY2=VALUE2])")
314314

315315
deployPromoteCmd.Flags().StringP("destination", "d", "", "Destination environment name to create")
316316
deployPromoteCmd.Flags().StringP("source", "s", "", "Source environment name to use as the base to deploy from")
317-
deployPromoteCmd.Flags().Bool("returnData", false, returnDataUsageText)
317+
deployPromoteCmd.Flags().Bool("returndata", false, returnDataUsageText)
318318
deployPromoteCmd.Flags().StringArray("buildvar", []string{}, "Add one or more build variables to deployment (--buildvar KEY1=VALUE1 [--buildvar KEY2=VALUE2])")
319319

320320
deployPullrequestCmd.Flags().StringP("title", "t", "", "Pullrequest title")
321321
deployPullrequestCmd.Flags().UintP("number", "n", 0, "Pullrequest number")
322-
deployPullrequestCmd.Flags().StringP("baseBranchName", "N", "", "Pullrequest base branch name")
323-
deployPullrequestCmd.Flags().StringP("baseBranchRef", "R", "", "Pullrequest base branch reference hash")
324-
deployPullrequestCmd.Flags().StringP("headBranchName", "H", "", "Pullrequest head branch name")
325-
deployPullrequestCmd.Flags().StringP("headBranchRef", "M", "", "Pullrequest head branch reference hash")
326-
deployPullrequestCmd.Flags().Bool("returnData", false, returnDataUsageText)
322+
deployPullrequestCmd.Flags().StringP("base-branch-name", "N", "", "Pullrequest base branch name")
323+
deployPullrequestCmd.Flags().StringP("base-branch-ref", "R", "", "Pullrequest base branch reference hash")
324+
deployPullrequestCmd.Flags().StringP("head-branch-name", "H", "", "Pullrequest head branch name")
325+
deployPullrequestCmd.Flags().StringP("head-branch-ref", "M", "", "Pullrequest head branch reference hash")
326+
deployPullrequestCmd.Flags().Bool("returndata", false, returnDataUsageText)
327327
deployPullrequestCmd.Flags().StringArray("buildvar", []string{}, "Add one or more build variables to deployment (--buildvar KEY1=VALUE1 [--buildvar KEY2=VALUE2])")
328328
}

cmd/deploytarget.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var addDeployTargetCmd = &cobra.Command{
1616
Use: "deploytarget",
1717
Aliases: []string{"dt"},
1818
Short: "Add a DeployTarget to lagoon",
19-
Long: "Add a DeployTarget (kubernetes or openshift) to lagoon, this requires admin level permissions",
19+
Long: "Add a Deploytarget(Kubernetes) to lagoon, this requires admin level permissions",
2020
PreRunE: func(_ *cobra.Command, _ []string) error {
2121
return validateTokenE(cmdLagoon)
2222
},
@@ -147,7 +147,7 @@ var updateDeployTargetCmd = &cobra.Command{
147147
Use: "deploytarget",
148148
Aliases: []string{"dt"},
149149
Short: "Update a DeployTarget in lagoon",
150-
Long: "Update a DeployTarget (kubernetes or openshift) in lagoon, this requires admin level permissions",
150+
Long: "Update a Deploytarget(Kubernetes) in lagoon, this requires admin level permissions",
151151
PreRunE: func(_ *cobra.Command, _ []string) error {
152152
return validateTokenE(cmdLagoon)
153153
},
@@ -279,7 +279,7 @@ var deleteDeployTargetCmd = &cobra.Command{
279279
Use: "deploytarget",
280280
Aliases: []string{"dt"},
281281
Short: "Delete a DeployTarget from lagoon",
282-
Long: "Delete a DeployTarget (kubernetes or openshift) from lagoon, this requires admin level permissions",
282+
Long: "Delete a Deploytarget(Kubernetes) from lagoon, this requires admin level permissions",
283283
PreRunE: func(_ *cobra.Command, _ []string) error {
284284
return validateTokenE(cmdLagoon)
285285
},

cmd/environment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ var updateEnvironmentCmd = &cobra.Command{
9696
if err != nil {
9797
return err
9898
}
99-
openShift, err := cmd.Flags().GetUint("deploytarget")
99+
deploytarget, err := cmd.Flags().GetUint("deploytarget")
100100
if err != nil {
101101
return err
102102
}
@@ -141,7 +141,7 @@ var updateEnvironmentCmd = &cobra.Command{
141141
Route: nullStrCheck(route),
142142
Routes: nullStrCheck(routes),
143143
DeployTitle: nullStrCheck(deployTitle),
144-
Openshift: nullUintCheck(openShift),
144+
Openshift: nullUintCheck(deploytarget),
145145
}
146146
if environmentAutoIdleProvided {
147147
environmentFlags.AutoIdle = &environmentAutoIdle
@@ -313,7 +313,7 @@ func init() {
313313
updateEnvironmentCmd.Flags().String("route", "", "Update the route for the selected environment")
314314
updateEnvironmentCmd.Flags().String("routes", "", "Update the routes for the selected environment")
315315
updateEnvironmentCmd.Flags().UintVarP(&environmentAutoIdle, "auto-idle", "a", 1, "Auto idle setting of the environment")
316-
updateEnvironmentCmd.Flags().UintP("deploytarget", "d", 0, "Reference to OpenShift Object this Environment should be deployed to")
316+
updateEnvironmentCmd.Flags().UintP("deploytarget", "d", 0, "Reference to Deploytarget(Kubernetes) this Environment should be deployed to")
317317
updateEnvironmentCmd.Flags().String("environment-type", "", "Update the environment type - production | development")
318318
updateEnvironmentCmd.Flags().String("deploy-type", "", "Update the deploy type - branch | pullrequest | promote")
319319
}

cmd/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ var getEnvironmentCmd = &cobra.Command{
241241
returnNonEmptyString(fmt.Sprintf("%v", environment.DeployHeadRef)),
242242
})
243243
dataMain := output.Table{
244-
Header: []string{"ID", "EnvironmentName", "EnvironmentType", "DeployType", "Created", "OpenshiftProjectName", "Route", "Routes", "AutoIdle", "DeployTitle", "DeployBaseRef", "DeployHeadRef"},
244+
Header: []string{"ID", "EnvironmentName", "EnvironmentType", "DeployType", "Created", "Namespace", "Route", "Routes", "AutoIdle", "DeployTitle", "DeployBaseRef", "DeployHeadRef"},
245245
Data: data,
246246
}
247247
output.RenderOutput(dataMain, outputOptions)

cmd/import.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can get it to continue anyway with --keep-going. To disable any prompts, use
3030
if err != nil {
3131
return err
3232
}
33-
openshiftID, err := cmd.Flags().GetUint("openshiftID")
33+
deploytargetID, err := cmd.Flags().GetUint("deploytarget-id")
3434
if err != nil {
3535
return err
3636
}
@@ -62,7 +62,7 @@ You can get it to continue anyway with --keep-going. To disable any prompts, use
6262
return fmt.Errorf("couldn't open file: %w", err)
6363
}
6464

65-
return lagoon.Import(context.TODO(), lc, file, keepGoing, openshiftID)
65+
return lagoon.Import(context.TODO(), lc, file, keepGoing, deploytargetID)
6666
},
6767
}
6868

@@ -136,9 +136,9 @@ func init() {
136136
"path to the file to import")
137137
importCmd.Flags().Bool("keep-going", false,
138138
"on error, just log and continue instead of aborting")
139-
importCmd.Flags().Uint("openshiftID", 0,
140-
"ID of the openshift to target for import")
141-
for _, flag := range []string{"import-file", "openshiftID"} {
139+
importCmd.Flags().Uint("deploytarget-id", 0,
140+
"ID of the deploytarget to target for import")
141+
for _, flag := range []string{"import-file", "deploytarget-id"} {
142142
if err := importCmd.MarkFlagRequired(flag); err != nil {
143143
panic(err)
144144
}

cmd/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var listDeployTargetsCmd = &cobra.Command{
8787
Use: "deploytargets",
8888
Aliases: []string{"deploytarget", "dt"},
8989
Short: "List all DeployTargets in Lagoon",
90-
Long: "List all DeployTargets (kubernetes or openshift) in lagoon, this requires admin level permissions",
90+
Long: "List all Deploytargets(Kubernetes) in lagoon, this requires admin level permissions",
9191
PreRunE: func(_ *cobra.Command, _ []string) error {
9292
return validateTokenE(cmdLagoon)
9393
},

cmd/project.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var addProjectCmd = &cobra.Command{
8686
if err != nil {
8787
return err
8888
}
89-
openshift, err := cmd.Flags().GetUint("openshift")
89+
deploytarget, err := cmd.Flags().GetUint("deploytarget")
9090
if err != nil {
9191
return err
9292
}
@@ -102,7 +102,7 @@ var addProjectCmd = &cobra.Command{
102102
if err != nil {
103103
return err
104104
}
105-
openshiftProjectPattern, err := cmd.Flags().GetString("openshift-project-pattern")
105+
deploytargetProjectPattern, err := cmd.Flags().GetString("deploytarget-project-pattern")
106106
if err != nil {
107107
return err
108108
}
@@ -139,7 +139,7 @@ var addProjectCmd = &cobra.Command{
139139
return err
140140
}
141141

142-
if err := requiredInputCheck("Project name", cmdProjectName, "git-url", gitUrl, "Production environment", productionEnvironment, "Openshift", strconv.Itoa(int(openshift))); err != nil {
142+
if err := requiredInputCheck("Project name", cmdProjectName, "git-url", gitUrl, "Production environment", productionEnvironment, "Deploytarget", strconv.Itoa(int(deploytarget))); err != nil {
143143
return err
144144
}
145145

@@ -160,8 +160,8 @@ var addProjectCmd = &cobra.Command{
160160
StandbyProductionEnvironment: standbyProductionEnvironment,
161161
Branches: branches,
162162
PullRequests: pullrequests,
163-
OpenshiftProjectPattern: openshiftProjectPattern,
164-
Openshift: openshift,
163+
OpenshiftProjectPattern: deploytargetProjectPattern,
164+
Openshift: deploytarget,
165165
DevelopmentEnvironmentsLimit: developmentEnvironmentsLimit,
166166
StorageCalc: storageCalc,
167167
AutoIdle: autoIdle,
@@ -232,7 +232,7 @@ var updateProjectCmd = &cobra.Command{
232232
if err != nil {
233233
return err
234234
}
235-
openshift, err := cmd.Flags().GetUint("openshift")
235+
deploytarget, err := cmd.Flags().GetUint("deploytarget")
236236
if err != nil {
237237
return err
238238
}
@@ -248,7 +248,7 @@ var updateProjectCmd = &cobra.Command{
248248
if err != nil {
249249
return err
250250
}
251-
openshiftProjectPattern, err := cmd.Flags().GetString("openshift-project-pattern")
251+
deploytargetProjectPattern, err := cmd.Flags().GetString("deploytarget-project-pattern")
252252
if err != nil {
253253
return err
254254
}
@@ -326,11 +326,11 @@ var updateProjectCmd = &cobra.Command{
326326
projectPatch := schema.UpdateProjectPatchInput{
327327
GitURL: nullStrCheck(gitUrl),
328328
ProductionEnvironment: nullStrCheck(productionEnvironment),
329-
Openshift: nullUintCheck(openshift),
329+
Openshift: nullUintCheck(deploytarget),
330330
StandbyProductionEnvironment: nullStrCheck(standbyProductionEnvironment),
331331
Branches: nullStrCheck(branches),
332332
Pullrequests: nullStrCheck(pullrequests),
333-
OpenshiftProjectPattern: nullStrCheck(openshiftProjectPattern),
333+
OpenshiftProjectPattern: nullStrCheck(deploytargetProjectPattern),
334334
DevelopmentEnvironmentsLimit: nullUintCheck(developmentEnvironmentsLimit),
335335
StorageCalc: nullUintCheck(storageCalc),
336336
AutoIdle: nullUintCheck(autoIdle),
@@ -713,7 +713,7 @@ func init() {
713713
updateProjectCmd.Flags().StringP("pullrequests", "m", "", "Which Pull Requests should be deployed")
714714
updateProjectCmd.Flags().StringP("production-environment", "E", "", "Which environment(the name) should be marked as the production environment")
715715
updateProjectCmd.Flags().String("standby-production-environment", "", "Which environment(the name) should be marked as the standby production environment")
716-
updateProjectCmd.Flags().StringP("openshift-project-pattern", "o", "", "Pattern of OpenShift Project/Namespace that should be generated")
716+
updateProjectCmd.Flags().StringP("deploytarget-project-pattern", "o", "", "Pattern of Deploytarget(Kubernetes) Project/Namespace that should be generated")
717717
updateProjectCmd.Flags().StringP("build-image", "", "", "Build Image for the project. Set to 'null' to remove the build image")
718718
updateProjectCmd.Flags().StringP("availability", "", "", "Availability of the project")
719719

@@ -722,7 +722,7 @@ func init() {
722722
updateProjectCmd.Flags().UintP("auto-idle", "a", 0, "Auto idle setting of the project")
723723
updateProjectCmd.Flags().UintP("storage-calc", "C", 0, "Should storage for this environment be calculated")
724724
updateProjectCmd.Flags().UintP("development-environments-limit", "L", 0, "How many environments can be deployed at one time")
725-
updateProjectCmd.Flags().UintP("openshift", "S", 0, "Reference to OpenShift Object this Project should be deployed to")
725+
updateProjectCmd.Flags().UintP("deploytarget", "S", 0, "Reference to Deploytarget(Kubernetes) this Project should be deployed to")
726726
updateProjectCmd.Flags().UintP("deployments-disabled", "", 0, "Admin only flag for disabling deployments on a project, 1 to disable deployments, 0 to enable")
727727

728728
updateProjectCmd.Flags().UintP("facts-ui", "", 0, "Enables the Lagoon insights Facts tab in the UI. Set to 1 to enable, 0 to disable")
@@ -738,12 +738,12 @@ func init() {
738738
addProjectCmd.Flags().StringP("pullrequests", "m", "", "Which Pull Requests should be deployed")
739739
addProjectCmd.Flags().StringP("production-environment", "E", "", "Which environment(the name) should be marked as the production environment")
740740
addProjectCmd.Flags().String("standby-production-environment", "", "Which environment(the name) should be marked as the standby production environment")
741-
addProjectCmd.Flags().StringP("openshift-project-pattern", "o", "", "Pattern of OpenShift Project/Namespace that should be generated")
741+
addProjectCmd.Flags().StringP("deploytarget-project-pattern", "", "", "Pattern of Deploytarget(Kubernetes) Project/Namespace that should be generated")
742742

743743
addProjectCmd.Flags().UintP("auto-idle", "a", 0, "Auto idle setting of the project")
744744
addProjectCmd.Flags().UintP("storage-calc", "C", 0, "Should storage for this environment be calculated")
745745
addProjectCmd.Flags().UintP("development-environments-limit", "L", 0, "How many environments can be deployed at one time")
746-
addProjectCmd.Flags().UintP("openshift", "S", 0, "Reference to OpenShift Object this Project should be deployed to")
746+
addProjectCmd.Flags().UintP("deploytarget", "S", 0, "Reference to Deploytarget(Kubernetes) target this Project should be deployed to")
747747
addProjectCmd.Flags().StringP("build-image", "", "", "Build Image for the project")
748748
addProjectCmd.Flags().Bool("owner", false, "Add the user as an owner of the project")
749749
addProjectCmd.Flags().StringP("organization-name", "O", "", "Name of the Organization to add the project to")

docs/commands/lagoon.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ lagoon [flags]
4242
* [lagoon kibana](lagoon_kibana.md) - Launch the kibana interface
4343
* [lagoon list](lagoon_list.md) - List projects, environments, deployments, variables or notifications
4444
* [lagoon login](lagoon_login.md) - Log into a Lagoon instance
45+
* [lagoon logs](lagoon_logs.md) - Display logs for a service of an environment and project
4546
* [lagoon raw](lagoon_raw.md) - Run a custom query or mutation
4647
* [lagoon reset-password](lagoon_reset-password.md) - Send a password reset email
4748
* [lagoon retrieve](lagoon_retrieve.md) - Trigger a retrieval operation on backups

docs/commands/lagoon_add_deploytarget.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Add a DeployTarget to lagoon
44

55
### Synopsis
66

7-
Add a DeployTarget (kubernetes or openshift) to lagoon, this requires admin level permissions
7+
Add a Deploytarget(Kubernetes) to lagoon, this requires admin level permissions
88

99
```
1010
lagoon add deploytarget [flags]

docs/commands/lagoon_add_project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ lagoon add project [flags]
1717
-a, --auto-idle uint Auto idle setting of the project
1818
-b, --branches string Which branches should be deployed
1919
--build-image string Build Image for the project
20+
-S, --deploytarget uint Reference to Deploytarget(Kubernetes) target this Project should be deployed to
21+
--deploytarget-project-pattern string Pattern of Deploytarget(Kubernetes) Project/Namespace that should be generated
2022
-L, --development-environments-limit uint How many environments can be deployed at one time
2123
-g, --git-url string GitURL of the project
2224
-h, --help help for project
2325
-j, --json string JSON string to patch
24-
-S, --openshift uint Reference to OpenShift Object this Project should be deployed to
25-
-o, --openshift-project-pattern string Pattern of OpenShift Project/Namespace that should be generated
2626
--organization-id uint ID of the Organization to add the project to
2727
-O, --organization-name string Name of the Organization to add the project to
2828
--owner Add the user as an owner of the project

0 commit comments

Comments
 (0)