-
Notifications
You must be signed in to change notification settings - Fork 11
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
support of kubernetes secrets (service catalog) #25
Conversation
nenaraab
commented
Aug 30, 2021
•
edited
Loading
edited
- document K8S Support
# Conflicts: # .github/workflows/build.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few things to check
dc21d4b
to
24c25bf
Compare
err = os.Unsetenv("KUBERNETES_SERVICE_HOST") | ||
if err != nil { | ||
return fmt.Errorf("error cleaning up after test: could not unset env KUBERNETES_SERVICE_HOST: %w", err) | ||
} | ||
err = os.Unsetenv("IAS_CONFIG_PATH") | ||
if err != nil { | ||
return fmt.Errorf("error cleaning up after test: could not unset env IAS_CONFIG_PATH: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
} | ||
instanceCredentialsMap[instanceSecretFile.Name()] = domains | ||
} else if instanceSecretFile.Size() > 0 { | ||
instanceCredentialsMap[instanceSecretFile.Name()] = string(secretContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using Unmarshal
here as well. E.g.
var v interface{}
err := json.Unmarshal(secretContent, v)
if err != nil {..}
instanceCredentialsMap[instanceSecretFile.Name()] = v
This way, we don't have to have any knowledge about IAS' credential structure and non-string credentials (e.g. []string) are handled properly. This allows us to get rid of the domains
special case as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, i already tried it... but it fails with error "invalid character 'c' looking for beginning of value"
reason JSON without double qouted keys it's not JSON at all.
Found a tip to use yaml instead of json parser but this has issues with characters "]" or "," which are valid for secrets. So i still need a fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. This is a problem with the BTP service operator. There is no way to distinguish, whether ["asdf"]
is a string that contains special characters or a list with a single string. Let's follow SAP/sap-btp-service-operator#79 and see whether this will be improved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting that you also stumbled upon this. Could you perhaps comment in the issue so that the colleagues can see this is a problem for multiple teams? (also, fyi, this probably also affects nested objects)
Also, are you aware of this issue: SAP/sap-btp-service-operator#78
I guess you must have also noticed that the plan information is unavailable? At least with the java security libraries in version 2.10.5
the CfEnvironment
requires a plan. Passing a JSON in there without a plan causes a NPE.
Hi, sorry for commenting so late... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well done 👍🏻
|