// Belongs returns true if the given node belongs to the NodeGroup.
Belongs returns true if the given node belongs to the NodeGroup.
// Belongs returns true if the given node belongs to the NodeGroup .
func (mig *GkeMig) Belongs(node *apiv1.Node) (bool, error) {
	ref, err := gce.GceRefFromProviderId(node.Spec.ProviderID)
	if err != nil {
		return false, err
	}
	targetMig, err := mig.gkeManager.GetMigForInstance(ref)
	if err != nil {
		return false, err
	}
	if targetMig == nil {
		return false, fmt.Errorf("%s doesn't belong to a known mig", node.Name)
	}
	if targetMig.Id() != mig.Id() {
		return false, nil
	}
	return true, nil
}
func ( mig * GkeMig ) Belongs ( node * apiv1 . Node ) ( bool , error ) { ref , err := gce . GceRefFromProviderId ( node . Spec . ProviderID ) if err != nil { return false , err } targetMig , err := mig . gkeManager . GetMigForInstance ( ref ) if err != nil { return false , err } if targetMig == nil { return false , fmt . Errorf ( " " , node . Name ) } if targetMig . Id ( ) != mig . Id ( ) { return false , nil } return true , nil }
Belongs returns true if the given node belongs to the NodeGroup.
Belongs returns true if the given node belongs to the NodeGroup .