Skip to content

Commit

Permalink
Merge pull request #42 from muvaf/sync-upstream-release-1.7
Browse files Browse the repository at this point in the history
Sync upstream release 1.7
  • Loading branch information
muvaf authored Jun 14, 2022
2 parents 5cbc836 + f09965a commit c83c0be
Show file tree
Hide file tree
Showing 20 changed files with 218 additions and 40 deletions.
130 changes: 130 additions & 0 deletions .github/workflows/configurations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: Configurations

on:
push:
branches:
- master
- release-*
workflow_dispatch: {}

env:
DOCKER_USR: ${{ secrets.UPBOUND_XP_ROBOT_USR }}

jobs:
getting-started-with-aws:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
# The tagger step uses the same logic in the build submodule to generate package tag
# https://github.com/upbound/build/blob/4f64913157a952dbe77cd9e05457d9abe695a1d4/makelib/common.mk#L193
- name: Set tag
run: echo "::set-output name=VERSION_TAG::$(git describe --dirty --always --tags | sed 's/-/./2' | sed 's/-/./2' )"
id: tagger
- name: Login to Docker
uses: docker/login-action@v1
if: env.DOCKER_USR != ''
with:
registry: registry.upbound.io
username: ${{ secrets.UPBOUND_XP_ROBOT_USR }}
password: ${{ secrets.UPBOUND_XP_ROBOT_PSW }}
- name: Build
uses: crossplane-contrib/[email protected]
with:
channel: master
version: current
command: build configuration -f docs/snippets/package/aws --name=getting-started-with-aws.xpkg
- name: Push
uses: crossplane-contrib/[email protected]
with:
command: push configuration -f docs/snippets/package/aws/getting-started-with-aws.xpkg registry.upbound.io/xp/getting-started-with-aws:${{ steps.tagger.outputs.VERSION_TAG }}

getting-started-with-aws-with-vpc:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Set tag
run: echo "::set-output name=VERSION_TAG::$(git describe --dirty --always --tags | sed 's/-/./2' | sed 's/-/./2' )"
id: tagger
- name: Login to Docker
uses: docker/login-action@v1
if: env.DOCKER_USR != ''
with:
registry: registry.upbound.io
username: ${{ secrets.UPBOUND_XP_ROBOT_USR }}
password: ${{ secrets.UPBOUND_XP_ROBOT_PSW }}
- name: Build
uses: crossplane-contrib/[email protected]
with:
channel: master
version: current
command: build configuration -f docs/snippets/package/aws-with-vpc --name=getting-started-with-aws-with-vpc.xpkg
- name: Push
uses: crossplane-contrib/[email protected]
with:
command: push configuration -f docs/snippets/package/aws-with-vpc/getting-started-with-aws-with-vpc.xpkg registry.upbound.io/xp/getting-started-with-aws-with-vpc:${{ steps.tagger.outputs.VERSION_TAG }}

getting-started-with-gcp:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Set tag
run: echo "::set-output name=VERSION_TAG::$(git describe --dirty --always --tags | sed 's/-/./2' | sed 's/-/./2' )"
id: tagger
- name: Login to Docker
uses: docker/login-action@v1
if: env.DOCKER_USR != ''
with:
registry: registry.upbound.io
username: ${{ secrets.UPBOUND_XP_ROBOT_USR }}
password: ${{ secrets.UPBOUND_XP_ROBOT_PSW }}
- name: Build
uses: crossplane-contrib/[email protected]
with:
channel: master
version: current
command: build configuration -f docs/snippets/package/gcp --name=getting-started-with-gcp.xpkg
- name: Push
uses: crossplane-contrib/[email protected]
with:
command: push configuration -f docs/snippets/package/gcp/getting-started-with-gcp.xpkg registry.upbound.io/xp/getting-started-with-gcp:${{ steps.tagger.outputs.VERSION_TAG }}

getting-started-with-azure:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- name: Set tag
run: echo "::set-output name=VERSION_TAG::$(git describe --dirty --always --tags | sed 's/-/./2' | sed 's/-/./2' )"
id: tagger
- name: Login to Docker
uses: docker/login-action@v1
if: env.DOCKER_USR != ''
with:
registry: registry.upbound.io
username: ${{ secrets.UPBOUND_XP_ROBOT_USR }}
password: ${{ secrets.UPBOUND_XP_ROBOT_PSW }}
- name: Build
uses: crossplane-contrib/[email protected]
with:
channel: master
version: current
command: build configuration -f docs/snippets/package/azure --name=getting-started-with-azure.xpkg
- name: Push
uses: crossplane-contrib/[email protected]
with:
command: push configuration -f docs/snippets/package/azure/getting-started-with-azure.xpkg registry.upbound.io/xp/getting-started-with-azure:${{ steps.tagger.outputs.VERSION_TAG }}
6 changes: 4 additions & 2 deletions docs/concepts/managed-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ of Crossplane managed resources. Following is an example of a managed resource:
<div class="tab-content">
<div class="tab-pane fade in active" id="aws-tab-1" markdown="1">

