fix: report stored node-sysctls images globally
The `--scheduler-k3s-global-node-sysctls-image` and `--scheduler-k3s-global-node-sysctls-pause-image` report flags returned the built-in default when nothing was stored, so an unset image could not be told apart from one set to the default. They now report the stored value like every other global flag, and new `--scheduler-k3s-computed-node-sysctls-image` and `--scheduler-k3s-computed-node-sysctls-pause-image` flags report the image that is actually used.
This commit is contained in:
@@ -1646,8 +1646,12 @@ func getComputedKustomizeRootPath(appName string) string {
|
||||
return kustomizeRootPath
|
||||
}
|
||||
|
||||
func getGlobalNodeSysctlsImage() string {
|
||||
return common.PropertyGet("scheduler-k3s", "--global", "node-sysctls-image")
|
||||
}
|
||||
|
||||
func getComputedNodeSysctlsImage() string {
|
||||
image := common.PropertyGet("scheduler-k3s", "--global", "node-sysctls-image")
|
||||
image := getGlobalNodeSysctlsImage()
|
||||
if image == "" {
|
||||
image = DefaultNodeSysctlsImage
|
||||
}
|
||||
@@ -1655,8 +1659,12 @@ func getComputedNodeSysctlsImage() string {
|
||||
return image
|
||||
}
|
||||
|
||||
func getGlobalNodeSysctlsPauseImage() string {
|
||||
return common.PropertyGet("scheduler-k3s", "--global", "node-sysctls-pause-image")
|
||||
}
|
||||
|
||||
func getComputedNodeSysctlsPauseImage() string {
|
||||
image := common.PropertyGet("scheduler-k3s", "--global", "node-sysctls-pause-image")
|
||||
image := getGlobalNodeSysctlsPauseImage()
|
||||
if image == "" {
|
||||
image = DefaultNodeSysctlsPauseImage
|
||||
}
|
||||
|
||||
@@ -40,85 +40,89 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
}
|
||||
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--scheduler-k3s-computed-cert-issuer-kind": reportComputedCertIssuerKind,
|
||||
"--scheduler-k3s-global-cert-issuer-kind": reportGlobalCertIssuerKind,
|
||||
"--scheduler-k3s-computed-cert-issuer-name": reportComputedCertIssuerName,
|
||||
"--scheduler-k3s-global-cert-issuer-name": reportGlobalCertIssuerName,
|
||||
"--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-global-node-sysctls-image": reportGlobalNodeSysctlsImage,
|
||||
"--scheduler-k3s-global-node-sysctls-pause-image": reportGlobalNodeSysctlsPauseImage,
|
||||
"--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,
|
||||
tokenFlag: tokenReportFunc,
|
||||
"--scheduler-k3s-computed-cert-issuer-kind": reportComputedCertIssuerKind,
|
||||
"--scheduler-k3s-global-cert-issuer-kind": reportGlobalCertIssuerKind,
|
||||
"--scheduler-k3s-computed-cert-issuer-name": reportComputedCertIssuerName,
|
||||
"--scheduler-k3s-global-cert-issuer-name": reportGlobalCertIssuerName,
|
||||
"--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-node-sysctls-image": reportComputedNodeSysctlsImage,
|
||||
"--scheduler-k3s-global-node-sysctls-image": reportGlobalNodeSysctlsImage,
|
||||
"--scheduler-k3s-computed-node-sysctls-pause-image": reportComputedNodeSysctlsPauseImage,
|
||||
"--scheduler-k3s-global-node-sysctls-pause-image": reportGlobalNodeSysctlsPauseImage,
|
||||
"--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,
|
||||
tokenFlag: tokenReportFunc,
|
||||
}
|
||||
} else {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--scheduler-k3s-computed-cert-issuer-kind": reportComputedCertIssuerKind,
|
||||
"--scheduler-k3s-cert-issuer-kind": reportCertIssuerKind,
|
||||
"--scheduler-k3s-global-cert-issuer-kind": reportGlobalCertIssuerKind,
|
||||
"--scheduler-k3s-computed-cert-issuer-name": reportComputedCertIssuerName,
|
||||
"--scheduler-k3s-cert-issuer-name": reportCertIssuerName,
|
||||
"--scheduler-k3s-global-cert-issuer-name": reportGlobalCertIssuerName,
|
||||
"--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-letsencrypt-email-prod": reportLetsencryptEmailProd,
|
||||
"--scheduler-k3s-global-letsencrypt-email-prod": reportGlobalLetsencryptEmailProd,
|
||||
"--scheduler-k3s-computed-letsencrypt-email-stag": reportComputedLetsencryptEmailStag,
|
||||
"--scheduler-k3s-letsencrypt-email-stag": reportLetsencryptEmailStag,
|
||||
"--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-global-node-sysctls-image": reportGlobalNodeSysctlsImage,
|
||||
"--scheduler-k3s-global-node-sysctls-pause-image": reportGlobalNodeSysctlsPauseImage,
|
||||
"--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-cert-issuer-kind": reportComputedCertIssuerKind,
|
||||
"--scheduler-k3s-cert-issuer-kind": reportCertIssuerKind,
|
||||
"--scheduler-k3s-global-cert-issuer-kind": reportGlobalCertIssuerKind,
|
||||
"--scheduler-k3s-computed-cert-issuer-name": reportComputedCertIssuerName,
|
||||
"--scheduler-k3s-cert-issuer-name": reportCertIssuerName,
|
||||
"--scheduler-k3s-global-cert-issuer-name": reportGlobalCertIssuerName,
|
||||
"--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-letsencrypt-email-prod": reportLetsencryptEmailProd,
|
||||
"--scheduler-k3s-global-letsencrypt-email-prod": reportGlobalLetsencryptEmailProd,
|
||||
"--scheduler-k3s-computed-letsencrypt-email-stag": reportComputedLetsencryptEmailStag,
|
||||
"--scheduler-k3s-letsencrypt-email-stag": reportLetsencryptEmailStag,
|
||||
"--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-node-sysctls-image": reportComputedNodeSysctlsImage,
|
||||
"--scheduler-k3s-global-node-sysctls-image": reportGlobalNodeSysctlsImage,
|
||||
"--scheduler-k3s-computed-node-sysctls-pause-image": reportComputedNodeSysctlsPauseImage,
|
||||
"--scheduler-k3s-global-node-sysctls-pause-image": reportGlobalNodeSysctlsPauseImage,
|
||||
"--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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,14 +690,22 @@ func reportGlobalNetworkInterface(appName string) string {
|
||||
return getGlobalNetworkInterface()
|
||||
}
|
||||
|
||||
func reportGlobalNodeSysctlsImage(appName string) string {
|
||||
func reportComputedNodeSysctlsImage(appName string) string {
|
||||
return getComputedNodeSysctlsImage()
|
||||
}
|
||||
|
||||
func reportGlobalNodeSysctlsPauseImage(appName string) string {
|
||||
func reportGlobalNodeSysctlsImage(appName string) string {
|
||||
return getGlobalNodeSysctlsImage()
|
||||
}
|
||||
|
||||
func reportComputedNodeSysctlsPauseImage(appName string) string {
|
||||
return getComputedNodeSysctlsPauseImage()
|
||||
}
|
||||
|
||||
func reportGlobalNodeSysctlsPauseImage(appName string) string {
|
||||
return getGlobalNodeSysctlsPauseImage()
|
||||
}
|
||||
|
||||
func reportComputedRollbackOnFailure(appName string) string {
|
||||
return getComputedRollbackOnFailure(appName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user