Skip to content

Commit 2ede33e

Browse files
committed
Update crate name to function-sdk-rust
Signed-off-by: Jonasz Łasut-Balcerzak <jonasz@upbound.io>
1 parent 38b47a2 commit 2ede33e

12 files changed

Lines changed: 75 additions & 49 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ jobs:
2222

2323
- name: Verify tag matches package version
2424
run: |
25-
pkg_version=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="crossplane-function-sdk") | .version')
25+
pkg_version=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="function-sdk-rust") | .version')
2626
tag_version=${GITHUB_REF_NAME#v}
2727
if [ "$pkg_version" != "$tag_version" ]; then
2828
echo "Tag $GITHUB_REF_NAME does not match sdk/Cargo.toml version $pkg_version" >&2
2929
exit 1
3030
fi
3131
3232
- name: Dry-run package build
33-
run: cargo publish -p crossplane-function-sdk --dry-run
33+
run: cargo publish -p function-sdk-rust --dry-run
3434

3535
- uses: rust-lang/crates-io-auth-action@v1
3636
id: auth
3737

3838
- name: Publish to crates.io
39-
run: cargo publish -p crossplane-function-sdk
39+
run: cargo publish -p function-sdk-rust
4040
env:
4141
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
4242

‎.github/workflows/tag.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tag
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version (e.g. v0.1.0)'
8+
required: true
9+
message:
10+
description: 'Tag message'
11+
required: true
12+
13+
jobs:
14+
create-tag:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20+
21+
- name: Create Tag
22+
uses: negz/create-tag@8dce6c9d9b12d161abe01c02d2b03f19e2e9e9bb # v2
23+
with:
24+
version: ${{ github.event.inputs.version }}
25+
message: ${{ github.event.inputs.message }}
26+
token: ${{ secrets.GITHUB_TOKEN }}

‎Cargo.lock‎

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ for working with requests and responses.
1010

1111
## Layout
1212

13-
- `sdk/` - the `crossplane-function-sdk` crate.
13+
- `sdk/` - the `function-sdk-rust` crate.
1414
- `proto/v1/run_function.proto` - the vendored protocol definition.
1515
- `src/generated/` - checked-in code generated from the proto: prost types,
1616
the tonic gRPC server and client, protojson serde impls (pbjson), and the
@@ -23,9 +23,9 @@ for working with requests and responses.
2323
## Writing a function
2424

2525
```rust
26-
use crossplane_function_sdk::proto::v1::function_runner_service_server::FunctionRunnerService;
27-
use crossplane_function_sdk::proto::v1::{RunFunctionRequest, RunFunctionResponse};
28-
use crossplane_function_sdk::{resource, response};
26+
use function_sdk_rust::proto::v1::function_runner_service_server::FunctionRunnerService;
27+
use function_sdk_rust::proto::v1::{RunFunctionRequest, RunFunctionResponse};
28+
use function_sdk_rust::{resource, response};
2929
use tonic::{Request, Response, Status};
3030

3131
struct Function;

‎example/Cargo.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ version = "0.1.0"
44
edition.workspace = true
55
license.workspace = true
66
publish = false
7-
description = "An example Crossplane composition function built with crossplane-function-sdk"
7+
description = "An example Crossplane composition function built with function-sdk-rust"
88

99
[dependencies]
10-
crossplane-function-sdk = { path = "../sdk" }
10+
function-sdk-rust = { path = "../sdk" }
1111
tonic = "0.14"
1212
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
1313
clap = { version = "4", features = ["derive", "env"] }

‎example/src/function.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
//! whose API version comes from the function's input, mirroring the
55
//! function-template-python example.
66
7-
use crossplane_function_sdk::proto::v1::function_runner_service_server::FunctionRunnerService;
8-
use crossplane_function_sdk::proto::v1::{RunFunctionRequest, RunFunctionResponse};
9-
use crossplane_function_sdk::{resource, response};
7+
use function_sdk_rust::proto::v1::function_runner_service_server::FunctionRunnerService;
8+
use function_sdk_rust::proto::v1::{RunFunctionRequest, RunFunctionResponse};
9+
use function_sdk_rust::{resource, response};
1010
use tonic::{Request, Response, Status};
1111

1212
#[derive(Debug, Default)]

‎example/src/main.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! The composition function's CLI entrypoint.
22
33
use clap::Parser;
4-
use crossplane_function_sdk::{Args, logging, serve};
4+
use function_sdk_rust::{Args, logging, serve};
55

66
mod function;
77

88
#[tokio::main]
9-
async fn main() -> Result<(), crossplane_function_sdk::Error> {
9+
async fn main() -> Result<(), function_sdk_rust::Error> {
1010
let args = Args::parse();
1111
logging::configure(args.debug);
1212
serve(function::Function, &args).await

‎sdk/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "crossplane-function-sdk"
2+
name = "function-sdk-rust"
33
version = "0.1.0"
44
edition.workspace = true
55
license.workspace = true

‎sdk/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# crossplane-function-sdk
1+
# function-sdk-rust
22

33
A Rust SDK for writing [Crossplane](https://www.crossplane.io)
44
[composition functions](https://docs.crossplane.io/latest/composition/compositions/).

‎sdk/src/response.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ pub fn to(req: &RunFunctionRequest, ttl: Duration) -> RunFunctionResponse {
4141
/// Returns the added result so a reason or target can be set on it:
4242
///
4343
/// ```
44-
/// # use crossplane_function_sdk::proto::v1::{RunFunctionResponse, Target};
45-
/// # use crossplane_function_sdk::response;
44+
/// # use function_sdk_rust::proto::v1::{RunFunctionResponse, Target};
45+
/// # use function_sdk_rust::response;
4646
/// # let mut rsp = RunFunctionResponse::default();
4747
/// let result = response::normal(&mut rsp, "created the bucket");
4848
/// result.reason = Some("CreatedBucket".to_string());

0 commit comments

Comments
 (0)