Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highlight sidecars with matching host environment #1483

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions deploy-board/deploy_board/templates/hosts/host_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@

{% if agent_wrappers %}
<div class="panel panel-default">
{% if has_host_env_sidecar_agents %}
{% include "panel_heading.tmpl" with panel_title="Sidecar Agent Details" panel_body_id="sidecarAgentDetailsId" direction="down" copy_host_name_button=True %}
<div id="sidecarAgentDetailsId" class="collapse in panel-body">
<span>This host has relevant sidecars in it's environment. These have been marked with <span class="bg-success">green backgrounds</span> for visibility.</span>
rwxzhu marked this conversation as resolved.
Show resolved Hide resolved
{% else %}
{% include "panel_heading.tmpl" with panel_title="Sidecar Agent Details" panel_body_id="sidecarAgentDetailsId" direction="right" copy_host_name_button=True %}
<div id="sidecarAgentDetailsId" class="collapse panel-body">
{% endif %}
{% for agent_wrapper in agent_wrappers.sidecars %}
{% with env=agent_wrapper.env agent=agent_wrapper.agent hostdetailsvalue=host_details|getValue:"Phobos Link" %}
{% if env and env_name == env.envName and stage_name == env.stageName %}
{% include "hosts/host_details.tmpl" with agent=agent env=env hostdetailsvalue=hostdetailsvalue host_related_sidecar=1%}
{% else %}
{% include "hosts/host_details.tmpl" with agent=agent env=env hostdetailsvalue=hostdetailsvalue%}
{% endif %}
{% endwith %}
{% endfor %}
</div>
Expand Down
10 changes: 10 additions & 0 deletions deploy-board/deploy_board/templates/hosts/host_details.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{% load utils %}
<div id="hostInfo" class="panel panel-default">
{% if host_related_sidecar %}
<div class="panel-heading host-related-sidecar">
{% else %}
<div class="panel-heading">
{% endif %}
<strong>Environment:</strong><a href="/env/{{ env.envName }}/{{ env.stageName }}"> {{ env.envName }}/{{ env.stageName }}</a>
<strong>Deploy:</strong><a href="/deploy/{{ agent.deployId }}"> {{ agent.deployId }}</a>
</div>
Expand Down Expand Up @@ -83,6 +87,12 @@
</div>
</div>
</div>
<style>
#hostInfo>.panel-heading.host-related-sidecar {
background-image: none;
background-color: #dff0d8;
}
</style>
<script>
$(function () {
$('.deployToolTip').tooltip();
Expand Down
9 changes: 9 additions & 0 deletions deploy-board/deploy_board/webapp/host_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ def get(self, request, name, stage, hostname):
is_protected = autoscaling_groups_helper.is_hosts_protected(request, asg, [host_id])

agent_wrappers, is_unreachable = get_agent_wrapper(request, hostname)
has_host_env_sidecar_agents = any(
x for x in agent_wrappers['sidecars']
rwxzhu marked this conversation as resolved.
Show resolved Hide resolved
if x['env'] and x['env']['envName'] and
x['env']['stageName'] and
x['env']['envName'] == name and
x['env']['stageName'] == stage
)

host_details = get_host_details(host_id)

termination_limit = environs_helper.get_env_by_stage(request, name, stage).get('terminationLimit')
Expand All @@ -212,6 +220,7 @@ def get(self, request, name, stage, hostname):
'host_details': host_details,
'duplicate_stage': duplicate_stage,
'termination_limit': termination_limit,
'has_host_env_sidecar_agents': has_host_env_sidecar_agents,
})


Expand Down
Loading