Skip to content

Commit

Permalink
Link to latest docs
Browse files Browse the repository at this point in the history
This seems like the most future-proof option for this guide, which lives
outside of any version.

Signed-off-by: Nic Cope <[email protected]>
  • Loading branch information
negz committed Nov 1, 2023
1 parent acf6be5 commit 66fe310
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Composition functions (or just functions, for short) are custom programs that
template Crossplane resources. Crossplane calls composition functions to
determine what resources it should create when you create a composite resource
(XR). Read the
[concepts]({{<ref "../../master/concepts/composition-functions">}})
[concepts](/latest/concepts/composition-functions)
page to learn more about composition functions.

You can write a function to template resources using a general purpose
Expand All @@ -22,7 +22,7 @@ conditionals. This guide explains how to write a composition function in

{{< hint "important" >}}
It helps to be familiar with
[how composition functions work]({{<ref "../../master/concepts/composition-functions#how-composition-functions-work">}})
[how composition functions work](/latest/concepts/composition-functions#how-composition-functions-work)
before following this guide.
{{< /hint >}}

Expand Down Expand Up @@ -69,8 +69,8 @@ To write a function in Go you need:

* [Go](https://go.dev/dl/) 1.21 or newer. The guide uses Go 1.21.
* [Docker Engine](https://docs.docker.com/engine/). This guide uses Engine v24.
* The [Crossplane CLI](https://github.com/crossplane/docs/pull/584) v1.14 or
newer. This guide uses Crossplane CLI v1.14.
* The [Crossplane CLI](/latest/cli) v1.14 or newer. This guide uses Crossplane
CLI v1.14.

You don't need access to a Kubernetes cluster or a Crossplane control plane to
build or test a composition function.
Expand Down Expand Up @@ -132,7 +132,7 @@ should delete the `input` and `package/input` directories.

The `input` directory defines a Go struct that a function can use to take input,
using the `input` field from a Composition. The
[composition functions]({{<ref "../../master/concepts/composition-functions">}})
[composition functions](/latest/concepts/composition-functions)
documentation explains how to pass an input to a composition function.

The `package/input` directory contains an OpenAPI schema generated from the
Expand Down Expand Up @@ -732,7 +732,7 @@ spec:

{{<hint "tip">}}
Read the composition functions documentation to learn more about
[testing composition functions]({{<ref "../../master/concepts/composition-functions#test-a-composition-that-uses-functions">}}).
[testing composition functions](/latest/composition-functions#test-a-composition-that-uses-functions).
{{</hint>}}

## Build and push the function to a package registry
Expand All @@ -749,7 +749,7 @@ then pushing all the packages to a single tag in the registry.

Pushing your function to a registry allows you to use your function in a
Crossplane control plane. See the
[composition functions documentation]({{<ref "../../master/concepts/composition-functions">}}).
[composition functions documentation](/latest/concepts/composition-functions).
to learn how to use a function in a control plane.

Use Docker to build a runtime for each platform.
Expand Down Expand Up @@ -800,7 +800,7 @@ crossplane xpkg build \

{{<hint "tip">}}
Crossplane packages are special OCI images. Read more about packages in the
[packages documentation]({{<ref "../../master/concepts/packages">}}).
[packages documentation](/latest/concepts/packages).
{{</hint>}}

Push both package files to a registry. Pushing both files to one tag in the
Expand Down
1 change: 1 addition & 0 deletions utils/htmltest/.htmltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ IgnoreURLs:
- "www.googletagmanager.com/*" # Ignore google tag manager
- "twitter.com/*" # Ignore twitter links since they send to login page
- "https://releases.crossplane.io/stable/current/bin" # S3 bucket listing always returns 404 status even with directory listing
- "docs.crossplane.io/latest/*" # Allow links to the latest release (e.g. from knowledge-base)

0 comments on commit 66fe310

Please sign in to comment.