You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Description of the change:** Check all returned errors in functions used by the `operator-sdk`.
**Motivation for the change:** We should make sure that all errors are checked in general. Some of these issues don't _really_ affect the code much (specifically the deferred `file.Close()` calls), but some of these could cause difficult to diagnose problems.
To find all unchecked errors, the [errcheck](https://github.com/kisielk/errcheck) program can be used. There is a PR to add that to our travis CI, but currently it segfaults when run under travis, so that will need more work.
Copy file name to clipboardExpand all lines: commands/operator-sdk/cmd/add/api.go
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -54,9 +54,13 @@ Example:
54
54
}
55
55
56
56
apiCmd.Flags().StringVar(&apiVersion, "api-version", "", "Kubernetes APIVersion that has a format of $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1)")
Copy file name to clipboardExpand all lines: commands/operator-sdk/cmd/add/controller.go
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ import (
24
24
)
25
25
26
26
funcNewControllerCmd() *cobra.Command {
27
-
apiCmd:=&cobra.Command{
27
+
controllerCmd:=&cobra.Command{
28
28
Use: "controller",
29
29
Short: "Adds a new controller pkg",
30
30
Long: `operator-sdk add controller --kind=<kind> --api-version=<group/version> creates a new
@@ -47,12 +47,16 @@ Example:
47
47
Run: controllerRun,
48
48
}
49
49
50
-
apiCmd.Flags().StringVar(&apiVersion, "api-version", "", "Kubernetes APIVersion that has a format of $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1)")
controllerCmd.Flags().StringVar(&apiVersion, "api-version", "", "Kubernetes APIVersion that has a format of $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1)")
crdCmd.Flags().StringVar(&apiVersion, "api-version", "", "Kubernetes apiVersion and has a format of $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1)")
0 commit comments