Skip to content

Commit 9ceb462

Browse files
Merge pull request #11 from upbound/crossplane-org
Change org to crossplane
2 parents 8df1199 + 713f11d commit 9ceb462

File tree

7 files changed

+29
-19
lines changed

7 files changed

+29
-19
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ env:
2828

2929
# The OCI/Docker Repository to push our images to.
3030
# By Default this points to Github Package Registry.
31-
# XPKG_REPO: ghcr.io/${{ github.repository_owner }}
31+
XPKG_REPO: ghcr.io/${{ github.repository_owner }}
3232

3333
# The example template pushes to Upbound Marketplace
34-
XPKG_REPO: xpkg.upbound.io/${{ github.repository_owner }}
34+
#XPKG_REPO: xpkg.upbound.io/${{ github.repository_owner }}
3535

3636
# Names for the Configuration and corresponding Function Packages
3737
XPKG_NAME: ${{ github.event.repository.name }}

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Crossplane Function Template - TypeScript <!-- omit in toc -->
22

3-
This repository is a template for building Crossplane composition functions in TypeScript using the [@crossplane-org/function-sdk-typescript](https://github.com/upbound/function-sdk-typescript).
3+
This repository is a template for building Crossplane composition functions in TypeScript using the [@crossplane-org/function-sdk-typescript](https://github.com/crossplane/function-sdk-typescript).
44

55
- [Overview](#overview)
6+
- [Quick Start](#quick-start)
67
- [Running the Example Package](#running-the-example-package)
78
- [Installing the Package](#installing-the-package)
89
- [Deploy the Example Manifest](#deploy-the-example-manifest)
@@ -55,6 +56,15 @@ create any type of Kubernetes resource.
5556

5657
For an example of configuring cloud resources, refer to [configuration-aws-network-ts](https://github.com/upbound/configuration-aws-network-ts).
5758

59+
## Quick Start
60+
61+
1. Clone this repository
62+
2. Update [package.json](package.json) for your Project.
63+
3. Update the code at [src/function.ts](src/function.ts)
64+
4. Create your API (`CompositeResourceDefinition`) like the one for `App` in [package-configuration/apis/apps/definition.yaml](package-configuration/apis/apps/definition.yaml)
65+
5. Create an example in the `examples` directory like [examples/apps/example.yaml](examples/apps/example.yaml)
66+
6. Build, locally-run and `crossplane render` your Composition. See the [Development](#development) section.
67+
5868
## Running the Example Package
5969

6070
The configuration and function are published to the [Upbound Marketplace](https://marketplace.upbound.io),
@@ -71,7 +81,7 @@ kind: Configuration
7181
metadata:
7282
name: configuration-template-typescript
7383
spec:
74-
package: xpkg.upbound.io/function-template-typescript:v0.1.0
84+
package: xpkg.upbound.io/crossplane/function-template-typescript:v0.1.0
7585
```
7686
7787
Once installed, confirm that the package and dependencies are installed:
@@ -84,8 +94,8 @@ Configuration/configuration-template-typescript
8494
├─ ConfigurationRevision/configuration-template-typescript-93b73b00eb21 v0.1.0 - - Active
8595
├─ Function/crossplane-contrib-function-auto-ready v0.6.0 True True - HealthyPackageRevision
8696
│ └─ FunctionRevision/crossplane-contrib-function-auto-ready-59868730b9a9 v0.6.0 - - Active
87-
└─ Function/upbound-function-template-typescript-function v0.1.0 True True - HealthyPackageRevision
88-
└─ FunctionRevision/upbound-function-template-typescript-function-cd83fe939bc7 v0.1.0 -
97+
└─ Function/crossplane-function-template-typescript-function v0.1.0 True True - HealthyPackageRevision
98+
└─ FunctionRevision/crossplane-function-template-typescript-function-cd83fe939bc7 v0.1.0 -
8999
```
90100

91101
### Deploy the Example Manifest
@@ -261,7 +271,7 @@ node dist/main.js --insecure --debug
261271
Once the function is running locally, `crossplane render` can be used to render examples:
262272

263273
```shell
264-
crossplane render examples/app/example.yaml package-configuration/apis/apps/composition.yaml examples/functions.yaml
274+
crossplane render examples/apps/example.yaml package-configuration/apis/apps/composition.yaml examples/functions.yaml
265275
```
266276

267277
### Available CLI Options
@@ -392,7 +402,7 @@ spec:
392402
# Make this match your function
393403
- apiVersion: pkg.crossplane.io/v1
394404
kind: Function
395-
package: xpkg.upbound.io/upbound/function-template-typescript-function
405+
package: xpkg.upbound.io/crossplane/function-template-typescript-function
396406
version: '>=v0.1.0'
397407
```
398408
@@ -406,14 +416,14 @@ Since the Kind in the template function is an `App`, we create a subdirectory `a
406416

407417
Update the `composition.yaml` file to have the functionRef of the first pipeline step to refer to the name
408418
of the function once it is installed. Crossplane creates a function name of `<docker repository>-<function-name>`,
409-
so `xpkg.upbound.io/upbound/function-template-typescript-function` would have a `functionRef.name` of
410-
`upbound-function-template-typescript-function`.
419+
so `xpkg.upbound.io/crossplane/function-template-typescript-function` would have a `functionRef.name` of
420+
`crossplane-function-template-typescript-function`.
411421

412422
Update the value with the name that represents the Docker registry and image where the function was pushed.
413423

414424
```yaml
415425
- functionRef:
416-
name: upbound-function-template-typescript-function
426+
name: crossplane-function-template-typescript-function
417427
step: app
418428
```
419429

env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ CONFIGURATION_NAME=$(npm pkg get name | tr -d '"')
33
FN_NAME=${CONFIGURATION_NAME}-function
44

55
# Change this to your docker repo
6-
# XPKG_REPO=ghcr.io/crossplane
7-
XPKG_REPO=xpkg.upbound.io/upbound
6+
XPKG_REPO=ghcr.io/crossplane
7+
88
BUILD_PLATFORMS="amd64 arm64"
99
BUILD_DIR=_build
1010
DOCKER_IMAGE_DIR=${BUILD_DIR}/docker_images

examples/functions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
# This tells crossplane beta render to connect to the function locally.
88
render.crossplane.io/runtime: Development
99
spec:
10-
package: xpkg.upbound.io/upbound/function-template-typescript:v0.1.0
10+
package: xpkg.upbound.io/crossplane/function-template-typescript:v0.1.0
1111
---
1212
apiVersion: pkg.crossplane.io/v1beta1
1313
kind: Function

package-configuration/crossplane.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ metadata:
55
name: function-template-typescript
66
annotations:
77
meta.crossplane.io/maintainer: Crossplane Maintainers <info@crossplane.io>
8-
meta.crossplane.io/source: https://github.com/upbound/function-template-typescript
8+
meta.crossplane.io/source: https://github.com/crossplane/function-template-typescript
99
meta.crossplane.io/license: Apache-2.0
1010
meta.crossplane.io/description: |
1111
This function is an example Crossplane function written in Typescript.
1212
meta.crossplane.io/readme: |
13-
See https://github.com/upbound/function-template-typescript/blob/main/README.md for
13+
See https://github.com/crossplane/function-template-typescript/blob/main/README.md for
1414
customizing this function.
1515
spec:
1616
capabilities:

package-function/crossplane.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ metadata:
55
name: function-template-typescript-function
66
annotations:
77
meta.crossplane.io/maintainer: Crossplane Maintainers <info@crossplane.io>
8-
meta.crossplane.io/source: https://github.com/upbound/function-template-typescript
8+
meta.crossplane.io/source: https://github.com/crossplane/function-template-typescript
99
meta.crossplane.io/license: Apache-2.0
1010
meta.crossplane.io/description: |
1111
This function is an example Crossplane function written in Typescript.
1212
meta.crossplane.io/readme: |
13-
See https://github.com/upbound/function-template-typescript/blob/main/README.md for
13+
See https://github.com/crossplane/function-template-typescript/blob/main/README.md for
1414
customizing this function.
1515
spec:
1616
capabilities:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"repository": {
1111
"type": "git",
12-
"url": "github.com/upbound/function-template-typescript"
12+
"url": "github.com/crossplane/function-template-typescript"
1313
},
1414
"license": "Apache-2.0",
1515
"author": "Crossplane Authors <info@crossplane.org>",

0 commit comments

Comments
 (0)