The AWS provider supports provisioning an [RDS] instance via the `RDSInstance`
The AWS provider supports provisioning an [RDS][rds] instance via the `RDSInstance`
managed resource it adds to Crossplane.

```yaml
Expand Down Expand Up @@ -89,7 +89,7 @@ kubectl delete rdsinstance rdspostgresql
</div>
<div class="tab-pane fade" id="gcp-tab-1" markdown="1">

The GCP provider supports provisioning a [CloudSQL] instance with the
The GCP provider supports provisioning a [CloudSQL][cloudsql] instance with the
`CloudSQLInstance` managed resource it adds to Crossplane.

```yaml
Expand Down Expand Up @@ -438,6 +438,8 @@ using needs to store `annotations` and `spec` fields, which most tools do
including Velero.

[term-xrm]: terminology.md#crossplane-resource-model
[rds]: https://aws.amazon.com/rds/
[cloudsql]: https://cloud.google.com/sql
[composition]: composition.md
[api-versioning]: https://kubernetes.io/docs/reference/using-api/api-overview/#api-versioning
[velero]: https://velero.io/
Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/create-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ you may specify a specific package by using the `-f` flag.
```console
# Set this to the Docker Hub username or OCI registry you wish to use.
REG=my-package-repo
kubectl crossplane push configuration ${REG}/getting-started-with-aws:v1.7.0
kubectl crossplane push configuration ${REG}/getting-started-with-aws:v1.7.2
```

> Note that the Crossplane CLI will not follow symbolic links for files in the
Expand Down Expand Up @@ -631,7 +631,7 @@ you may specify a specific package by using the `-f` flag.
```console
# Set this to the Docker Hub username or OCI registry you wish to use.
REG=my-package-repo
kubectl crossplane push configuration ${REG}/getting-started-with-aws-with-vpc:v1.7.0
kubectl crossplane push configuration ${REG}/getting-started-with-aws-with-vpc:v1.7.2
```

> Note that the Crossplane CLI will not follow symbolic links for files in the
Expand Down Expand Up @@ -670,7 +670,7 @@ you may specify a specific package by using the `-f` flag.
```console
# Set this to the Docker Hub username or OCI registry you wish to use.
REG=my-package-repo
kubectl crossplane push configuration ${REG}/getting-started-with-gcp:v1.7.0
kubectl crossplane push configuration ${REG}/getting-started-with-gcp:v1.7.2
```

> Note that the Crossplane CLI will not follow symbolic links for files in the
Expand Down Expand Up @@ -709,7 +709,7 @@ you may specify a specific package by using the `-f` flag.
```console
# Set this to the Docker Hub username or OCI registry you wish to use.
REG=my-package-repo
kubectl crossplane push configuration ${REG}/getting-started-with-azure:v1.7.0
kubectl crossplane push configuration ${REG}/getting-started-with-azure:v1.7.2
```

> Note that the Crossplane CLI will not follow symbolic links for files in the
Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/install-configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ provider that can satisfy a `PostgreSQLInstance`. Let's get started!
> section.
```console
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-aws:v1.7.0
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-aws:v1.7.2
```

Wait until all packages become healthy:
Expand Down Expand Up @@ -300,7 +300,7 @@ kubectl apply -f https://raw.githubusercontent.com/crossplane/crossplane/release
> section.
```console
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-aws-with-vpc:v1.7.0
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-aws-with-vpc:v1.7.2
```

Wait until all packages become healthy:
Expand Down Expand Up @@ -357,7 +357,7 @@ kubectl apply -f https://raw.githubusercontent.com/crossplane/crossplane/release
> section.
```console
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-gcp:v1.7.0
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-gcp:v1.7.2
```

Wait until all packages become healthy:
Expand Down Expand Up @@ -430,7 +430,7 @@ spec:
> section.
```console
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-azure:v1.7.0
kubectl crossplane install configuration registry.upbound.io/xp/getting-started-with-azure:v1.7.2
```

Wait until all packages become healthy:
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/xpkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ installing objects that configure new resource types, and starting controllers
to reconcile them. An OCI image that contains valid Crossplane package content
is commonly referred to as an `xpkg` ("ex-package"). This document provides the
specification for a valid `xpkg`, which can be considered a superset of the
requirements detailed in [OCI image specification]. It is divided into two broad
sections: requirements related to OCI image format and requirements related to
Crossplane `package.yaml` contents.
requirements detailed in the [OCI image specification]. It is divided into two
broad sections: requirements related to OCI image format and requirements
related to Crossplane `package.yaml` contents.

