You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: installer.go
    path of file: ./repos/sealer/pkg/registry
    
    the code of the file until where you have to start completion: // Copyright Â© 2022 Alibaba Group Holding Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     htt
    
func (l *localInstaller) Reconcile(desiredHosts []net.IP) ([]net.IP, error) {
	// if deployHosts is null,means first time installation
	if len(l.currentDeployHosts) == 0 {
		err := l.install(desiredHosts)
		if err != nil {
			return nil, err
		}
		return desiredHosts, nil
	}

	joinedHosts, deletedHosts := strutils.Diff(l.currentDeployHosts, desiredHosts)
	// if targetHosts is equal deployHosts, just return.
	if len(joinedHosts) == 0 && len(deletedHosts) == 0 {
		return l.currentDeployHosts, nil
	}

	// join new hosts
	if len(joinedHosts) != 0 {
		err := l.install(joinedHosts)
		if err != nil {
			return nil, err
		}
		return append(l.currentDeployHosts, joinedHosts...), nil
	}

	// delete hosts
	if len(deletedHosts) != 0 {
		err := l.clean(deletedHosts)
		if err != nil {
			return nil, err
		}
		return netutils.RemoveIPs(l.currentDeployHosts, deletedHosts), nil
	}

	return nil, nil
}