MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / GetResourceQuantityFromEnvVar

Function GetResourceQuantityFromEnvVar

pkg/config/env.go:64–74  ·  view source on GitHub ↗
(env string)

Source from the content-addressed store, hash-verified

62}
63
64func GetResourceQuantityFromEnvVar(env string) (*resource.Quantity, error) {
65 val := os.Getenv(env)
66 if val == "" {
67 return nil, fmt.Errorf("environment variable %s is unset", env)
68 }
69 quantity, err := resource.ParseQuantity(val)
70 if err != nil {
71 return nil, fmt.Errorf("failed to parse environment variable %s: %s", env, err)
72 }
73 return &quantity, nil
74}
75
76func GetWorkspaceControllerSA() (string, error) {
77 saName := os.Getenv(constants.ControllerServiceAccountNameEnvVar)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected