Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Update deviceController to reconcile the device between the openyurt and edge #2

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

qclc
Copy link
Member

@qclc qclc commented Sep 7, 2021

  1. Update deviceController to reconcile the device between the OpenYurt and EdgeX Fountry, including:
    • Synchronize device objects on edge platform to the OpenYurt cluster
    • Openyurt creates and deletes device objects that can be synchronized to the edge platform
    • To support declarative device state modification, i.e., modifying the device's properties by changing fields of the device CRs
      (Note: only support the DeviceProperties, AdminState and OperatingState fields of device)
  2. Change the reference repository from charleszheng44 to openyurtio

@@ -0,0 +1,315 @@
package edgex_foudry
Copy link
Member

Choose a reason for hiding this comment

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

please add license header

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for reminding, the license header is added.

logr.Logger
}

func NewEdgexDeviceClient(coreMetaClient, coreCommandClient ClientURL, log logr.Logger) *EdgexDeviceClient {
Copy link
Member

Choose a reason for hiding this comment

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

why use logr.Logger instead of k8s.io/klog?

Copy link
Member Author

@qclc qclc Sep 18, 2021

Choose a reason for hiding this comment

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

Thanks for your suggestion, and I will submit a PR to replace all logr.Logger with k8s.io/klog

@@ -0,0 +1,295 @@
package edgex_foudry
Copy link
Member

Choose a reason for hiding this comment

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

please add license header

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for reminding, the license header is added.

@@ -8,6 +8,8 @@ type NotFoundError struct{}
func (e *NotFoundError) Error() string { return "Item not found" }

func IsNotFoundErr(err error) bool {
return err.Error() == "Item not found" || strings.HasPrefix(err.Error(), "no item found")
// return errors.Is(err, &NotFoundError{})
if err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

please add license header

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for reminding, the license header is added.

@@ -0,0 +1,104 @@
/*
Copyright 2021 The Kubernetes authors.
Copy link
Member

Choose a reason for hiding this comment

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

Kubernetes author --> OpenYurt author?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for reminding, the license header is changed.

@qclc qclc force-pushed the device branch 2 times, most recently from a039956 to 7d47bfa Compare September 18, 2021 11:12
@rambohe-ch
Copy link
Member

@qclc please fix the conflicting files.

Copy link
Member

@rambohe-ch rambohe-ch left a comment

Choose a reason for hiding this comment

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

LGTM

@rambohe-ch rambohe-ch merged commit 5b9f1d9 into openyurtio:main Sep 22, 2021
@openyurt-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: qclc, rambohe-ch
To complete the pull request process, please assign
You can assign the PR to them by writing /assign in a comment when ready.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants