diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml new file mode 100644 index 0000000..16a78d3 --- /dev/null +++ b/.github/workflows/yamllint.yaml @@ -0,0 +1,15 @@ +name: yamllint +on: [pull_request] +jobs: + yamllint: + name: runner / yamllint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: yamllint + uses: reviewdog/action-yamllint@v1.9.0 + with: + reporter: github-pr-review + filter_mode: nofilter + yamllint_flags: 'apis/' + fail_on_error: true diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..669c864 --- /dev/null +++ b/.yamllint @@ -0,0 +1,5 @@ +extends: default + +rules: + line-length: disable + document-start: disable diff --git a/Makefile b/Makefile index 76e73e0..a780743 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ build.init: $(UP) # This target requires the following environment variables to be set: # - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials) -# - To ensure the proper functioning of the end-to-end test resource pre-deletion hook, it is crucial to arrange your resources appropriately. +# - To ensure the proper functioning of the end-to-end test resource pre-deletion hook, it is crucial to arrange your resources appropriately. # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. # - UPTEST_DATASOURCE_PATH (optional), see https://github.com/upbound/uptest#injecting-dynamic-values-and-datasource uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @@ -72,4 +72,12 @@ uptest: $(UPTEST) $(KUBECTL) $(KUTTL) # - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials) e2e: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) uptest -.PHONY: uptest e2e +render: + crossplane beta render examples/cluster-claim.yaml apis/cluster/composition.yaml examples/functions.yaml -r + +yamllint: + @$(INFO) running yamllint + @yamllint ./apis || $(FAIL) + @$(OK) running yamllint + +.PHONY: uptest e2e render yamllint diff --git a/apis/cluster/composition.yaml b/apis/cluster/composition.yaml index d430399..432b815 100644 --- a/apis/cluster/composition.yaml +++ b/apis/cluster/composition.yaml @@ -101,15 +101,15 @@ spec: apiVersion: observe.platform.upbound.io/v1alpha1 kind: XOss patches: - - type: FromCompositeFieldPath - fromFieldPath: spec.parameters.deletionPolicy - toFieldPath: spec.parameters.deletionPolicy - - type: FromCompositeFieldPath - fromFieldPath: spec.parameters.id - toFieldPath: spec.parameters.id - - type: FromCompositeFieldPath - fromFieldPath: spec.parameters.operators.prometheus.version - toFieldPath: spec.parameters.operators.prometheus.version + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.deletionPolicy + toFieldPath: spec.parameters.deletionPolicy + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.id + toFieldPath: spec.parameters.id + - type: FromCompositeFieldPath + fromFieldPath: spec.parameters.operators.prometheus.version + toFieldPath: spec.parameters.operators.prometheus.version - name: XFlux base: diff --git a/examples/functions.yaml b/examples/functions.yaml new file mode 100644 index 0000000..98c28bd --- /dev/null +++ b/examples/functions.yaml @@ -0,0 +1,6 @@ +apiVersion: pkg.crossplane.io/v1beta1 +kind: Function +metadata: + name: upbound-function-patch-and-transform +spec: + package: xpkg.upbound.io/upbound/function-patch-and-transform:v0.2.1 diff --git a/test/setup.sh b/test/setup.sh index 01a3710..a22d68d 100755 --- a/test/setup.sh +++ b/test/setup.sh @@ -2,9 +2,10 @@ set -aeuo pipefail echo "Running setup.sh" -echo "Waiting until configuration package is healthy/installed..." -"${KUBECTL}" wait configuration.pkg platform-ref-aws --for=condition=Healthy --timeout 5m -"${KUBECTL}" wait configuration.pkg platform-ref-aws --for=condition=Installed --timeout 5m +echo "Waiting until all configuration packages are healthy/installed..." +"${KUBECTL}" wait configuration.pkg --all --for=condition=Healthy --timeout 5m +"${KUBECTL}" wait configuration.pkg --all --for=condition=Installed --timeout 5m +"${KUBECTL}" wait configurationrevisions.pkg --all --for=condition=Healthy --timeout 5m echo "Creating cloud credential secret..." "${KUBECTL}" -n upbound-system create secret generic aws-creds --from-literal=credentials="${UPTEST_CLOUD_CREDENTIALS}" \