Skip to content

Commit

Permalink
Merge pull request #53 from projectsyn/feat/configurable-distribution
Browse files Browse the repository at this point in the history
Make distribution configurable instead of directly reading facts
  • Loading branch information
glrf authored Jan 28, 2022
2 parents 067936d + f3d6fde commit 777ea09
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
argocd:
namespace: syn
distribution: ${facts:distribution}
monitoring:
enabled: true
dashboards: false
Expand Down
2 changes: 1 addition & 1 deletion component/redis.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local role_binding = std.parseJson(kap.yaml_load('argocd/manifests/' + params.gi
local serviceaccount = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/redis/argocd-redis-sa.yaml'));
local service = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/redis/argocd-redis-service.yaml'));

local isOnOpenshift = std.startsWith(inv.parameters.facts.distribution, 'openshift');
local isOnOpenshift = std.startsWith(params.distribution, 'openshift');

local redisContainerSpec(image) =
{
Expand Down
2 changes: 1 addition & 1 deletion component/repo-server.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local inv = kap.inventory();
local params = inv.parameters.argocd;
local image = params.images.argocd.image + ':' + params.images.argocd.tag;

local isOpenshift = std.startsWith(inv.parameters.facts.distribution, 'openshift');
local isOpenshift = std.startsWith(params.distribution, 'openshift');
local deployment = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/repo-server/argocd-repo-server-deployment.yaml'));
local service = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/repo-server/argocd-repo-server-service.yaml'));
local vault_agent_config = kube.ConfigMap('vault-agent-config') {
Expand Down
8 changes: 8 additions & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ default:: `syn`

The namespace in which to deploy this component.

== `distribution`

[horizontal]
type:: string
default:: ${facts:distribution}

The Kubernetes distribution of the cluster.

== `git_tag`

[horizontal]
Expand Down

0 comments on commit 777ea09

Please sign in to comment.