- [OCI Image Format](#oci-image-format)
- [Indexes](#indexes)
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/apiextensions/claim/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
}

if err := r.claim.AddFinalizer(ctx, cm); err != nil {
log.Debug(errAddFinalizer, "error")
log.Debug(errAddFinalizer, "error", err)
err = errors.Wrap(err, errAddFinalizer)
record.Event(cm, event.Warning(reasonBind, err))
return reconcile.Result{}, err
Expand Down
6 changes: 5 additions & 1 deletion internal/controller/apiextensions/claim/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package claim

import (
"context"
"io"
"testing"

"github.com/google/go-cmp/cmp"
Expand All @@ -26,11 +27,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/logging"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/crossplane/crossplane-runtime/pkg/resource/fake"
"github.com/crossplane/crossplane-runtime/pkg/resource/unstructured/claim"
Expand All @@ -40,6 +43,7 @@ import (

func TestReconcile(t *testing.T) {
errBoom := errors.New("boom")
testLog := logging.NewLogrLogger(zap.New(zap.UseDevMode(true), zap.WriteTo(io.Discard)).WithName("testlog"))
name := "coolclaim"

type args struct {
Expand Down Expand Up @@ -487,7 +491,7 @@ func TestReconcile(t *testing.T) {

for name, tc := range cases {
t.Run(name, func(t *testing.T) {
r := NewReconciler(tc.args.mgr, tc.args.of, tc.args.with, tc.args.opts...)
r := NewReconciler(tc.args.mgr, tc.args.of, tc.args.with, append(tc.args.opts, WithLogger(testLog))...)
got, err := r.Reconcile(context.Background(), reconcile.Request{})

if diff := cmp.Diff(tc.want.err, err, test.EquateErrors()); diff != "" {
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/apiextensions/composite/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
}

if err := r.composite.RemoveFinalizer(ctx, cr); err != nil {
log.Debug(errRemoveFinalizer, "error")
log.Debug(errRemoveFinalizer, "error", err)
err = errors.Wrap(err, errRemoveFinalizer)
r.record.Event(cr, event.Warning(reasonDelete, err))
return reconcile.Result{}, err
Expand All @@ -425,7 +425,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (reco
}

if err := r.composite.AddFinalizer(ctx, cr); err != nil {
log.Debug(errAddFinalizer, "error")
log.Debug(errAddFinalizer, "error", err)
err = errors.Wrap(err, errAddFinalizer)
r.record.Event(cr, event.Warning(reasonInit, err))
return reconcile.Result{}, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package composite

import (
"context"
"io"
"testing"

"github.com/google/go-cmp/cmp"
Expand All @@ -27,10 +28,12 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/utils/pointer"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/logging"
"github.com/crossplane/crossplane-runtime/pkg/reconciler/managed"
"github.com/crossplane/crossplane-runtime/pkg/resource"
"github.com/crossplane/crossplane-runtime/pkg/resource/fake"
Expand All @@ -42,6 +45,7 @@ import (

func TestReconcile(t *testing.T) {
errBoom := errors.New("boom")
testLog := logging.NewLogrLogger(zap.New(zap.UseDevMode(true), zap.WriteTo(io.Discard)).WithName("testlog"))
cd := managed.ConnectionDetails{"a": []byte("b")}

type args struct {
Expand Down Expand Up @@ -840,7 +844,7 @@ func TestReconcile(t *testing.T) {

for name, tc := range cases {
t.Run(name, func(t *testing.T) {
r := NewReconciler(tc.args.mgr, tc.args.of, tc.args.opts...)
r := NewReconciler(tc.args.mgr, tc.args.of, append(tc.args.opts, WithLogger(testLog))...)
got, err := r.Reconcile(context.Background(), reconcile.Request{})

if diff := cmp.Diff(tc.want.err, err, test.EquateErrors()); diff != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package composition

import (
"context"
"io"
"testing"

"github.com/google/go-cmp/cmp"
Expand All @@ -26,11 +27,13 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/logging"
"github.com/crossplane/crossplane-runtime/pkg/resource/fake"
"github.com/crossplane/crossplane-runtime/pkg/test"
v1 "github.com/crossplane/crossplane/apis/apiextensions/v1"
Expand All @@ -39,6 +42,7 @@ import (

func TestReconcile(t *testing.T) {
errBoom := errors.New("boom")
testLog := logging.NewLogrLogger(zap.New(zap.UseDevMode(true), zap.WriteTo(io.Discard)).WithName("testlog"))
ctrl := true

comp := &v1.Composition{
Expand Down Expand Up @@ -324,7 +328,7 @@ func TestReconcile(t *testing.T) {

for name, tc := range cases {
t.Run(name, func(t *testing.T) {
r := NewReconciler(tc.args.mgr, tc.args.opts...)
r := NewReconciler(tc.args.mgr, append(tc.args.opts, WithLogger(testLog))...)
got, err := r.Reconcile(context.Background(), reconcile.Request{})

if diff := cmp.Diff(tc.want.err, err, test.EquateErrors()); diff != "" {
Expand Down
Loading

0 comments on commit c83c0be

Please sign in to comment.