Skip to content

Initial implementation - #1

Merged
paveq merged 33 commits into
mainfrom
initial-implementation
Apr 16, 2026
Merged

Initial implementation#1
paveq merged 33 commits into
mainfrom
initial-implementation

Conversation

@paveq

@paveq paveq commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Paavo Pokkinen added 30 commits April 1, 2026 12:56
Expose two new static plugin parameters:
- no-default-provisioners: when "true", passes --no-default-provisioners
  to score-k8s init so the built-in provisioners file is not generated.
- debug: when "true", enables [score-argocd-cmp] stderr logging without
  needing to set SCORE_CMP_DEBUG on the sidecar.
Adds patches/strip-instance-suffix.tpl which overwrites the random
InstanceSuffix score-k8s injects into Deployment + workload Service
labels and selectors. Without state persistence the suffix is
regenerated per render, and the resulting selector update is rejected
by the API server because selector.matchLabels is immutable.

The init step now discovers all *.tpl files under
/usr/local/share/score-argocd-cmp/patches and passes each as
--patch-templates to score-k8s init. A missing directory is a no-op so
the binary still runs outside the container image.
New required static parameter exposing a short, stable customer/instance
identifier to score provisioners (as PARAM_INSTANCE_NAME) for use as a
name component in generated K8s objects. Decoupled from ARGOCD_APP_NAME
so the Argo Application name can stay long and descriptive in the UI
while resource names stay within the 63-char limit.

Also fill in tooltip and collectionType on every static param so the
Argo Parameters tab renders helpful guidance.
Add a paramscan package that walks a directory for *.yaml files and
greps PARAM_<UPPER_SNAKE> identifiers, filtering out the built-in
plugin params (PROVISIONERS_URL, INSTANCE_NAME, NO_DEFAULT_PROVISIONERS,
DEBUG). Wire it into discover.Params: when PARAM_PROVISIONERS_URL is
set, materialize the provisioners into a temp directory via a new
initialize.RunInDir helper, scan the resulting .score-k8s state, and
append each discovered name (e.g. PARAM_DOMAIN -> "domain") to the
dynamic parameter announcement.

ArgoCD CMP does not run init before parameters.dynamic, so we must
fetch the provisioners ourselves at discovery time. Failures are
logged and ignored — the static image params still come back so the
RPC never fails on a transient registry error.

Test-generate.sh test 9 is updated to set PARAM_DOMAIN instead of
ARGOCD_ENV_DOMAIN and to assert the rendered output contains the
hostname. New test 10 verifies that discover-params announces a
domain parameter when handed a provisioner file referencing it.
Paavo Pokkinen added 3 commits April 9, 2026 15:12
cmd:// provisioner args use shell ${PARAM_FOO} substitution rather
than Go template {{ env "PARAM_FOO" }}, since score-k8s does not
template the args field. Add a fixture file to assert paramscan
discovers PARAM_BUCKET in that form.
@paveq
paveq merged commit edf2f58 into main Apr 16, 2026
1 of 2 checks passed
@paveq
paveq deleted the initial-implementation branch April 24, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant