Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update s3 tests to be ran automated #8

Merged
merged 8 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
# We could run 'make lint' but we prefer this action because it leaves
# 'annotations' (i.e. it comments on PRs to point out linter violations).
- name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_VERSION }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
jobs:
e2e:
uses: upbound/official-providers-ci/.github/workflows/pr-comment-trigger.yml@standard-runners
with:
go-version: 1.23
secrets:
UPTEST_CLOUD_CREDENTIALS: ${{ secrets.UPTEST_CLOUD_CREDENTIALS }}
UPTEST_DATASOURCE: ${{ secrets.UPTEST_DATASOURCE }}
3 changes: 2 additions & 1 deletion cluster/test/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ${KUBECTL} -n upbound-system wait --for=condition=Available deployment --all --t

echo "Creating a default provider config..."
cat <<EOF | ${KUBECTL} apply -f -
apiVersion: upjet-ionoscloud.upbound.io/v1beta1
apiVersion: upjet-ionoscloud.ionoscloud.io/v1beta1
kind: ProviderConfig
metadata:
name: default
Expand All @@ -24,3 +24,4 @@ spec:
name: provider-secret
namespace: upbound-system
key: credentials
EOF
4 changes: 4 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func addTFSingletonConversion(pc *config.Provider) {
continue
}

if r.ShouldUseTerraformPluginFrameworkClient() {
continue
}

