Skip to content

Commit

Permalink
fix: yurt-iot-dock cannot be dynamically deployed in platformadmin
Browse files Browse the repository at this point in the history
Signed-off-by: LavenderQAQ <lavenderqaq.cs@gmail.com>
  • Loading branch information
LavenderQAQ committed Aug 27, 2023
1 parent 68d4079 commit 0ec4131
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -777,12 +777,6 @@ func (r *ReconcilePlatformAdmin) initFramework(ctx context.Context, platformAdmi
r.calculateDesiredComponents(platformAdmin, platformAdminFramework, nil)
}

yurtIotDock, err := newYurtIoTDockComponent(platformAdmin, platformAdminFramework)
if err != nil {
return err
}
platformAdminFramework.Components = append(platformAdminFramework.Components, yurtIotDock)

// For better serialization, the serialization method of the Kubernetes runtime library is used
data, err := runtime.Encode(r.yamlSerializer, platformAdminFramework)
if err != nil {
Expand Down Expand Up @@ -862,6 +856,16 @@ func (r *ReconcilePlatformAdmin) calculateDesiredComponents(platformAdmin *iotv1
}
}

// The yurt-iot-dock is maintained by openyurt and is not obtained through an auto-collector.
// Therefore, it needs to be handled separately
if addedComponentSet.Has(util.IotDockName) {
yurtIotDock, err := newYurtIoTDockComponent(platformAdmin, platformAdminFramework)
if err != nil {
klog.Errorf(Format("newYurtIoTDockComponent error %v", err))
}
desiredComponents = append(desiredComponents, yurtIotDock)
}

// TODO: In order to be compatible with v1alpha1, we need to add the component from annotation translation here
if additionalComponents != nil {
desiredComponents = append(desiredComponents, additionalComponents...)
Expand Down

0 comments on commit 0ec4131

Please sign in to comment.