mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-20 16:14:23 +00:00
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/open-cluster-management/work/pkg/version"
|
||||
)
|
||||
|
||||
// NewWorkloadAgent generatee a command to start workload agent
|
||||
// NewWorkloadAgent generates a command to start workload agent
|
||||
func NewWorkloadAgent() *cobra.Command {
|
||||
o := spoke.NewWorkloadAgentOptions()
|
||||
cmd := controllercmd.
|
||||
|
||||
@@ -5,7 +5,7 @@ const (
|
||||
// related appliedmanifestwork of a manifestwork are deleted before the manifestwork itself is deleted
|
||||
ManifestWorkFinalizer = "cluster.open-cluster-management.io/manifest-work-cleanup"
|
||||
// AppliedManifestWorkFinalizer is the name of the finalizer added to appliedmanifestwork. It is to
|
||||
// ensure all resource relateds to appliedmanifestwork is deleted before appliedmanifestwork itself
|
||||
// ensure all resource relates to appliedmanifestwork is deleted before appliedmanifestwork itself
|
||||
// is deleted.
|
||||
AppliedManifestWorkFinalizer = "cluster.open-cluster-management.io/applied-manifest-work-cleanup"
|
||||
)
|
||||
|
||||
@@ -295,7 +295,7 @@ func (m *ManifestWorkController) generateUpdateStatusFunc(newManifestConditions
|
||||
}
|
||||
}
|
||||
|
||||
// isDecodeError is to check if the error returned from resourceapply is due to that the object cannnot
|
||||
// isDecodeError is to check if the error returned from resourceapply is due to that the object cannot
|
||||
// be decoded or no typed client can handle the object.
|
||||
func isDecodeError(err error) bool {
|
||||
return err != nil && strings.HasPrefix(err.Error(), "cannot decode")
|
||||
@@ -308,12 +308,12 @@ func isUnhandledError(err error) bool {
|
||||
}
|
||||
|
||||
// isSameUnstructured compares the two unstructured object.
|
||||
// The comparison ignores the metadata and status field, and check if the two objects are sementically equal.
|
||||
// The comparison ignores the metadata and status field, and check if the two objects are semantically equal.
|
||||
func isSameUnstructured(obj1, obj2 *unstructured.Unstructured) bool {
|
||||
obj1Copy := obj1.DeepCopy()
|
||||
obj2Copy := obj2.DeepCopy()
|
||||
|
||||
// Comapre gvk, name, namespace at first
|
||||
// Compare gvk, name, namespace at first
|
||||
if obj1Copy.GroupVersionKind() != obj2Copy.GroupVersionKind() {
|
||||
return false
|
||||
}
|
||||
@@ -332,7 +332,7 @@ func isSameUnstructured(obj1, obj2 *unstructured.Unstructured) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Compare sementically after removing metadata and status field
|
||||
// Compare semantically after removing metadata and status field
|
||||
delete(obj1Copy.Object, "metadata")
|
||||
delete(obj2Copy.Object, "metadata")
|
||||
delete(obj1Copy.Object, "status")
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
// ControllerSyncInterval is exposed so that integration tests can crank up the constroller resync speed.
|
||||
// ControllerSyncInterval is exposed so that integration tests can crank up the controller resync speed.
|
||||
var ControllerReSyncInterval = 30 * time.Second
|
||||
|
||||
// AvailableStatusController is to update the available status conditions of both manifests and manifestworks.
|
||||
|
||||
Reference in New Issue
Block a user