Skip to content

environment vars wan't be removed from runtime #803

Open
@toschneck

Description

@toschneck

When an configuration value will be removed from func.yaml, it will be not removed from the container environment context after a new deployment.

how-to-reproduce:

  1. add config val to func.yaml
name: jhello
version: 0.0.24
runtime: java
cmd: com.example.fn.HelloFunction::handleRequest
build_image: fnproject/fn-java-fdk-build:jdk9-1.0.56
run_image: fnproject/fn-java-fdk:jdk9-1.0.56
format: http
config:
  MY_ENV_VAL: test

and print out the envs e.g. in the java FDK:

package com.example.fn;

import java.util.stream.Collectors;

public class HelloFunction {

    public String handleRequest(String input) {
        return System.getenv().entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining(", "));
    }

}
  1. deploy the function fn --verbose deploy --app japp --local
  2. curl http://localhost:8080/r/japp/jhello response contains value MY_ENV_VAL=test
  3. remove MY_ENV_VAL: test from func.yaml
  4. deploy the function again: fn --verbose deploy --app japp --local
  5. curl http://localhost:8080/r/japp/jhello response contains STILL the value MY_ENV_VAL=test

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIwe should move these to CLI?UXbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions