func (pl *ProfileLoader) InsertSecurityProfile(profile *v1.SecurityProfile) error {
	// Generate new random ids for the profile
	profile.GenerateRandomIDs()
	// Generate profile hashmap key-values
	keyValues, err := profile.Spec.GetProfileKeyValues()
	if err != nil {
		return errors.Wrap(err, "couldn't generate the profile key-values")
	}
	// Insert key values
	for _, kv := range keyValues {
		if err := pl.PutKeyValue(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")
	}
	// Insert MapOfMaps key-values
	for _, kv := range mmKeyValues {
		if err := pl.InsertMapOfMapsKeyValue(kv); err != nil {
			return err
		}
	}
	profileLoaderLogger.Debugf("Security profile %s (version %s) inserted", profile.UID, profile.ResourceVersion)
	return nil
}
// InsertSecurityProfile - Inserts a security profile in the kernel.
Inserts a security profile in the kernel.
// InsertSecurityProfile - Inserts a security profile in the kernel .
func (pl *ProfileLoader) InsertSecurityProfile(profile *v1.SecurityProfile) error {
	profile.GenerateRandomIDs()
	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.PutKeyValue(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.InsertMapOfMapsKeyValue(kv); err != nil {
			return err
		}
	}
	profileLoaderLogger.Debugf("Security profile %s (version %s) inserted", profile.UID, profile.ResourceVersion)
	return nil
}
func ( pl * ProfileLoader ) InsertSecurityProfile ( profile * v1 . SecurityProfile ) error { profile . GenerateRandomIDs ( ) keyValues , err := profile . Spec . GetProfileKeyValues ( ) if err != nil { return errors . Wrap ( err , " " ) } for _ , kv := range keyValues { if err := pl . PutKeyValue ( kv ) ; err != nil { return err } } mmKeyValues , err := profile . Spec . GetProfileMapOfMapsKeyValue ( ) if err != nil { return errors . Wrap ( err , " " ) } for _ , kv := range mmKeyValues { if err := pl . InsertMapOfMapsKeyValue ( kv ) ; err != nil { return err } } profileLoaderLogger . Debugf ( " " , profile . UID , profile . ResourceVersion ) return nil }
Inserts a security profile in the kernel.
Inserts a security profile in the kernel .
// Generate new random ids for the profile // Generate profile hashmap key-values // Insert key values // Generate profile MapOfMaps key-values // Insert MapOfMaps key-values