func (pl *ProfileLoader) DeleteProfileMappings(profile *ProfileMetadata, container *ContainerMetadata) error {
	// 1) Fetch old binary_ids. Any binding between a process and those cookies will need to be deleted.
	oldBinaryIDs, _, err := pl.computeListOfBinaryIDs(container.Netns)
	if err != nil {
		return err
	}
	// 2) Delete netns and pidns mappings
	nsKeys, err := profile.Profile.Spec.GetProfileNSKeyValues(container.Netns, container.Pidns)
	if err != nil {
		return err
	}
	for _, kv := range nsKeys {
		if err := pl.DeleteKeyValue(kv); err != nil {
			return err
		}
	}
	// 3) Delete any entry in the pid <-> binary_id map that points to one of the cookies in oldBinaryIDs
	if len(oldBinaryIDs) > 0 {
		if err := pl.deletePidBinaryID(oldBinaryIDs, profile.Profile); err != nil {
			return err
		}
	}
	return nil
}
// DeleteProfileMappings - Removes the mappings between a profile and a container
Removes the mappings between a profile and a container
// DeleteProfileMappings - Removes the mappings between a profile and a container
func (pl *ProfileLoader) DeleteProfileMappings(profile *ProfileMetadata, container *ContainerMetadata) error {
	oldBinaryIDs, _, err := pl.computeListOfBinaryIDs(container.Netns)
	if err != nil {
		return err
	}
	nsKeys, err := profile.Profile.Spec.GetProfileNSKeyValues(container.Netns, container.Pidns)
	if err != nil {
		return err
	}
	for _, kv := range nsKeys {
		if err := pl.DeleteKeyValue(kv); err != nil {
			return err
		}
	}
	if len(oldBinaryIDs) > 0 {
		if err := pl.deletePidBinaryID(oldBinaryIDs, profile.Profile); err != nil {
			return err
		}
	}
	return nil
}
func ( pl * ProfileLoader ) DeleteProfileMappings ( profile * ProfileMetadata , container * ContainerMetadata ) error { oldBinaryIDs , _ , err := pl . computeListOfBinaryIDs ( container . Netns ) if err != nil { return err } nsKeys , err := profile . Profile . Spec . GetProfileNSKeyValues ( container . Netns , container . Pidns ) if err != nil { return err } for _ , kv := range nsKeys { if err := pl . DeleteKeyValue ( kv ) ; err != nil { return err } } if len ( oldBinaryIDs ) > 0 { if err := pl . deletePidBinaryID ( oldBinaryIDs , profile . Profile ) ; err != nil { return err } } return nil }
Removes the mappings between a profile and a container
Removes the mappings between a profile and a container
// 1) Fetch old binary_ids. Any binding between a process and those cookies will need to be deleted. // 2) Delete netns and pidns mappings // 3) Delete any entry in the pid <-> binary_id map that points to one of the cookies in oldBinaryIDs