apiVersion: v1
kind: Secret
metadata:
  name: <%= @name %>
  labels:
  <% @labels.each_pair do |k, v| %>
    <%= k %>: <%= v %>
  <%- end -%>
<% unless @annotations.empty? %>
  annotations:
<%- @annotations.each do |annotation| %>
    <%= annotation %>
<%- end -%>
<%- end -%>
data:
<% @data.each_pair do |k, v| %>
  <%= k %>: <%= v %>
<%- end -%>

apiVersion: v1
kind: Secret
metadata:
  name: <%= @name %>
  labels:
  <% @labels.each_pair do |k, v| %>
    <%= k %>: <%= v %>
  <%- end -%>
<% if defined?(@annotations) %>
  annotations:
<%- @annotations.each do |annotation| %>
    <%= annotation %>
<%- end -%>
<%- end -%>
data:
<% @data.each_pair do |k, v| %>
  <%= k %>: <%= v %>
<%- end -%>

Fix variable logic post 3.6
Fix variable logic post 3.6
