Skip to content

Commit

Permalink
update repo location
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Borrelli <[email protected]>
  • Loading branch information
stevendborrelli committed Nov 14, 2023
1 parent 0b35fb6 commit f4bba8d
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ linters-settings:
- default
- prefix(github.com/crossplane/crossplane-runtime)
- prefix(github.com/crossplane/function-sdk-go)
- prefix(github.com/crossplane-contrib/function-patch-and-transform)
- prefix(github.com/stevendborrelli/function-conditional-patch-and-transform)
- blank
- dot

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# function-patch-and-transform
[![CI](https://github.com/crossplane-contrib/function-patch-and-transform/actions/workflows/ci.yml/badge.svg)](https://github.com/crossplane-contrib/function-patch-and-transform/actions/workflows/ci.yml) ![GitHub release (latest SemVer)](https://img.shields.io/github/release/crossplane-contrib/function-patch-and-transform)
# function-conditional-patch-and-transform
[![CI](https://github.com/stevendborrelli/function-conditional-patch-and-transform/actions/workflows/ci.yml/badge.svg)](https://github.com/stevendborrelli/function-conditional-patch-and-transform/actions/workflows/ci.yml) ![GitHub release (latest SemVer)](https://img.shields.io/github/release/crossplane-contrib/function-conditional-patch-and-transform)

This composition function is a fork of the upstream [function-patch-and-transform](https://github.com/crossplane-contrib/function-patch-and-transform)
that adds support for Conditional invocation of the function and the rendering
of individual resources.

This [composition function][docs-functions] does everything Crossplane's
built-in [patch & transform][docs-pandt] (P&T) composition does. Instead of
Expand All @@ -18,7 +22,7 @@ spec:
pipeline:
- step: patch-and-transform
functionRef:
name: function-patch-and-transform
name: function-conditional-patch-and-transform
input:
apiVersion: pt.fn.crossplane.io/v1beta1
kind: Resources
Expand Down Expand Up @@ -152,7 +156,7 @@ $ crossplane xpkg build -f package --embed-runtime-image=runtime
[docs-composition]: https://docs.crossplane.io/v1.14/getting-started/provider-aws-part-2/#create-a-deployment-template
[docs-functions]: https://docs.crossplane.io/v1.14/concepts/composition-functions/
[docs-pandt]: https://docs.crossplane.io/v1.14/concepts/patch-and-transform/
[fn-go-templating]: https://github.com/crossplane-contrib/function-go-templating
[fn-go-templating]: https://github.com/stevendborrelli/function-go-templating
[#4617]: https://github.com/crossplane/crossplane/issues/4617
[#4746]: https://github.com/crossplane/crossplane/issues/4746
[go]: https://go.dev
Expand Down
2 changes: 1 addition & 1 deletion condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package main
import (
"reflect"

Check failure on line 5 in condition.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/crossplane/crossplane-runtime) -s prefix(github.com/crossplane/function-sdk-go) -s prefix(github.com/stevendborrelli/function-conditional-patch-and-transform) -s blank -s dot --custom-order (gci)
"github.com/crossplane-contrib/function-patch-and-transform/input/v1beta1"
"github.com/crossplane/crossplane-runtime/pkg/errors"

Check failure on line 6 in condition.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/crossplane/crossplane-runtime) -s prefix(github.com/crossplane/function-sdk-go) -s prefix(github.com/stevendborrelli/function-conditional-patch-and-transform) -s blank -s dot --custom-order (gci)
fnv1beta1 "github.com/crossplane/function-sdk-go/proto/v1beta1"
"github.com/google/cel-go/cel"

Check failure on line 8 in condition.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/crossplane/crossplane-runtime) -s prefix(github.com/crossplane/function-sdk-go) -s prefix(github.com/stevendborrelli/function-conditional-patch-and-transform) -s blank -s dot --custom-order (gci)
"github.com/stevendborrelli/function-conditional-patch-and-transform/input/v1beta1"
)

// NewCELEnvironment sets up the CEL Environment
Expand Down
2 changes: 1 addition & 1 deletion condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"strings"
"testing"

"github.com/crossplane-contrib/function-patch-and-transform/input/v1beta1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
fnv1beta1 "github.com/crossplane/function-sdk-go/proto/v1beta1"
"github.com/crossplane/function-sdk-go/resource"
"github.com/google/go-cmp/cmp"
"github.com/stevendborrelli/function-conditional-patch-and-transform/input/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
)

Expand Down
2 changes: 1 addition & 1 deletion connection.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (

Check failure on line 3 in connection.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/crossplane/crossplane-runtime) -s prefix(github.com/crossplane/function-sdk-go) -s prefix(github.com/stevendborrelli/function-conditional-patch-and-transform) -s blank -s dot --custom-order (gci)
"github.com/crossplane-contrib/function-patch-and-transform/input/v1beta1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/fieldpath"
"github.com/crossplane/crossplane-runtime/pkg/reconciler/managed"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/stevendborrelli/function-conditional-patch-and-transform/input/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/json"
)
Expand Down
4 changes: 2 additions & 2 deletions example/composition.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: function-patch-and-transform
name: function-conditional-patch-and-transform
spec:
compositeTypeRef:
apiVersion: example.crossplane.io/v1
Expand All @@ -10,7 +10,7 @@ spec:
pipeline:
- step: patch-and-transform
functionRef:
name: function-patch-and-transform
name: function-conditional-patch-and-transform
input:
apiVersion: pt.fn.crossplane.io/v1beta1
kind: Resources
Expand Down
16 changes: 8 additions & 8 deletions package/crossplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
apiVersion: meta.pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: function-patch-and-transform
name: function-conditional-patch-and-transform
annotations:
meta.crossplane.io/maintainer: Crossplane Maintainers <[email protected]>
meta.crossplane.io/source: github.com/crossplane-contrib/function-patch-and-transform
meta.crossplane.io/source: github.com/stevendborrelli/function-conditional-patch-and-transform
meta.crossplane.io/license: Apache-2.0
meta.crossplane.io/description: A patch & transform composition function
meta.crossplane.io/description: A patch & transform composition function that supports conditionals
meta.crossplane.io/readme: |
This composition function does everything Crossplane's built-in
[patch & transform](https://docs.crossplane.io/latest/concepts/patch-and-transform/)
composition does. Instead of specifying `spec.resources` in your
Composition, you can use this function. See the
[README](https://github.com/crossplane-contrib/function-patch-and-transform)
This composition function is a fork of the upstream [function-patch-and-transform](https://github.com/crossplane-contrib/function-patch-and-transform)
that adds support for Conditional invocation of the function and the rendering
of individual resources.
See the
[README](https://github.com/stevendborrelli/function-conditional-patch-and-transform)
for examples and documentation.
spec: {}
2 changes: 1 addition & 1 deletion patches.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"fmt"
"strings"

"github.com/crossplane-contrib/function-patch-and-transform/input/v1beta1"
"github.com/crossplane/crossplane-runtime/pkg/fieldpath"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/pkg/errors"
"github.com/stevendborrelli/function-conditional-patch-and-transform/input/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
)

Expand Down
2 changes: 1 addition & 1 deletion ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import (
"context"

"github.com/crossplane-contrib/function-patch-and-transform/input/v1beta1"
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/fieldpath"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/stevendborrelli/function-conditional-patch-and-transform/input/v1beta1"
)

// Error strings
Expand Down
2 changes: 1 addition & 1 deletion render.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"github.com/crossplane-contrib/function-patch-and-transform/input/v1beta1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/stevendborrelli/function-conditional-patch-and-transform/input/v1beta1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
2 changes: 1 addition & 1 deletion validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"regexp"

"github.com/crossplane-contrib/function-patch-and-transform/input/v1beta1"
"github.com/stevendborrelli/function-conditional-patch-and-transform/input/v1beta1"
"k8s.io/apimachinery/pkg/util/validation/field"
)

Expand Down

0 comments on commit f4bba8d

Please sign in to comment.