mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-23 22:26:49 +00:00
Bump addon framework to the latest version (#339)
Signed-off-by: zhujian <jiazhu@redhat.com>
This commit is contained in:
@@ -33,7 +33,7 @@ require (
|
||||
k8s.io/klog/v2 v2.100.1
|
||||
k8s.io/kube-aggregator v0.28.1
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
|
||||
open-cluster-management.io/addon-framework v0.8.1-0.20231102082339-51742bc299f2
|
||||
open-cluster-management.io/addon-framework v0.8.1-0.20240102072130-44852ea0722f
|
||||
open-cluster-management.io/api v0.12.1-0.20231219024415-a2f58d68f4a9
|
||||
sigs.k8s.io/controller-runtime v0.16.2
|
||||
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96
|
||||
|
||||
@@ -761,8 +761,8 @@ k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5Ohx
|
||||
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
open-cluster-management.io/addon-framework v0.8.1-0.20231102082339-51742bc299f2 h1:38vY9paEGugvXfYGJ0oFabL4/8Jxrg+GnxxjUO2DMio=
|
||||
open-cluster-management.io/addon-framework v0.8.1-0.20231102082339-51742bc299f2/go.mod h1:aj97pgpGJ0/LpQzBVtU2oDFqqIiZLOPnsjLKG/sVkFw=
|
||||
open-cluster-management.io/addon-framework v0.8.1-0.20240102072130-44852ea0722f h1:R5IbFdM4g+kDyONZ1/q67/czRwgDkq9Q7ETZ3RhGaAg=
|
||||
open-cluster-management.io/addon-framework v0.8.1-0.20240102072130-44852ea0722f/go.mod h1:aj97pgpGJ0/LpQzBVtU2oDFqqIiZLOPnsjLKG/sVkFw=
|
||||
open-cluster-management.io/api v0.12.1-0.20231219024415-a2f58d68f4a9 h1:72JSxfhLN2qgRO0olbwd44q9KeFNhUyOJhIIa7FNFnA=
|
||||
open-cluster-management.io/api v0.12.1-0.20231219024415-a2f58d68f4a9/go.mod h1:fsBC/oA50/ZqmirAP1SgdELUxd4fTJ8Dmzbr9LbOKgA=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
|
||||
Vendored
+1
-1
@@ -1473,7 +1473,7 @@ k8s.io/utils/pointer
|
||||
k8s.io/utils/ptr
|
||||
k8s.io/utils/strings/slices
|
||||
k8s.io/utils/trace
|
||||
# open-cluster-management.io/addon-framework v0.8.1-0.20231102082339-51742bc299f2
|
||||
# open-cluster-management.io/addon-framework v0.8.1-0.20240102072130-44852ea0722f
|
||||
## explicit; go 1.20
|
||||
open-cluster-management.io/addon-framework/pkg/addonfactory
|
||||
open-cluster-management.io/addon-framework/pkg/addonmanager
|
||||
|
||||
Generated
Vendored
+11
-7
@@ -35,14 +35,18 @@ func (s *defaultSyncer) sync(ctx context.Context,
|
||||
|
||||
var errs []error
|
||||
|
||||
if !addon.DeletionTimestamp.IsZero() {
|
||||
return addon, nil
|
||||
}
|
||||
// Don't skip syncing if the addon is deleting and there is a predelete hook, since the deployment manifests may
|
||||
// need to be updated during the uninstall.
|
||||
if !addonHasFinalizer(addon, addonapiv1alpha1.AddonPreDeleteHookFinalizer) {
|
||||
if !addon.DeletionTimestamp.IsZero() {
|
||||
return addon, nil
|
||||
}
|
||||
|
||||
// waiting for the addon to be deleted when cluster is deleting.
|
||||
// TODO: consider to delete addon in this scenario.
|
||||
if !cluster.DeletionTimestamp.IsZero() {
|
||||
return addon, nil
|
||||
// waiting for the addon to be deleted when cluster is deleting.
|
||||
// TODO: consider to delete addon in this scenario.
|
||||
if !cluster.DeletionTimestamp.IsZero() {
|
||||
return addon, nil
|
||||
}
|
||||
}
|
||||
|
||||
currentWorks, err := s.getWorkByAddon(addon.Name, addon.Namespace)
|
||||
|
||||
Generated
Vendored
+11
@@ -105,6 +105,17 @@ func (s *healthCheckSyncer) probeDeploymentAvailabilityAddonStatus(
|
||||
func (s *healthCheckSyncer) probeAddonStatusByWorks(
|
||||
cluster *clusterv1.ManagedCluster, addon *addonapiv1alpha1.ManagedClusterAddOn) error {
|
||||
|
||||
if cluster != nil {
|
||||
clusterAvailableCondition := meta.FindStatusCondition(cluster.Status.Conditions,
|
||||
clusterv1.ManagedClusterConditionAvailable)
|
||||
if clusterAvailableCondition != nil && clusterAvailableCondition.Status == metav1.ConditionUnknown {
|
||||
// if the managed cluster availability is unknown, skip the health check
|
||||
// and the registration agent will set all addon status to unknown
|
||||
// nolint see: https://github.com/open-cluster-management-io/ocm/blob/9dc8f104cf51439b6bb1f738894e75aabdf5f8dc/pkg/registration/hub/addon/healthcheck_controller.go#L68-L78
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
addonWorks, err := s.getWorkByAddon(addon.Name, addon.Namespace)
|
||||
if err != nil || len(addonWorks) == 0 {
|
||||
meta.SetStatusCondition(&addon.Status.Conditions, metav1.Condition{
|
||||
|
||||
Generated
Vendored
+20
-21
@@ -80,37 +80,36 @@ func (s *hostedSyncer) sync(ctx context.Context,
|
||||
Message: fmt.Sprintf("hosting cluster %s is a managed cluster of the hub", hostingClusterName),
|
||||
})
|
||||
|
||||
if !hostingCluster.DeletionTimestamp.IsZero() {
|
||||
if err = s.cleanupDeployWork(ctx, addon); err != nil {
|
||||
return addon, err
|
||||
}
|
||||
addonRemoveFinalizer(addon, addonapiv1alpha1.AddonHostingManifestFinalizer)
|
||||
return addon, nil
|
||||
}
|
||||
|
||||
if !addon.DeletionTimestamp.IsZero() {
|
||||
// clean up the deploy work until the hook work is completed
|
||||
if addonHasFinalizer(addon, addonapiv1alpha1.AddonHostingPreDeleteHookFinalizer) {
|
||||
// Don't skip syncing if the addon is deleting and there is a predelete hook, since the deployment manifests may
|
||||
// need to be updated during the uninstall.
|
||||
if !addonHasFinalizer(addon, addonapiv1alpha1.AddonHostingPreDeleteHookFinalizer) {
|
||||
if !hostingCluster.DeletionTimestamp.IsZero() {
|
||||
if err = s.cleanupDeployWork(ctx, addon); err != nil {
|
||||
return addon, err
|
||||
}
|
||||
addonRemoveFinalizer(addon, addonapiv1alpha1.AddonHostingManifestFinalizer)
|
||||
return addon, nil
|
||||
}
|
||||
|
||||
if err = s.cleanupDeployWork(ctx, addon); err != nil {
|
||||
return addon, err
|
||||
if !addon.DeletionTimestamp.IsZero() {
|
||||
if err = s.cleanupDeployWork(ctx, addon); err != nil {
|
||||
return addon, err
|
||||
}
|
||||
addonRemoveFinalizer(addon, addonapiv1alpha1.AddonHostingManifestFinalizer)
|
||||
return addon, nil
|
||||
}
|
||||
|
||||
// waiting for the addon to be deleted when cluster is deleting.
|
||||
// TODO: consider to delete addon in this scenario.
|
||||
if !cluster.DeletionTimestamp.IsZero() {
|
||||
return addon, nil
|
||||
}
|
||||
addonRemoveFinalizer(addon, addonapiv1alpha1.AddonHostingManifestFinalizer)
|
||||
return addon, nil
|
||||
}
|
||||
|
||||
if addonAddFinalizer(addon, addonapiv1alpha1.AddonHostingManifestFinalizer) {
|
||||
return addon, nil
|
||||
}
|
||||
|
||||
// waiting for the addon to be deleted when cluster is deleting.
|
||||
// TODO: consider to delete addon in this scenario.
|
||||
if !cluster.DeletionTimestamp.IsZero() {
|
||||
return addon, nil
|
||||
}
|
||||
|
||||
currentWorks, err := s.getWorkByAddon(addon.Name, addon.Namespace)
|
||||
if err != nil {
|
||||
return addon, err
|
||||
|
||||
Reference in New Issue
Block a user