Netflix / asgard

[Asgard is deprecated at Netflix. We use Spinnaker ( www.spinnaker.io ).] Web interface for application deployments and cloud management in Amazon Web Services (AWS). Binary download: http://github.com/Netflix/asgard/releases
http://netflix.github.com/asgard
Apache License 2.0
2.24k stars 403 forks source link

Wiki documentation for user data customization incorrect #668

Open mathianasjs opened 9 years ago

mathianasjs commented 9 years ago

The wiki at https://github.com/Netflix/asgard/wiki/Customizing-User-Data

contains a non working example on how to extend the user data to provide custom environment variables.

This line creates a new instance of DefaultUserDataProvider which is outside the scope of Spring autowire control, so when the defaultProvider.buildUserDataForVariables method is invoked it causes a method inside with an autowired object method to be called result in a null pointer exception. DefaultUserDataProvider defaultProvider = new DefaultUserDataProvider()

The proposed change to the example would be, this would then provide access to the defaultProvider with all autowired dependencies calls made inside the provider.

import com.netflix.asgard.userdata.DefaultUserDataProvider import com.netflix.asgard.UserContext import com.netflix.asgard.plugin.AdvancedUserDataProvider import com.netflix.asgard.model.LaunchContext import javax.xml.bind.DatatypeConverter import com.amazonaws.services.ec2.model.Image import org.springframework.beans.factory.annotation.Autowired

/**

mathianasjs commented 9 years ago

Does anyone have input on how the wiki documentation can be updated to address this issue?

jvasallo commented 8 years ago

+1 Please...spent a good 2 hours trying to implement this until I found this.

Jared-Prime commented 8 years ago

+1 the wiki is still incorrect