Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

bump toolchain-api, minor fixes#234

Merged
openshift-merge-bot[bot] merged 5 commits intokonflux-workspaces:mainfrom
filariow:minor-fixes
Jul 16, 2024
Merged

bump toolchain-api, minor fixes#234
openshift-merge-bot[bot] merged 5 commits intokonflux-workspaces:mainfrom
filariow:minor-fixes

Conversation

@filariow
Copy link
Member

No description provided.

Signed-off-by: Francesco Ilario <filario@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Jul 10, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@filariow filariow marked this pull request as ready for review July 12, 2024 10:35
@openshift-ci openshift-ci bot requested a review from sadlerap July 12, 2024 10:35
Signed-off-by: Francesco Ilario <filario@redhat.com>
Signed-off-by: Francesco Ilario <filario@redhat.com>
Copy link
Contributor

@dperaza4dustbit dperaza4dustbit left a comment

Choose a reason for hiding this comment

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

Looks good one question though

_, err := controllerutil.CreateOrUpdate(ctx, r.Client, w, func() error {
w.Spec.DisplayName = "default"
w.Spec.Visibility = workspacesv1alpha1.InternalWorkspaceVisibilityPrivate
if w.ObjectMeta.CreationTimestamp.IsZero() {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this check doing, making sure this is not an update event?

Copy link
Member Author

Choose a reason for hiding this comment

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

exactly, this way we set this fields only when creating the resource. Otherwise we will reset visibility and display name of the workspace every time an UserSignup is updated/reconciled

Copy link
Member

Choose a reason for hiding this comment

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

We could hoist these assignments out of this closure. They'll be overwritten if the resource exists and has those fields set.

Copy link
Member Author

Choose a reason for hiding this comment

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

that may work, I got inspired from the controller-runtime example: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil#CreateOrUpdate. Not a strong preference, but I'd prefer the one used in doc.

Copy link
Member

Choose a reason for hiding this comment

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

ack, then this is fine by me.

Copy link
Member

@sadlerap sadlerap left a comment

Choose a reason for hiding this comment

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

mostly lgtm, though see the comment here

@openshift-ci
Copy link

openshift-ci bot commented Jul 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: filariow, sadlerap

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

The pull request process is described 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

@openshift-merge-bot openshift-merge-bot bot merged commit 9bf476f into konflux-workspaces:main Jul 16, 2024
@sadlerap sadlerap deleted the minor-fixes branch July 16, 2024 17:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants