You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gregory Nickonov edited this page Mar 1, 2019
·
1 revision
Resource initializers are applied to the newly created resource before it is accessible in the components file.
The order of initializers application is not determined, so each individual initializer should not rely on other initializers. To define initializer setup_resource method is called on R in the form R.setup_resource [resource(s)] do |r| ... end. resource(s) is the list of resource kinds to initialize specified by Strings or Symbols, for example, to add label application with the value hello to all ConfigMaps and Secrets you can declare the following initializer in Helpers file:
Now, all the resources created by R.config_map or R.secret factories will have the label application automatically assigned.
If the list of resources is not specified, then initializer will be called for any kind of resources. So, the following declaration will add application label to all resources, no matter what kind they are: