Code Monkey home page Code Monkey logo

function-dummy's Introduction

function-dummy

CI GitHub release (latest SemVer)

This composition function returns whatever you tell it to.

Provide a YAML-serialized RunFunctionResponse as the function's input. The response's desired object will be merged onto any desired state that was passed to the function using proto.Merge semantics.

Here's an example:

apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: test-crossplane
spec:
  compositeTypeRef:
    apiVersion: example.crossplane.io/v1beta1
    kind: XR
  pipeline:
  - step: return-some-results
    functionRef:
      name: function-dummy
    input:
      apiVersion: dummy.fn.crossplane.io/v1beta1
      kind: Response
      response:
        desired:
          composite:
            resource:
              status:
                widgets: 200
            connectionDetails:
              very: secret
          resources:
            cool-resource:
              resource:
                apiVersion: example.org/v1
                kind: Composed
                spec: {} # etc...
              ready: READY_TRUE
        results:
        - severity: SEVERITY_NORMAL
          message: "I did the thing!"

See the example directory for an example you can run locally using the Crossplane CLI:

$ crossplane beta render xr.yaml composition.yaml functions.yaml

See the composition functions documentation to learn more about crossplane beta render.

Developing this function

This function uses Go, Docker, and the Crossplane CLI to build functions.

# Run code generation - see input/generate.go
$ go generate ./...

# Run tests - see fn_test.go
$ go test ./...

# Build the function's runtime image - see Dockerfile
$ docker build . --tag=runtime

# Build a function package - see package/crossplane.yaml
$ crossplane xpkg build -f package --embed-runtime-image=runtime

function-dummy's People

Contributors

negz avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

negz turkenh moolen

function-dummy's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
  • docker/dockerfile 1
  • golang 1
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-go v4
  • golangci/golangci-lint-action v3
  • actions/checkout v4
  • actions/setup-go v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • actions/checkout v4
  • docker/build-push-action v5
  • actions/upload-artifact v3
  • actions/checkout v4
  • actions/download-artifact v3
  • docker/login-action v3
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
gomod
go.mod
  • go 1.21
  • go 1.21.3
  • github.com/alecthomas/kong v0.8.1
  • github.com/crossplane/crossplane-runtime v1.14.1
  • github.com/crossplane/function-sdk-go v0.1.0
  • github.com/google/go-cmp v0.6.0
  • google.golang.org/protobuf v1.31.0
  • k8s.io/apimachinery v0.28.3
  • sigs.k8s.io/controller-tools v0.13.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.