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 helpers are methods that can be defined for the specific resource kinds to extend the functionality of those kinds. The syntax is R.define_helper NAME [, RESOURCE, RESOURCE, ...] do |r| ... end, where NAME is the name of the helper and RESOURCE is the resource kind that will receive the helper.
Let's imagine that we would like to label some of the ConfigMaps or Secrets with the application label. We know that not all of the ConfigMaps or Secrets should be marked, so we can not use Resource initializer, but we don't want to repeat the same code either, so we define a helper: