Skip to content

Conversation

@deads2k
Copy link
Collaborator

@deads2k deads2k commented Feb 2, 2026

This is ugly, but it appears accurate. It is using the kube deepcopy, but because we use azcorearm.ResourceID, we cannot create deepcopy functions on the type. Modification to deepcopy-gen is doable, but a long term effort.

@deads2k deads2k added the ai-assisted AI/LLM tool was used to help create this MR label Feb 2, 2026
@openshift-ci openshift-ci bot requested review from geoberle and mbarnes February 2, 2026 16:45
@openshift-ci openshift-ci bot added the approved label Feb 2, 2026
Comment on lines +58 to +87
# Fix internal Azure SDK import path and type references.
sed -i \
-e 's|resource "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"|azcorearm "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"|g' \
-e 's|resource\.ResourceID|azcorearm.ResourceID|g' \
"${f}"

# Fix pointer-type azcorearm.ResourceID fields: replace two-line
# *out = new(azcorearm.ResourceID)
# (*in).DeepCopyInto(*out)
# with single-line call to DeepCopyResourceID.
sed -i -E \
"/\*out = new\(azcorearm\.ResourceID\)/{N;s|\*out = new\(azcorearm\.ResourceID\)\n[[:space:]]*\(\*in\)\.DeepCopyInto\(\*out\)|*out = ${RESOURCEID_FUNC}(*in)|;}" \
"${f}"

# Fix value-type azcorearm.ResourceID field (e.g. ServiceProviderCluster.ResourceID).
sed -i \
"s/in\.ResourceID\.DeepCopyInto(&out\.ResourceID)/out.ResourceID = *${RESOURCEID_FUNC}(\&in.ResourceID)/g" \
"${f}"

# Fix pointer-type time.Time fields (time.Time has no DeepCopyInto).
sed -i \
'/\*out = new(time\.Time)/{n;s/(\*in)\.DeepCopyInto(\*out)/**out = **in/;}' \
"${f}"

# Fix value-type time.Time fields.
for field in LastTransitionTime StartTime ExpirationTimestamp EndOfLifeTimestamp; do
sed -i \
"s/in\.${field}\.DeepCopyInto(&out\.${field})/out.${field} = in.${field}/g" \
"${f}"
done
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

super ugly. probably still easier.

Comment on lines +27 to +32
if [[ ! -z "$(git status --short)" ]]; then
echo "deepcopy generated files are out of date, rerun 'make deepcopy' to update them and check the changes in"
git status
git diff
exit 1
fi
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also ugly (hate mutating the worktree), but in keeping with what we have.

@deads2k
Copy link
Collaborator Author

deads2k commented Feb 2, 2026

This looks good enough to me

/hold cancel

@stevekuznetsov
Copy link
Contributor

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Feb 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, stevekuznetsov

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:
  • OWNERS [deads2k,stevekuznetsov]

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

@deads2k
Copy link
Collaborator Author

deads2k commented Feb 2, 2026

/retest

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 748ec2b and 2 for PR HEAD 4a226a1 in total

@openshift-ci openshift-ci bot removed the lgtm label Feb 2, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 2, 2026

New changes are detected. LGTM label has been removed.

@deads2k deads2k added the lgtm label Feb 2, 2026
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 748ec2b and 2 for PR HEAD 234ea72 in total

@openshift-ci openshift-ci bot removed the lgtm label Feb 2, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 2, 2026

New changes are detected. LGTM label has been removed.

@deads2k deads2k added the lgtm label Feb 2, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 355b31b into main Feb 3, 2026
16 of 19 checks passed
@openshift-merge-bot openshift-merge-bot bot deleted the deepcopy-on-main branch February 3, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted AI/LLM tool was used to help create this MR approved lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants