func (pl *ProfileLoader) DeleteSecurityProfile(profile *v1.SecurityProfile) error {
	// Generate profile hashmap key-values
	keyValues, err := profile.Spec.GetProfileKeyValues()
	if err != nil {
		return errors.Wrap(err, "couldn't generate the profile key-values")
	}
	// Delete key values
	for _, kv := range keyValues {
		if err := pl.DeleteKeyValue(kv); err != nil {
			return err
		}
	}
	// Generate profile MapOfMaps key-values
	mmKeyValues, err := profile.Spec.GetProfileMapOfMapsKeyValue()
	if err != nil {
		return errors.Wrap(err, "couldn't generate the profile MapOfMaps key-values")
	}
	// Delete MapOfMaps key-values
	for _, kv := range mmKeyValues {
		if err := pl.DeleteMapOfMapsKeyValue(kv); err != nil {
			return err
		}
	}
	profileLoaderLogger.Debugf("Security profile %s (version %s) deleted", profile.UID, profile.ResourceVersion)
	return nil
}
// DeleteSecurityProfile - Deletes a security profile from the kernel.
Deletes a security profile from the kernel.
// DeleteSecurityProfile - Deletes a security profile from the kernel .
func (pl *ProfileLoader) DeleteSecurityProfile(profile *v1.SecurityProfile) error {
	keyValues, err := profile.Spec.GetProfileKeyValues()
	if err != nil {
		return errors.Wrap(err, "couldn't generate the profile key-values")
	}
	for _, kv := range keyValues {
		if err := pl.DeleteKeyValue(kv); err != nil {
			return err
		}
	}
	mmKeyValues, err := profile.Spec.GetProfileMapOfMapsKeyValue()
	if err != nil {
		return errors.Wrap(err, "couldn't generate the profile MapOfMaps key-values")
	}
	for _, kv := range mmKeyValues {
		if err := pl.DeleteMapOfMapsKeyValue(kv); err != nil {
			return err
		}
	}
	profileLoaderLogger.Debugf("Security profile %s (version %s) deleted", profile.UID, profile.ResourceVersion)
	return nil
}
func ( pl * ProfileLoader ) DeleteSecurityProfile ( profile * v1 . SecurityProfile ) error { keyValues , err := profile . Spec . GetProfileKeyValues ( ) if err != nil { return errors . Wrap ( err , " " ) } for _ , kv := range keyValues { if err := pl . DeleteKeyValue ( kv ) ; err != nil { return err } } mmKeyValues , err := profile . Spec . GetProfileMapOfMapsKeyValue ( ) if err != nil { return errors . Wrap ( err , " " ) } for _ , kv := range mmKeyValues { if err := pl . DeleteMapOfMapsKeyValue ( kv ) ; err != nil { return err } } profileLoaderLogger . Debugf ( " " , profile . UID , profile . ResourceVersion ) return nil }
Deletes a security profile from the kernel.
Deletes a security profile from the kernel .
// Generate profile hashmap key-values // Delete key values // Generate profile MapOfMaps key-values // Delete MapOfMaps key-values