// the controller will be reconciling on the CRD API version
// with the converted API (with embedded objects in place of
// singleton lists), so we need the appropriate Terraform
Expand Down
4 changes: 2 additions & 2 deletions examples/mongodb/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
spec:
forProvider:
description: datacenter description
location: es/vit
location: de/txl
name: Datacenter Example
secAuthProtection: false
---
Expand Down Expand Up @@ -41,7 +41,7 @@ spec:
forProvider:
connections:
cidrList:
- 192.168.1.108/24
- 192.168.1.110/24
datacenterIdSelector:
matchLabels:
testing.upbound.io/example-name: datacenter_example
Expand Down
2 changes: 1 addition & 1 deletion examples/s3/bucket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
meta.upbound.io/example-id: s3/v1alpha1/bucket
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
name: ${Rand.RFC1123Subdomain}
spec:
forProvider:
forceDestroy: true
Expand Down
6 changes: 3 additions & 3 deletions examples/s3/bucketcorsconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketcorsconfiguration
labels:
testing.upbound.io/example-name: example
name: darius-v-test
testing.upbound.io/example-name: cors
name: ${Rand.RFC1123Subdomain}
spec:
forProvider: {}
---
Expand All @@ -21,7 +21,7 @@ spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: cors
corsRule:
- allowedHeaders:
- '*'
Expand Down
8 changes: 4 additions & 4 deletions examples/s3/bucketlifecycleconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketlifecycleconfiguration
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
testing.upbound.io/example-name: lifecycle
name: ${Rand.RFC1123Subdomain}
spec:
forProvider: {}
---
Expand All @@ -15,13 +15,13 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketlifecycleconfiguration
labels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: lifecycle
name: example
spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: lifecycle
rule:
- expiration:
days: 30
Expand Down
6 changes: 3 additions & 3 deletions examples/s3/bucketobjectlockconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketobjectlockconfiguration
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
testing.upbound.io/example-name: object-lock
name: ${Rand.RFC1123Subdomain}
spec:
forProvider:
objectLockEnabled: true
Expand All @@ -22,7 +22,7 @@ spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: object-lock
objectLockEnabled: Enabled
rule:
defaultRetention:
Expand Down
6 changes: 3 additions & 3 deletions examples/s3/bucketpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketpolicy
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
testing.upbound.io/example-name: policy
name: ${Rand.RFC1123Subdomain}
spec:
forProvider: {}
---
Expand All @@ -21,7 +21,7 @@ spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: policy
policy: |-
{
"Version": "2012-10-17",
Expand Down
15 changes: 13 additions & 2 deletions examples/s3/bucketpublicaccessblock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@ metadata:
meta.upbound.io/example-id: s3/v1alpha1/bucketpublicaccessblock
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
name: ${Rand.RFC1123Subdomain}
spec:
forProvider:
blockPublicAcls: true
blockPublicPolicy: true
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: object-lock
ignorePublicAcls: false
restrictPublicBuckets: false
---
apiVersion: s3.ionoscloud.io/v1alpha1
kind: Bucket
metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketobjectlockconfiguration
labels:
testing.upbound.io/example-name: object-lock
name: ${Rand.RFC1123Subdomain}
spec:
forProvider: {}
8 changes: 4 additions & 4 deletions examples/s3/bucketserversideencryptionconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketserversideencryptionconfiguration
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
testing.upbound.io/example-name: sse
name: ${Rand.RFC1123Subdomain}
spec:
forProvider: {}
---
Expand All @@ -15,13 +15,13 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketserversideencryptionconfiguration
labels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: sse
name: example
spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: sse
rule:
- applyServerSideEncryptionByDefault:
sseAlgorithm: AES256
8 changes: 4 additions & 4 deletions examples/s3/bucketversioning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketversioning
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
testing.upbound.io/example-name: versioning
name: ${Rand.RFC1123Subdomain}
spec:
forProvider: {}
---
Expand All @@ -15,13 +15,13 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketversioning
labels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: versioning
name: example
spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: versioning
versioningConfiguration:
status: Enabled

13 changes: 4 additions & 9 deletions examples/s3/bucketwebsiteconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketwebsiteconfiguration
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
testing.upbound.io/example-name: website
name: ${Rand.RFC1123Subdomain}
spec:
forProvider: {}
---
Expand All @@ -15,20 +15,15 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/bucketwebsiteconfiguration
labels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: website
name: example
spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: website
indexDocument:
suffix: index.html
errorDocument:
key: error.html
routingRule:
- condition:
keyPrefixEquals: docs/
redirect:
replaceKeyPrefixWith: documents/

4 changes: 2 additions & 2 deletions examples/s3/key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ metadata:
spec:
forProvider:
# needs to be set to true so that the user can create a key
administrator: false
email: unique@email.com
administrator: true
email: ${Rand.RFC1123Subdomain}@email.com
firstName: example
forceSecAuth: false
active: true
Expand Down
8 changes: 4 additions & 4 deletions examples/s3/object.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/object
labels:
testing.upbound.io/example-name: example
name: unique-bucket-name
testing.upbound.io/example-name: object
name: ${Rand.RFC1123Subdomain}
spec:
forProvider:
objectLockEnabled: true
Expand All @@ -16,13 +16,13 @@ metadata:
annotations:
meta.upbound.io/example-id: s3/v1alpha1/object
labels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: object
name: example
spec:
forProvider:
bucketSelector:
matchLabels:
testing.upbound.io/example-name: example
testing.upbound.io/example-name: object
cacheControl: no-cache
content: body
contentDisposition: attachment
Expand Down
6 changes: 3 additions & 3 deletions examples/s3/objectcopy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
meta.upbound.io/example-id: s3/v1alpha1/objectcopy
labels:
testing.upbound.io/example-name: source
name: source
name: source-x-test-object-copy
spec:
forProvider: {}

Expand All @@ -18,7 +18,7 @@ metadata:
meta.upbound.io/example-id: s3/v1alpha1/objectcopy
labels:
testing.upbound.io/example-name: target
name: target
name: target-${Rand.RFC1123Subdomain}
spec:
forProvider: {}

Expand Down Expand Up @@ -56,4 +56,4 @@ spec:
matchLabels:
testing.upbound.io/example-name: target
key: example
source: source/source_object
source: source-x-test-object-copy/source_object
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/ionos-cloud/provider-upjet-ionoscloud

go 1.22.0

toolchain go1.22.4
go 1.23

require (
dario.cat/mergo v1.0.0
Expand Down
Loading