Skip to content

Commit

Permalink
Expose expected agent version so cli + terraform can use it precisely (
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored Apr 30, 2024
1 parent 001a935 commit d32b1f4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AGENT_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.22
v0.4.23
2 changes: 2 additions & 0 deletions assets/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,8 @@ export type DeploymentSettings = {
__typename?: 'DeploymentSettings';
/** custom helm values to apply to all agents (useful for things like adding customary annotations/labels) */
agentHelmValues?: Maybe<Scalars['String']['output']>;
/** The console's expected agent version */
agentVsn: Scalars['String']['output'];
/** the repo to fetch CAPI manifests from, for both providers and clusters */
artifactRepository?: Maybe<GitRepository>;
/** your compliant k8s version */
Expand Down
3 changes: 3 additions & 0 deletions lib/console/deployments/settings.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ defmodule Console.Deployments.Settings do
@spec agent_ref() :: binary
def agent_ref(), do: "refs/tags/agent-#{@agent_vsn}"

@spec agent_vsn() :: binary
def agent_vsn(), do: @agent_vsn

@doc "same as fetch/0 but always reads from db"
def fetch_consistent() do
Console.Repo.get_by(DeploymentSettings, name: "global")
Expand Down
3 changes: 3 additions & 0 deletions lib/console/graphql/deployments.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
field :prometheus_connection, :http_connection, description: "the way we can connect to your prometheus instance"
field :agent_helm_values, :string, description: "custom helm values to apply to all agents (useful for things like adding customary annotations/labels)"

field :agent_vsn, non_null(:string), description: "The console's expected agent version",
resolve: fn _, _, _ -> {:ok, Settings.agent_vsn()} end

field :latest_k8s_vsn, non_null(:string), description: "the latest known k8s version",
resolve: fn _, _, _ -> {:ok, Settings.kube_vsn()} end

Expand Down
4 changes: 0 additions & 4 deletions lib/console/schema/pull_request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ defmodule Console.Schema.PullRequest do
from(pr in query, where: pr.stack_id == ^stack_id)
end

def open(query \\ __MODULE__) do
from(pr in query, where: pr.status == ^:open)
end

def stack(query \\ __MODULE__) do
from(pr in query, where: not is_nil(pr.stack_id))
end
Expand Down
3 changes: 3 additions & 0 deletions schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,9 @@ type DeploymentSettings {
"custom helm values to apply to all agents (useful for things like adding customary annotations\/labels)"
agentHelmValues: String

"The console's expected agent version"
agentVsn: String!

"the latest known k8s version"
latestK8sVsn: String!

Expand Down

0 comments on commit d32b1f4

Please sign in to comment.