fix: ensure we do not filter apps for certain commands and triggers

Some things must pull *all* apps vs filtered apps (mostly things that write out config files or install triggers). Using an unflitered list is best.

Also, we default to filtering, which should be what most usage needs.
This commit is contained in:
Jose Diaz-Gonzalez
2022-05-15 15:47:13 -04:00
parent f87cd22340
commit 268c318bc5
11 changed files with 12 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ migrate_checks_vars_0_5_0() {
local GLOBAL_SKIP_ALL_CHECKS=$(config_get --global DOKKU_SKIP_ALL_CHECKS || true) local GLOBAL_SKIP_ALL_CHECKS=$(config_get --global DOKKU_SKIP_ALL_CHECKS || true)
local GLOBAL_SKIP_DEFAULT_CHECKS=$(config_get --global DOKKU_SKIP_DEFAULT_CHECKS || true) local GLOBAL_SKIP_DEFAULT_CHECKS=$(config_get --global DOKKU_SKIP_DEFAULT_CHECKS || true)
for app in $(dokku_apps); do for app in $(dokku_apps "false"); do
local APP_SKIP_ALL_CHECKS=$(config_get "$app" DOKKU_SKIP_ALL_CHECKS || true) local APP_SKIP_ALL_CHECKS=$(config_get "$app" DOKKU_SKIP_ALL_CHECKS || true)
local APP_SKIP_DEFAULT_CHECKS=$(config_get "$app" DOKKU_SKIP_DEFAULT_CHECKS || true) local APP_SKIP_DEFAULT_CHECKS=$(config_get "$app" DOKKU_SKIP_DEFAULT_CHECKS || true)
@@ -35,7 +35,7 @@ migrate_checks_vars_0_5_0() {
migrate_checks_vars_0_6_0() { migrate_checks_vars_0_6_0() {
declare desc="migrates CHECKS config variables from 0.5.x to support fully-disabled zero-downtime checks" declare desc="migrates CHECKS config variables from 0.5.x to support fully-disabled zero-downtime checks"
for app in $(dokku_apps); do for app in $(dokku_apps "false"); do
local APP_DOKKU_CHECKS_ENABLED=$(config_get "$app" DOKKU_CHECKS_ENABLED || true) local APP_DOKKU_CHECKS_ENABLED=$(config_get "$app" DOKKU_CHECKS_ENABLED || true)
if [[ $APP_DOKKU_CHECKS_ENABLED ]]; then if [[ $APP_DOKKU_CHECKS_ENABLED ]]; then
dokku_log_info1 "Migrating zero downtime env variables to 0.6.x. The following variables will be migrated" dokku_log_info1 "Migrating zero downtime env variables to 0.6.x. The following variables will be migrated"

View File

@@ -36,7 +36,7 @@ func TriggerInstall() error {
return fmt.Errorf("Unable to install the common plugin: %s", err.Error()) return fmt.Errorf("Unable to install the common plugin: %s", err.Error())
} }
apps, err := DokkuApps() apps, err := UnfilteredDokkuApps()
if err != nil { if err != nil {
return nil return nil
} }

View File

@@ -99,7 +99,7 @@ func deleteCrontab() error {
} }
func writeCronEntries() error { func writeCronEntries() error {
apps, _ := common.DokkuApps() apps, _ := common.UnfilteredDokkuApps()
commands := []templateCommand{} commands := []templateCommand{}
for _, appName := range apps { for _, appName := range apps {
scheduler := common.GetAppScheduler(appName) scheduler := common.GetAppScheduler(appName)

View File

@@ -8,7 +8,7 @@ trigger-domains-install() {
declare trigger="install" declare trigger="install"
shopt -s nullglob shopt -s nullglob
for app in $(dokku_apps); do for app in $(dokku_apps "false"); do
domains_setup "$app" domains_setup "$app"
done done
} }

View File

@@ -26,7 +26,7 @@ migrate_git_vars_0_12_0() {
DOKKU_QUIET_OUTPUT=1 config_unset --global DOKKU_DEPLOY_BRANCH || true DOKKU_QUIET_OUTPUT=1 config_unset --global DOKKU_DEPLOY_BRANCH || true
fi fi
for app in $(dokku_apps); do for app in $(dokku_apps "false"); do
DOKKU_DEPLOY_BRANCH=$(config_get "$app" DOKKU_DEPLOY_BRANCH || true) DOKKU_DEPLOY_BRANCH=$(config_get "$app" DOKKU_DEPLOY_BRANCH || true)
if [[ -n "$DOKKU_DEPLOY_BRANCH" ]]; then if [[ -n "$DOKKU_DEPLOY_BRANCH" ]]; then
fn-plugin-property-write "git" "$app" "deploy-branch" "$DOKKU_DEPLOY_BRANCH" fn-plugin-property-write "git" "$app" "deploy-branch" "$DOKKU_DEPLOY_BRANCH"

View File

@@ -157,7 +157,7 @@ func sinkValueToConfig(appName string, sinkValue string) (vectorSink, error) {
} }
func writeVectorConfig() error { func writeVectorConfig() error {
apps, _ := common.DokkuApps() apps, _ := common.UnfilteredDokkuApps()
data := vectorConfig{ data := vectorConfig{
Sources: map[string]vectorSource{}, Sources: map[string]vectorSource{},
Sinks: map[string]vectorSink{}, Sinks: map[string]vectorSink{},

View File

@@ -33,7 +33,7 @@ func TriggerInstall() error {
return fmt.Errorf("Unable to install the network plugin: %s", err.Error()) return fmt.Errorf("Unable to install the network plugin: %s", err.Error())
} }
apps, err := common.DokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil {
return nil return nil
} }

View File

@@ -109,7 +109,7 @@ validate_nginx() {
verify_app_name "$APP" verify_app_name "$APP"
nginx_vhosts_validate_single_func "$APP" "$FLAG" nginx_vhosts_validate_single_func "$APP" "$FLAG"
else else
for app in $(dokku_apps); do for app in $(dokku_apps "false"); do
nginx_vhosts_validate_single_func "$app" "$FLAG" nginx_vhosts_validate_single_func "$app" "$FLAG"
done done
fi fi

View File

@@ -95,7 +95,7 @@ trigger-nginx-vhosts-install() {
[[ -f /etc/logrotate.d/nginx ]] && sed -i -e 's/invoke-rc.d/service/g' /etc/logrotate.d/nginx [[ -f /etc/logrotate.d/nginx ]] && sed -i -e 's/invoke-rc.d/service/g' /etc/logrotate.d/nginx
# @TODO: Remove this after a few versions # @TODO: Remove this after a few versions
for app in $(dokku_apps); do for app in $(dokku_apps "false"); do
nginx_port="$(config_get "$app" DOKKU_NGINX_PORT || true)" nginx_port="$(config_get "$app" DOKKU_NGINX_PORT || true)"
nginx_ssl_port="$(config_get "$app" DOKKU_NGINX_SSL_PORT || true)" nginx_ssl_port="$(config_get "$app" DOKKU_NGINX_SSL_PORT || true)"
if [[ -n "$nginx_port" ]] || [[ -n "$nginx_ssl_port" ]]; then if [[ -n "$nginx_port" ]] || [[ -n "$nginx_ssl_port" ]]; then

View File

@@ -74,7 +74,7 @@ func TriggerInstall() error {
return err return err
} }
apps, err := common.DokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil {
return nil return nil
} }

View File

@@ -31,7 +31,7 @@ func TriggerInstall() error {
return fmt.Errorf("Unable to install the scheduler plugin: %s", err.Error()) return fmt.Errorf("Unable to install the scheduler plugin: %s", err.Error())
} }
apps, err := common.DokkuApps() apps, err := common.UnfilteredDokkuApps()
if err != nil { if err != nil {
return nil return nil
} }