Skip to content

Commit fff9e82

Browse files
committed
fix(operator): address review feedback on private platform source
- Run `go mod tidy` to move github.com/fluxcd/pkg/apis/meta from indirect to direct require: it became a direct import after the SecretRef type fix. - Refine the --platform-source-secret flag docstring and the matching values.yaml comment: drop identity.pub from the SSH required-keys list (Flux source-controller only consumes identity + known_hosts) and mention bearerToken as an alternative to username+password for Git over HTTPS. - Note in values.yaml that the Secret must exist in cozy-system before the operator reconciles; otherwise source-controller reports a failed condition until the Secret is created. Signed-off-by: Ivan Okhotnikov <[email protected]>
1 parent 0427b18 commit fff9e82

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎cmd/cozystack-operator/main.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func main() {
140140
flag.StringVar(&platformSourceURL, "platform-source-url", "", "Platform source URL (oci:// or https://). If specified, generates OCIRepository or GitRepository resource.")
141141
flag.StringVar(&platformSourceName, "platform-source-name", "cozystack-platform", "Name for the generated platform source resource and PackageSource")
142142
flag.StringVar(&platformSourceRef, "platform-source-ref", "", "Reference specification as key=value pairs (e.g., 'branch=main' or 'digest=sha256:...,tag=v1.0'). For OCI: digest, semver, semverFilter, tag. For Git: branch, tag, semver, name, commit.")
143-
flag.StringVar(&platformSourceSecret, "platform-source-secret", "", "Name of the Secret in cozy-system namespace containing credentials for the platform source. Sets spec.secretRef on the generated OCIRepository or GitRepository. Secret type depends on the source kind: kubernetes.io/dockerconfigjson for OCI (oci://...); Opaque with username+password for Git over HTTPS; Opaque with identity, identity.pub, known_hosts for Git over SSH.")
143+
flag.StringVar(&platformSourceSecret, "platform-source-secret", "", "Name of the Secret in cozy-system namespace containing credentials for the platform source. Sets spec.secretRef on the generated OCIRepository or GitRepository. Secret type depends on the source kind: kubernetes.io/dockerconfigjson for OCI (oci://...); Opaque with username+password (or bearerToken) for Git over HTTPS; Opaque with identity (PEM private key) and known_hosts for Git over SSH.")
144144
flag.StringVar(&cozyValuesSecretName, "cozy-values-secret-name", "cozystack-values", "The name of the secret containing cluster-wide configuration values.")
145145
flag.StringVar(&cozyValuesSecretNamespace, "cozy-values-secret-namespace", "cozy-system", "The namespace of the secret containing cluster-wide configuration values.")
146146
flag.StringVar(&cozyValuesNamespaceSelector, "cozy-values-namespace-selector", "cozystack.io/system=true", "The label selector for namespaces where the cluster-wide configuration values must be replicated.")

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
github.com/cozystack/cozystack-scheduler/pkg/apis v0.1.1
1010
github.com/emicklei/dot v1.10.0
1111
github.com/fluxcd/helm-controller/api v1.4.3
12+
github.com/fluxcd/pkg/apis/meta v1.23.0
1213
github.com/fluxcd/source-controller/api v1.7.4
1314
github.com/fluxcd/source-watcher/api/v2 v2.0.3
1415
github.com/go-logr/logr v1.4.3
@@ -55,7 +56,6 @@ require (
5556
github.com/felixge/httpsnoop v1.0.4 // indirect
5657
github.com/fluxcd/pkg/apis/acl v0.9.0 // indirect
5758
github.com/fluxcd/pkg/apis/kustomize v1.13.0 // indirect
58-
github.com/fluxcd/pkg/apis/meta v1.23.0 // indirect
5959
github.com/fsnotify/fsnotify v1.9.0 // indirect
6060
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
6161
github.com/go-logr/stdr v1.2.2 // indirect

‎packages/core/installer/values.yaml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ cozystackOperator:
3333
# platform source. When non-empty, sets spec.secretRef on the generated
3434
# OCIRepository or GitRepository resource. Secret type depends on source kind:
3535
# OCI (oci://...): kubernetes.io/dockerconfigjson with registry credentials.
36-
# Git over HTTPS: Opaque/generic secret with `username` + `password` keys.
37-
# Git over SSH: Opaque/generic secret with `identity`, `identity.pub`,
38-
# and `known_hosts` keys.
36+
# Git over HTTPS: Opaque secret with `username`+`password`, or `bearerToken`.
37+
# Git over SSH: Opaque secret with `identity` (PEM private key) and `known_hosts`.
38+
# The Secret must already exist in cozy-system before the operator reconciles;
39+
# otherwise source-controller will report a failed condition until it is created.
3940
# See FluxCD source-controller docs for the exact key layout per scheme.
4041
platformSourceSecret: ''
4142
# Generic variant configuration (only used when cozystackOperator.variant=generic)

0 commit comments

Comments
 (0)