Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TEST_ENABLED conditional syntax POSIX friendly #54

Merged
merged 1 commit into from
May 3, 2022

Conversation

rgschmitz1
Copy link
Contributor

Signed-off-by: Bob Schmitz III schmitzr1984@gmail.com

Description

  • Fixed shell TEST_ENABLED conditional syntax to be POSIX friendly.
  • Changed multi-line conditional to use more condensed ternary operation.

Motivation and Context

This fixes a syntax error occurring in Debian based image templates which uses dash as the default shell.

  • I have raised an issue to propose this change (required)
  • My issue has received approval from the maintainers or lead with the design/approved label

Closes #53

How Has This Been Tested?

  1. Created stripped Dockerfiles for both python:3.7-alpine and python:3.7-slim-buster (see https://gist.github.com/rgschmitz1/1cc3f375e582433dc80191b87d2e103e for detailed log).
  2. Issued docker build command for both base images.
  3. Tested fix in templates using the openfaas documentation for creating new functions, verified TEST_ENABLED works as described in documentation when set to "false".
  • FaaS-CLI version ( Full output from: faas-cli version ):
  ___                   _____           ____
 / _ \ _ __   ___ _ __ |  ___|_ _  __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) |  __/ | | |  _| (_| | (_| |___) |
 \___/| .__/ \___|_| |_|_|  \__,_|\__,_|____/
      |_|

CLI:
 commit:  b1c09c0243f69990b6c81a17d7337f0fd23e7542
 version: 0.14.2
  • Docker version docker version (e.g. Docker 17.0.05 ):
Docker version 20.10.14, build a224086
  • Operating System and version (e.g. Linux, Windows, MacOS):
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Signed-off-by: Bob Schmitz III <schmitzr1984@gmail.com>
@LucasRoesler
Copy link
Member

@alexellis this is 👍 but i can't merge it myself, I think you are the only one that can.

@rgschmitz1 rgschmitz1 changed the title fix: make TEST_ENABLED conditional syntax POSIX friendly Make TEST_ENABLED conditional syntax POSIX friendly Apr 29, 2022
Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@alexellis alexellis merged commit 152f0bc into openfaas:master May 3, 2022
@alexellis
Copy link
Member

Thanks for the PR and review.

A good time to get eyes on PRs and requests like this would be at our weekly community call, feel free to see the pinned issue at: https://github.com/openfaas/faas/issues

Alex

@rgschmitz1 rgschmitz1 deleted the test-enabled-fix branch May 3, 2022 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python3-*-debian syntax error during TEST_ENABLED check
3 participants