Skip to content

chore: sync dev-workspace-container-build CRB on every reconcile loop#2000

Merged
tolusha merged 1 commit intomainfrom
23400
May 30, 2025
Merged

chore: sync dev-workspace-container-build CRB on every reconcile loop#2000
tolusha merged 1 commit intomainfrom
23400

Conversation

@tolusha
Copy link
Contributor

@tolusha tolusha commented May 29, 2025

What does this PR do?

snc dev-workspace-container-build CRB on every reconcile loop

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

eclipse-che/che#23400

How to test this PR?

  1. Prepare a patch file if needed:
cat > /tmp/cr-patch.yaml <<EOF
apiVersion: org.eclipse.che/v2
kind: CheCluster
spec: {}
EOF
  1. Deploy the operator:

OpenShift

./build/scripts/olm/test-catalog-from-sources.sh --cr-patch-yaml /tmp/cr-patch.yaml

on Minikube

./build/scripts/minikube-tests/test-operator-from-sources.sh --cr-patch-yaml /tmp/cr-patch.yaml

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented May 29, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tolusha

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

@tolusha tolusha requested review from Copilot and removed request for SDawley, ibuziuk and mkuznyetsov May 30, 2025 07:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that the dev-workspace-container-build CRB is synced on every reconcile loop. Key changes include:

  • Replacing ServiceAccount objects with Pod objects in tests to simulate the devworkspace operator.
  • Updating logic in getDevWorkspaceServiceAccountNamespace to list pods by labels.
  • Adding new constants for controller and operator names.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/deploy/container-build/container_build_test.go Changed tests to use Pod instead of ServiceAccount with updated labels and spec.
pkg/deploy/container-build/container_build.go Updated getDevWorkspaceServiceAccountNamespace to select pods using labels.
pkg/common/constants/constants.go Added new constants for DevWorkspaceControllerName and DevWorkspaceOperatorName.

@@ -33,17 +33,24 @@ import (
)

func TestContainerBuildReconciler(t *testing.T) {
Copy link

Copilot AI May 30, 2025

Choose a reason for hiding this comment

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

Ensure that using a Pod to simulate the devworkspace operator in tests is intentional and documented, as this differs from the usual ServiceAccount object usage.

Suggested change
func TestContainerBuildReconciler(t *testing.T) {
func TestContainerBuildReconciler(t *testing.T) {
// The following Pod is used to simulate the devworkspace operator in this test.
// This approach is intentional to test specific behaviors related to Pod-based
// configurations. Normally, a ServiceAccount would be used in production scenarios.

Copilot uses AI. Check for mistakes.
}

for _, pod := range pods.Items {
if pod.Spec.ServiceAccountName == constants.DevWorkspaceServiceAccountName {
Copy link

Copilot AI May 30, 2025

Choose a reason for hiding this comment

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

Document that this function returns the namespace of the first matching pod, and consider whether multiple matches should be handled or clarified in the function's behavior.

Copilot uses AI. Check for mistakes.
@tolusha tolusha merged commit 8094056 into main May 30, 2025
23 of 24 checks passed
@tolusha tolusha deleted the 23400 branch May 30, 2025 09:02
@devspacesbuild
Copy link

Build 3.22 :: operator_3.x/462: Console, Changes, Git Data

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.22 :: operator_3.x/462: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/9345 triggered

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.22 :: sync-to-downstream_3.x/9346: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/9493 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devspacesbuild
Copy link

Build 3.22 :: operator-bundle_3.x/4917: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/9346 triggered

@devspacesbuild
Copy link

Build 3.22 :: copyIIBsToQuay/3005: Console, Changes, Git Data

@devspacesbuild
Copy link

Build 3.22 :: dsc_3.x/2063: Console, Changes, Git Data

@devspacesbuild
Copy link

Build 3.22 :: update-digests_3.x/9302: SUCCESS

Detected new images: rebuild operator-bundle
* devspaces-operator; /DS_CI/operator-bundle_3.x/4917 triggered

@devspacesbuild
Copy link

Build 3.22 :: dsc_3.x/2063: SUCCESS

3.22.0-CI

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.22 :: copyIIBsToQuay/3006: Console, Changes, Git Data

@devspacesbuild
Copy link

Build 3.22 :: sync-to-downstream_3.x/9349: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/9496 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devspacesbuild
Copy link

Build 3.22 :: operator-bundle_3.x/4918: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/9349 triggered

@devspacesbuild
Copy link

Build 3.22 :: dsc_3.x/2064: Console, Changes, Git Data

@devspacesbuild
Copy link

Build 3.22 :: dsc_3.x/2064: SUCCESS

3.22.0-CI

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.

3 participants