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
def discover_resources
logger.info("Discovering resources:")
resources = []
crds_by_kind = cluster_resource_discoverer.crds.map { |crd| [crd.name, crd] }.to_h
@template_sets.with_resource_definitions do |r_def|
crd = crds_by_kind[r_def["kind"]]&.first
r = KubernetesResource.build(context: context, logger: logger, definition: r_def,
crd: crd, global_names: global_kinds, statsd_tags: statsd_tags)
resources << r
logger.info(" - #{r.id}")
end
StatsD.client.gauge('discover_resources.count', resources.size, tags: statsd_tags)
resources.sort
rescue InvalidTemplateError => e
record_invalid_template(logger: logger, err: e.message, filename: e.filename, content: e.content)
raise FatalDeploymentError, "Failed to parse template"
end
we are grouping crds by name but trying to extract using kind from r_def. There are no tests that currently catch this.
Proposal:
We should use a uniform approach to pick crds, either kind or name. It would be beneficial to use name since name is always unique. Following the changes made to fix this bug, we can also update deploy_task.rb to follow the same approach.
The text was updated successfully, but these errors were encountered:
Bug report
In global_deploy_task.rb, in
we are grouping crds by name but trying to extract using
kind
fromr_def
. There are no tests that currently catch this.Proposal:
We should use a uniform approach to pick crds, either
kind
orname
. It would be beneficial to usename
sincename
is always unique. Following the changes made to fix this bug, we can also update deploy_task.rb to follow the same approach.The text was updated successfully, but these errors were encountered: