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
Copy file name to clipboardExpand all lines: README.md
+30-37Lines changed: 30 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,37 +55,39 @@ includes:
55
55
56
56
Since the imported Taskfile is generic, there are a few variables that need to be set in order to configure the tasks correctly. Unless specified otherwise, the variables must not be specified if their respective purpose doesn't apply to the importing repository (e.g. `NESTED_MODULES` is not required if there are no nested modules).
57
57
- `NESTED_MODULES`
58
-
- List of nested modules, separated by spaces.
59
-
- Note that the module has to be located in a subfolder that matches its name.
60
-
- Required for multiple tools from the golang environment which are able to work on a single module only and therefore have to be called once per go module.
58
+
- List of nested modules, separated by spaces.
59
+
- Note that the module has to be located in a subfolder that matches its name.
60
+
- Required for multiple tools from the golang environment which are able to work on a single module only and therefore have to be called once per go module.
61
61
- `API_DIRS`
62
-
- List of files with API type definitions for which k8s CRDs should be generated.
63
-
- The `<directory>/...` syntax can be used to refer to all files in the directory and its subdirectories.
64
-
- This is fed into the k8s code generation tool for CRD generation.
62
+
- List of files with API type definitions for which k8s CRDs should be generated.
63
+
- The `<directory>/...` syntax can be used to refer to all files in the directory and its subdirectories.
64
+
- This is fed into the k8s code generation tool for CRD generation.
65
65
- `MANIFEST_OUT`
66
-
- Directory where the generated CRDs should be put in.
66
+
- Directory where the generated CRDs should be put in.
67
67
- `CODE_DIRS`
68
-
- List of files with go code, separated by spaces.
69
-
- The `<directory>/...` syntax can be used to refer to all files in the directory and its subdirectories.
70
-
- Formatting and linting checks are executed on these files.
71
-
- This variable must always be specified.
68
+
- List of files with go code, separated by spaces.
69
+
- The `<directory>/...` syntax can be used to refer to all files in the directory and its subdirectories.
70
+
- Formatting and linting checks are executed on these files.
71
+
- This variable must always be specified.
72
72
- `COMPONENTS`
73
-
- A list of 'components' contained in this repository, separated by spaces.
74
-
- This is relevant for binary, image, chart, and OCM component building. Each entry will result in a separate build artifact for the respective builds.
75
-
- A 'component' specified here has some implications:
76
-
- A `cmd/<component>/main.go` file is expected for binary builds.
77
-
- A separate docker image will be built for each component.
78
-
- If the component has a helm chart, it is expected under `charts/<component>/`.
79
-
- Note that support for helm charts is not fully implemented yet.
80
-
- Each component will get its own OCM component.
81
-
- Note that support for OCM components is not implemented yet.
82
-
- Library repos will not have any component, operator repos will mostly contain just a single component (the operator itself).
73
+
- A list of 'components' contained in this repository, separated by spaces.
74
+
- This is relevant for binary, image, chart, and OCM component building. Each entry will result in a separate build artifact for the respective builds.
75
+
- A 'component' specified here has some implications:
76
+
- A `cmd/<component>/main.go` file is expected for binary builds.
77
+
- A separate docker image will be built for each component.
78
+
- If the component has a helm chart, it is expected under `charts/<component>/`.
79
+
- Note that support for helm charts is not fully implemented yet.
80
+
- Each component will get its own OCM component.
81
+
- Note that support for OCM components is not implemented yet.
82
+
- Library repos will not have any component, operator repos will mostly contain just a single component (the operator itself).
83
83
- `REPO_URL`
84
-
- URL of the github repository that contains the Taskfile.
85
-
- This is used for building the OCM component, which will fail if it is not specified.
84
+
- URL of the github repository that contains the Taskfile.
85
+
- This is used for building the OCM component, which will fail if it is not specified.
86
86
- `GENERATE_DOCS_INDEX`
87
-
- If this is set and its value is not `false`, the `generate:docs` target will generate a documentation index at `docs/README.md`. Otherwise, the task is skipped.
88
-
- See below for a short documentation of the the index generation.
87
+
- If this is set and its value is not `false`, the `generate:docs` target will generate a documentation index at `docs/README.md`. Otherwise, the task is skipped.
88
+
- See below for a short documentation of the the index generation.
89
+
- `ENVTEST_REQUIRED`
90
+
- If this is set to `true`, the `test` task will include the `setup-envtest` tooling in its dependencies and download it automatically.
89
91
90
92
There are two main Taskfiles, one of which should be included:
91
93
- `Taskfile_controller.yaml`is meant for operator repositories and contains task definitions for code generation and validation, binary builds, and image builds.
@@ -108,10 +110,12 @@ includes:
108
110
109
111
Adding new specialized tasks in addition to the imported generic ones is straightforward: simply add the task definitions in the importing Taskfile.
110
112
111
-
It is also possible to exclude or overwrite generic tasks. The following example uses an `external-apis` task that should be executed as part of the generic `generate:code` task, and it adds a envtest dependency to the `validate:test` task.
113
+
It is also possible to exclude or overwrite generic tasks. The following example uses an `external-apis` task that should be executed as part of the generic `generate:code` task.
112
114
113
115
Overwriting basically works by excluding and re-defining the generic task that should be overwritten. If the generic task's logic should be kept as part of the overwritten definition, the generic file needs to be imported a second time with `internal: true`, so that the original task can be called.
114
116
117
+
Note that some tasks are re-used internally with a different name due to the way `task` handles scoping. If you overwrite a task and run into issues, you might have to overwrite the same task again with a different name. In theory, adding a fitting alias to the overwrite should suffice. This theory has not yet been tested, though.
118
+
115
119
```yaml
116
120
includes:
117
121
shared:
@@ -141,17 +145,6 @@ tasks:
141
145
run: once
142
146
<...>
143
147
internal: true
144
-
145
-
validate:test: # overwrites the test task to add a dependency towards envtest
0 commit comments