fix: split more report global keys into raw and computed
Three plugins still leaked the built-in default through `<plugin>-global-<property>` after the broader raw/computed split in #8640. External tooling reading `:report --format json` for drift detection could not distinguish "set to default" from "never set" - after a `:set --global` followed by an unset, the JSON still reported the default value. The `<plugin>-global-<property>` keys now hold the raw stored value (empty when nothing has been set) and `<plugin>-computed-<property>` keys hold the effective value with per-app, global, and built-in default fallback. Every global property now has a computed sibling for shape consistency, including those whose default is empty. Internal callers in `scheduler-k3s` that previously read the default-applied global helpers now consume new `getComputed*` helpers, keeping deploy-time behavior unchanged.
This commit is contained in:
15 files changed
+575
-162
No files matched your search
@@ -18,49 +18,68 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
var flags map[string]common.ReportFunc
|
||||
if appName == "--global" {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--scheduler-k3s-global-deploy-timeout": reportGlobalDeployTimeout,
|
||||
"--scheduler-k3s-global-image-pull-secrets": reportGlobalImagePullSecrets,
|
||||
"--scheduler-k3s-global-kubeconfig-path": reportGlobalKubeconfigPath,
|
||||
"--scheduler-k3s-global-kube-context": reportGlobalKubeContext,
|
||||
"--scheduler-k3s-global-letsencrypt-server": reportGlobalLetsencryptServer,
|
||||
"--scheduler-k3s-global-ingress-class": reportGlobalIngressClass,
|
||||
"--scheduler-k3s-global-letsencrypt-email-prod": reportGlobalLetsencryptEmailProd,
|
||||
"--scheduler-k3s-global-letsencrypt-email-stag": reportGlobalLetsencryptEmailStag,
|
||||
"--scheduler-k3s-global-kustomize-root-path": reportGlobalKustomizeRootPath,
|
||||
"--scheduler-k3s-global-namespace": reportGlobalNamespace,
|
||||
"--scheduler-k3s-global-network-interface": reportGlobalNetworkInterface,
|
||||
"--scheduler-k3s-global-rollback-on-failure": reportGlobalRollbackOnFailure,
|
||||
"--scheduler-k3s-global-shm-size": reportGlobalShmSize,
|
||||
"--scheduler-k3s-computed-deploy-timeout": reportComputedDeployTimeout,
|
||||
"--scheduler-k3s-global-deploy-timeout": reportGlobalDeployTimeout,
|
||||
"--scheduler-k3s-computed-image-pull-secrets": reportComputedImagePullSecrets,
|
||||
"--scheduler-k3s-global-image-pull-secrets": reportGlobalImagePullSecrets,
|
||||
"--scheduler-k3s-computed-ingress-class": reportComputedIngressClass,
|
||||
"--scheduler-k3s-global-ingress-class": reportGlobalIngressClass,
|
||||
"--scheduler-k3s-computed-kubeconfig-path": reportComputedKubeconfigPath,
|
||||
"--scheduler-k3s-global-kubeconfig-path": reportGlobalKubeconfigPath,
|
||||
"--scheduler-k3s-computed-kube-context": reportComputedKubeContext,
|
||||
"--scheduler-k3s-global-kube-context": reportGlobalKubeContext,
|
||||
"--scheduler-k3s-computed-kustomize-root-path": reportComputedKustomizeRootPath,
|
||||
"--scheduler-k3s-global-kustomize-root-path": reportGlobalKustomizeRootPath,
|
||||
"--scheduler-k3s-computed-letsencrypt-server": reportComputedLetsencryptServer,
|
||||
"--scheduler-k3s-global-letsencrypt-server": reportGlobalLetsencryptServer,
|
||||
"--scheduler-k3s-computed-letsencrypt-email-prod": reportComputedLetsencryptEmailProd,
|
||||
"--scheduler-k3s-global-letsencrypt-email-prod": reportGlobalLetsencryptEmailProd,
|
||||
"--scheduler-k3s-computed-letsencrypt-email-stag": reportComputedLetsencryptEmailStag,
|
||||
"--scheduler-k3s-global-letsencrypt-email-stag": reportGlobalLetsencryptEmailStag,
|
||||
"--scheduler-k3s-computed-namespace": reportComputedNamespace,
|
||||
"--scheduler-k3s-global-namespace": reportGlobalNamespace,
|
||||
"--scheduler-k3s-computed-network-interface": reportComputedNetworkInterface,
|
||||
"--scheduler-k3s-global-network-interface": reportGlobalNetworkInterface,
|
||||
"--scheduler-k3s-computed-rollback-on-failure": reportComputedRollbackOnFailure,
|
||||
"--scheduler-k3s-global-rollback-on-failure": reportGlobalRollbackOnFailure,
|
||||
"--scheduler-k3s-computed-shm-size": reportComputedShmSize,
|
||||
"--scheduler-k3s-global-shm-size": reportGlobalShmSize,
|
||||
}
|
||||
} else {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--scheduler-k3s-computed-deploy-timeout": reportComputedDeployTimeout,
|
||||
"--scheduler-k3s-deploy-timeout": reportDeployTimeout,
|
||||
"--scheduler-k3s-global-deploy-timeout": reportGlobalDeployTimeout,
|
||||
"--scheduler-k3s-computed-image-pull-secrets": reportComputedImagePullSecrets,
|
||||
"--scheduler-k3s-image-pull-secrets": reportImagePullSecrets,
|
||||
"--scheduler-k3s-global-image-pull-secrets": reportGlobalImagePullSecrets,
|
||||
"--scheduler-k3s-global-kubeconfig-path": reportGlobalKubeconfigPath,
|
||||
"--scheduler-k3s-global-kube-context": reportGlobalKubeContext,
|
||||
"--scheduler-k3s-computed-letsencrypt-server": reportComputedLetsencryptServer,
|
||||
"--scheduler-k3s-letsencrypt-server": reportLetsencryptServer,
|
||||
"--scheduler-k3s-global-letsencrypt-server": reportGlobalLetsencryptServer,
|
||||
"--scheduler-k3s-global-ingress-class": reportGlobalIngressClass,
|
||||
"--scheduler-k3s-global-letsencrypt-email-prod": reportGlobalLetsencryptEmailProd,
|
||||
"--scheduler-k3s-global-letsencrypt-email-stag": reportGlobalLetsencryptEmailStag,
|
||||
"--scheduler-k3s-computed-kustomize-root-path": reportComputedKustomizeRootPath,
|
||||
"--scheduler-k3s-kustomize-root-path": reportKustomizeRootPath,
|
||||
"--scheduler-k3s-global-kustomize-root-path": reportGlobalKustomizeRootPath,
|
||||
"--scheduler-k3s-computed-namespace": reportComputedNamespace,
|
||||
"--scheduler-k3s-namespace": reportNamespace,
|
||||
"--scheduler-k3s-global-namespace": reportGlobalNamespace,
|
||||
"--scheduler-k3s-global-network-interface": reportGlobalNetworkInterface,
|
||||
"--scheduler-k3s-computed-rollback-on-failure": reportComputedRollbackOnFailure,
|
||||
"--scheduler-k3s-rollback-on-failure": reportRollbackOnFailure,
|
||||
"--scheduler-k3s-global-rollback-on-failure": reportGlobalRollbackOnFailure,
|
||||
"--scheduler-k3s-computed-shm-size": reportComputedShmSize,
|
||||
"--scheduler-k3s-global-shm-size": reportGlobalShmSize,
|
||||
"--scheduler-k3s-shm-size": reportShmSize,
|
||||
"--scheduler-k3s-computed-deploy-timeout": reportComputedDeployTimeout,
|
||||
"--scheduler-k3s-deploy-timeout": reportDeployTimeout,
|
||||
"--scheduler-k3s-global-deploy-timeout": reportGlobalDeployTimeout,
|
||||
"--scheduler-k3s-computed-image-pull-secrets": reportComputedImagePullSecrets,
|
||||
"--scheduler-k3s-image-pull-secrets": reportImagePullSecrets,
|
||||
"--scheduler-k3s-global-image-pull-secrets": reportGlobalImagePullSecrets,
|
||||
"--scheduler-k3s-computed-ingress-class": reportComputedIngressClass,
|
||||
"--scheduler-k3s-global-ingress-class": reportGlobalIngressClass,
|
||||
"--scheduler-k3s-computed-kubeconfig-path": reportComputedKubeconfigPath,
|
||||
"--scheduler-k3s-global-kubeconfig-path": reportGlobalKubeconfigPath,
|
||||
"--scheduler-k3s-computed-kube-context": reportComputedKubeContext,
|
||||
"--scheduler-k3s-global-kube-context": reportGlobalKubeContext,
|
||||
"--scheduler-k3s-computed-kustomize-root-path": reportComputedKustomizeRootPath,
|
||||
"--scheduler-k3s-kustomize-root-path": reportKustomizeRootPath,
|
||||
"--scheduler-k3s-global-kustomize-root-path": reportGlobalKustomizeRootPath,
|
||||
"--scheduler-k3s-computed-letsencrypt-server": reportComputedLetsencryptServer,
|
||||
"--scheduler-k3s-letsencrypt-server": reportLetsencryptServer,
|
||||
"--scheduler-k3s-global-letsencrypt-server": reportGlobalLetsencryptServer,
|
||||
"--scheduler-k3s-computed-letsencrypt-email-prod": reportComputedLetsencryptEmailProd,
|
||||
"--scheduler-k3s-global-letsencrypt-email-prod": reportGlobalLetsencryptEmailProd,
|
||||
"--scheduler-k3s-computed-letsencrypt-email-stag": reportComputedLetsencryptEmailStag,
|
||||
"--scheduler-k3s-global-letsencrypt-email-stag": reportGlobalLetsencryptEmailStag,
|
||||
"--scheduler-k3s-computed-namespace": reportComputedNamespace,
|
||||
"--scheduler-k3s-namespace": reportNamespace,
|
||||
"--scheduler-k3s-global-namespace": reportGlobalNamespace,
|
||||
"--scheduler-k3s-computed-network-interface": reportComputedNetworkInterface,
|
||||
"--scheduler-k3s-global-network-interface": reportGlobalNetworkInterface,
|
||||
"--scheduler-k3s-computed-rollback-on-failure": reportComputedRollbackOnFailure,
|
||||
"--scheduler-k3s-rollback-on-failure": reportRollbackOnFailure,
|
||||
"--scheduler-k3s-global-rollback-on-failure": reportGlobalRollbackOnFailure,
|
||||
"--scheduler-k3s-computed-shm-size": reportComputedShmSize,
|
||||
"--scheduler-k3s-global-shm-size": reportGlobalShmSize,
|
||||
"--scheduler-k3s-shm-size": reportShmSize,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,17 +160,30 @@ func reportGlobalImagePullSecrets(appName string) string {
|
||||
return getGlobalImagePullSecrets()
|
||||
}
|
||||
|
||||
func reportComputedIngressClass(appName string) string {
|
||||
return getComputedIngressClass()
|
||||
}
|
||||
|
||||
func reportGlobalIngressClass(appName string) string {
|
||||
return getGlobalIngressClass()
|
||||
}
|
||||
|
||||
func reportComputedKubeconfigPath(appName string) string {
|
||||
return getComputedKubeconfigPath()
|
||||
}
|
||||
|
||||
func reportGlobalKubeconfigPath(appName string) string {
|
||||
return getKubeconfigPath()
|
||||
return getGlobalKubeconfigPath()
|
||||
}
|
||||
|
||||
func reportComputedKubeContext(appName string) string {
|
||||
return getComputedKubeContext()
|
||||
}
|
||||
|
||||
func reportGlobalKubeContext(appName string) string {
|
||||
return getKubeContext()
|
||||
return getGlobalKubeContext()
|
||||
}
|
||||
|
||||
func reportComputedLetsencryptServer(appName string) string {
|
||||
return getComputedLetsencryptServer(appName)
|
||||
}
|
||||
@@ -164,10 +196,18 @@ func reportGlobalLetsencryptServer(appName string) string {
|
||||
return getGlobalLetsencryptServer()
|
||||
}
|
||||
|
||||
func reportComputedLetsencryptEmailProd(appName string) string {
|
||||
return getComputedLetsencryptEmailProd()
|
||||
}
|
||||
|
||||
func reportGlobalLetsencryptEmailProd(appName string) string {
|
||||
return getGlobalLetsencryptEmailProd()
|
||||
}
|
||||
|
||||
func reportComputedLetsencryptEmailStag(appName string) string {
|
||||
return getComputedLetsencryptEmailStag()
|
||||
}
|
||||
|
||||
func reportGlobalLetsencryptEmailStag(appName string) string {
|
||||
return getGlobalLetsencryptEmailStag()
|
||||
}
|
||||
@@ -196,6 +236,10 @@ func reportGlobalNamespace(appName string) string {
|
||||
return getGlobalNamespace()
|
||||
}
|
||||
|
||||
func reportComputedNetworkInterface(appName string) string {
|
||||
return getComputedNetworkInterface()
|
||||
}
|
||||
|
||||
func reportGlobalNetworkInterface(appName string) string {
|
||||
return getGlobalNetworkInterface()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user