Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds code commentary and improves a log message #52

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mhrivnak
Copy link

No description provided.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 22, 2024
Copy link

openshift-ci bot commented Jul 22, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

Copy link

openshift-ci bot commented Jul 22, 2024

Welcome @mhrivnak! It looks like this is your first PR to openshift-assisted/cluster-api-agent 🎉

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 22, 2024
Copy link

openshift-ci bot commented Jul 22, 2024

Hi @mhrivnak. Thanks for your PR.

I'm waiting for a openshift-assisted member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 22, 2024
@@ -87,6 +87,7 @@ type AgentBootstrapConfigStatus struct {
// AgentRef references the agent this agent bootstrap config has booted
AgentRef *corev1.LocalObjectReference `json:"agentRef,omitempty"`

// TODO: should this be on the spec?
Copy link
Collaborator

@CrystalChun CrystalChun Jul 22, 2024

Choose a reason for hiding this comment

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

I believe we initially moved it here to prevent the user from setting this field.
What are the reasons to move it to spec?
EDIT: Nvm, I see your comment below about it being unconventional to set status on a resource it doesn't own

Copy link
Author

Choose a reason for hiding this comment

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

It's desired state. We want the URL to be used in the bootstrap process. And of course in a declarative API, we "spec"ify our desired state in the spec. :)

The status should be reserved for observations about the world that were taken the last time the owning controller reconciled this resource.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah I see! That makes sense, thank you for the explanation! CC @rccrdpccl

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, however I was thinking that might be a better idea to remove the InfraEnv controller altogether and just watch InfraEnv from the ABC controller, so we might remove the field altogether.
I also think we should probably apply the same concept to other controller we have for assisted's resources. WDYT?

Comment on lines +152 to +155
// TODO maybe we can find a better way than listing and scanning every BMH
// that exists, such as explicitly watching BMHs and setting up a
// FieldIndexer.
// Example: https://github.com/kubernetes-sigs/kubebuilder/blob/master/docs/book/src/reference/watching-resources/testdata/external-indexed-field/controller.go
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea! Will look into this, thank you!!

@@ -432,12 +434,14 @@ func (r *AgentBootstrapConfigReconciler) setMetal3MachineImage(
return err
}
log.V(logutil.TraceLevel).
Info("Added ISO URLs to metal3 machines", "machine", metal3Machine.Name, "namespace", metal3Machine.Namespace)
Info("Added ISO URL to metal3 machine", "machine", metal3Machine.Name, "namespace", metal3Machine.Namespace)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch, thank you!!

@@ -553,6 +559,11 @@ func (r *AgentBootstrapConfigReconciler) SetupWithManager(mgr ctrl.Manager) erro
).
Watches(
&hivev1.ClusterDeployment{},
// TODO does this depend on the name and namespace for the
// ClusterDeployment being the same as the name and namespace of the
// ABC? Could we put an owner reference on the CD instead and use
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we definitely need to change a few naming convenction, ClusterImageSet is another example.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2024
@openshift-merge-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants