mirror of
https://github.com/gravitational/teleport.git
synced 2026-10-12 02:15:01 +00:00
* Add a resource reference generator Closes #16948 Closes #9949 Implements RFD 130. See the included README for information about how the generator works. This implementation breaks from, and updates, RFD 130: - The reference includes separate pages for dynamic resources in order to make it easier to read. Edit the RFD to be less specific about the output template so this isn't wedded to implementation details. - The generator uses a YAML configuration file. This is because the config ended up including more fields than specified in the RFD, so separating the config from the source made sense to give users less noise to deal with. - The generator requires that a user specify the resources to include in the reference docs. This makes it easier to start with a smaller, more manageable set of resource reference docs. - Support RFD 153 in the reference generator: RFD 153 resource types include unexported fields and include a `Metadata` field from a different package than legacy resources types. They also include the `Metadata` field with a pointer. Adjust the generator to ignore unexported fields in struct declarations, and to treat pointer field types the same way as value field types. - Remove the description of example YAML delimiters. These are no longer viable, as we maintain several documentation generators that extract comments from the source. Instead, if we can't generate example YAML, show a comment in the YAML example advising the reader to read the description of a field. Other changes: - Add a Make target for generating dynamic resource reference documentation, plus a target for checking that the resource reference docs are up to date. Run the checker in the `Lint (Proto)` job. - Generate reference docs for Bot, RoleV6, OIDCConnectorV3, and SAMLConnectorV2. * Clean up the resource reference generator - Remove an unneeded import. - Use slices.SortFunc instead of sort.Sort for sorting reference entry fields. - Change `errors.Is(err, NotAGenDeclError{})` calls to use `errors.As`. While `NotAGenDeclError{}` structs are always empty, using `errors.As` ensures the calls still do the same thing if we add fields to the type.
Dockerized Teleport Build
This directory is used to produce a containerized production Teleport build. No need to have Golang. Only Docker is required.
It is a part of Gravitational CI/CD pipeline. To build Teleport type:
make
Safely updating build box Dockerfiles
The build box images are used in GitHub Actions. The resulting image is pushed to ghcr.io. This means that to safely introduce changes to Dockerfiles, those changes should be split into two stages:
- First you open a PR which updates a Dockerfile and get the PR merged.
- Once it's merged, GitHub Actions is going to pick it up, build a new build box image and push it to ghcr.io
- Then you can open another PR which starts using the new build box image.
DynamoDB static binary docker build
The static binary will be built along with all nodejs assets inside the container. From the root directory of the source checkout run:
docker build -f build.assets/Dockerfile.dynamodb -t teleportbuilder .
Then you can upload the result to an S3 bucket for release.
docker run -it -e AWS_ACL=public-read -e S3_BUCKET=my-teleport-releases -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY teleportbuilder
Or simply copy the binary out of the image using a volume (it will be copied to current directory/build/teleport).
docker run -v $(pwd)/build:/builds -it teleportbuilder cp /gopath/src/github.com/gravitational/teleport/teleport.tgz /builds