Skip to content

tests: add smoketest using kind#4506

Open
justinsb wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
justinsb:smoketest
Open

tests: add smoketest using kind#4506
justinsb wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
justinsb:smoketest

Conversation

@justinsb
Copy link
Collaborator

@justinsb justinsb commented May 8, 2025

The start of an e2e smoketest that deploys into a cluster with the operator.

A few (bigger) todos:

  • We should figure out how to capture the GCP traffic
  • We should ensure that we are running the images we actually push

@justinsb justinsb force-pushed the smoketest branch 9 times, most recently from c27223e to 9651ce8 Compare May 13, 2025 12:32
@justinsb
Copy link
Collaborator Author

This is obviously only a first step, but the reconciler did run:

  Warning  UpdateFailed  1s    storagebucket-controller  Update call failed: error fetching live state: error reading underlying resource: summary: Error when reading or editing Storage Bucket "kcc-test-config-control": Get "https://storage.googleapis.com/storage/v1/b/kcc-test-config-control?alt=json&prettyPrint=false": oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Invalid grant: account not found"}

@jingyih
Copy link
Collaborator

jingyih commented May 15, 2025

/assign @xiaoweim

@justinsb justinsb force-pushed the smoketest branch 3 times, most recently from 6136aa1 to 6f52a6b Compare May 16, 2025 21:24
@justinsb justinsb force-pushed the smoketest branch 2 times, most recently from cb795f6 to 488358e Compare May 29, 2025 07:34
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: "Run scripts/github-actions/tests-scenarios-acquisition"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, are we replacing the tests-scenarios-acquisition with the smoke test completely? The smoke test looks.

Copy link
Collaborator Author

@justinsb justinsb Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point, I forgot about that problem.

So .github/workflows/ci-presubmit.yaml is # Generated by dev/tasks/generate-github-actions (line 15)

I think it was manually edited to add the additional tasks, and we do need to fix that. Two ways I can think of:

  1. Move the manual edits to a manually maintained yaml file (so they won't get deleted when we regenerate)
  2. Ensure that the automatic generation recreates these tasks by adding them to the locations that dev/tasks/generate-github-actions looks at

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good (and I like the second option for the script take care of the tasks) :)

@xiaoweim
Copy link
Collaborator

xiaoweim commented Jul 8, 2025

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Jul 8, 2025
@xiaoweim
Copy link
Collaborator

xiaoweim commented Jul 8, 2025

/assign @cheftako

@justinsb
Copy link
Collaborator Author

ping @cheftako

@google-oss-prow google-oss-prow bot removed the lgtm label Jul 29, 2025
@justinsb justinsb force-pushed the smoketest branch 3 times, most recently from 3c0ef99 to 29d3890 Compare July 31, 2025 18:54
@justinsb
Copy link
Collaborator Author

/assign @xiaoweim

@justinsb
Copy link
Collaborator Author

Issue #5224

@justinsb
Copy link
Collaborator Author

Can we get this PR in cc @xiaoweim @cheftako

@xiaoweim
Copy link
Collaborator

xiaoweim commented Sep 30, 2025

/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Sep 30, 2025
The start of an e2e smoketest that deploys into a cluster with the operator.

A few (bigger) todos:

* We should figure out how to capture the GCP traffic
* We should ensure that we are running the images we actually push
@google-oss-prow
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot removed the lgtm label Jan 21, 2026
@google-oss-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xiaoweim
Once this PR has been reviewed and has the lgtm label, please ask for approval from cheftako. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yuck. V6.2.0 is out. Could we use either the actual v6.1.0 or v6.2.0?

@@ -0,0 +1,87 @@
#!/usr/bin/env bash
# Copyright 2024 Google LLC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

echo "Creating namespace ${NS}"
kubectl create ns ${NS} --dry-run=client -oyaml | kubectl apply --server-side -f -

# echo "Creating ConfigConnectorContext in namespace ${NS} (with fake google service account)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want these large commented out blocks? I would also suggest it is probably clearer to create a CCC function, a StorageBucket function and then have the main code path call (or not) those functions.


if [[ -z "${VERSION:-}" ]]; then
echo "VERSION must be set"
if [[ -z "${IMAGE_TAG:-}" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AGENT: Renaming VERSION to IMAGE_TAG is a breaking change for any existing callers of this script. Please check if this script is used elsewhere (e.g., local development workflows) or support both variables.


kustomize build operator/config/default | \
sed -e "s@image: operator:.*@image: gcr.io/gke-release/cnrm/operator:${VERSION}@g" | \
sed -e "s@image: operator:.*@image: gcr.io/gke-release/cnrm/operator:${IMAGE_TAG}@g" | \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TAKO: At some future point I think we should start plumbing in the registry root. ('gcr.io/gke-release'). Once that is done it becomes a lot easier to generate dev builds and run them.

echo "Configuring namespace mode"
# # Configure in namespace mode, per instructions at https://cloud.google.com/config-connector/docs/how-to/install-namespaced
# echo "Configuring namespace mode"
# cat <<EOF | kubectl apply --server-side -f -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still thinking making functions out of these and then have the mainline more like:
Setup-namespace-mode()
Setup_CC()

# EOF

# Configure in cluster mode so we can use a (fake) google service account
echo "Creating namespace cnrm-system"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we recommend namespace mode, then shouldn't out smoketest be to have namespace mode be the default test?

@justinsb justinsb mentioned this pull request Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants