Skip to content

Commit

Permalink
automated commit
Browse files Browse the repository at this point in the history
Signed-off-by: Public copy <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 15, 2024
1 parent ee9f39d commit 6ba34bb
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 6 deletions.
40 changes: 40 additions & 0 deletions images/crossplane/tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,46 @@ resource "imagetest_feature" "basic" {
name = "Install crossplane",
cmd = module.helm_crossplane.install_cmd
},
{
name = "Let's trigger the e2e tests"
cmd = <<EOEe2e
kubectl apply -f /tests/provider-nop.yaml
# wait until provider-nop is Healthy
kubectl wait --for=condition=Healthy providers/provider-nop --timeout 5m
# let's apply the nopresource
kubectl apply -f /tests/nopresource.yaml
# wait until nopresource is Ready
kubectl wait --for=condition=Ready nopresources/example --timeout 5m
# now let's check the secret in crossplane-system named nop-example-resource and wait until its available
until kubectl get secret nop-example-resource -n crossplane-system >/dev/null 2>&1; do
echo "Waiting for secret nop-example-resource to be available..."
sleep 5
done
echo "Secret nop-example-resource is now available."
# Extract and decode secret values
secret_data=$(kubectl get secret nop-example-resource -n crossplane-system -o json | jq -r '.data | to_entries[] | .key + ": " + (.value | @base64d)' | sort)
# Extract YAML values
yaml_data=$(yq '.spec.forProvider.connectionDetails[] | "\(.name): \(.value)"' /tests/nopresource.yaml | sort)
# Compare sorted data
echo "Comparing Secret with YAML values:"
diff <(echo "$secret_data") <(echo "$yaml_data")
if [ $? -eq 0 ]; then
echo "The secret data matches the YAML values."
else
echo "The secret data does not match the YAML values."
exit 1
fi
EOEe2e
}
]

labels = {
Expand Down
38 changes: 38 additions & 0 deletions images/crossplane/tests/nopresource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: nop.crossplane.io/v1alpha1
kind: NopResource
metadata:
name: example
spec:
forProvider:
conditionAfter:
- conditionStatus: "True"
conditionType: Ready
time: 30s
- conditionStatus: "False"
conditionType: Ready
time: 60s
- conditionStatus: "True"
conditionType: Ready
time: 90s
- conditionStatus: "True"
conditionType: Green
time: 90s
connectionDetails:
- name: username
value: fakeuser
- name: password
value: verysecurepassword
- name: endpoint
value: 127.0.0.1
fields:
arrayField:
- stringField: cool
integerField: 42
objectField:
stringField: cool
stringField: cool
providerConfigRef:
name: default
writeConnectionSecretToRef:
name: nop-example-resource
namespace: crossplane-system
6 changes: 6 additions & 0 deletions images/crossplane/tests/provider-nop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-nop
spec:
package: xpkg.upbound.io/crossplane-contrib/provider-nop:v0.2.1
6 changes: 0 additions & 6 deletions tflib/versions/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ variable "package" {
description = "The name of the package to get version information for."
}

// Note: unused
variable "eol-grace-months" {
description = "Length of time to allow EOL versions to be included in versions output. Default set to 1 month."
default = 0
}

// Note: unused
variable "variant" {
default = ""
Expand Down

0 comments on commit 6ba34bb

Please sign in to comment.