-
Notifications
You must be signed in to change notification settings - Fork 140
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
Read env variables from KfDef Parameters #180
Read env variables from KfDef Parameters #180
Conversation
01652f2
to
6d02fc9
Compare
/cc |
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.
It works fine if I define the parameters as following:
parameters:
- name: minimal-image
value: $MINIMAL_IMAGE
Or
parameters:
- name: minimal-image
value: quay.io/modh/odh-minimal-notebook-container:v1.18.0-2
However when using ${VAR} it doesn't work:
parameters:
- name: minimal-image
value: ${MINIMAL_IMAGE}
I see the following error in the operator logs:
time="2022-10-19T11:28:35Z" level=warning msg="Encountered error applying application notebook-images: (kubeflow.error): Code 500 with message: Apply.Run : ImageStream.image.openshift.io \"s2i-minimal-notebook\" is invalid: [[]: Internal error: imagestreams \"s2i-minimal-notebook\" is invalid: spec.tags[v0.3.0-py38].from.name: Invalid value: \"\": must be of the form <tag>, <repo>:<tag>, <id>, or <repo>@<id>, spec.tags[v0.3.0-py38].from.name: Required value]"
time="2022-10-19T11:28:35Z" level=warning msg="Will retry in 4 seconds."
I'm missing some unit tests to cover the getParameterValue
function.
I think I misread the supported formats. Updating the regex. |
@VaishnaviHire keep in mind when the value is specified like the following:
In the kfdef object, it will be changed like the following
I am not sure your code will be impacted by this or not but I just want you to head up this kind openshift manifest behavior. |
6d02fc9
to
e9439bc
Compare
Thanks ! This should not impact the code. |
@samuelvl Addressed the comments and updated the operator image To run unit tests, use the following command
|
pkg/kfapp/kustomize/kustomize.go
Outdated
}else { | ||
return value | ||
} |
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.
It works great now! Only one question, is this return value
really needed?
}else { | |
return value | |
} | |
} |
Running the coverage of this function I found that if I remove it we can achieve 100%
# With return value
$ go test -run TestGetParameterValue -v -covermode=count -coverprofile coverage ./pkg/kfapp/kustomize/...
$ go tool cover -func=coverage
github.com/kubeflow/kfctl/v3/pkg/kfapp/kustomize/kustomize.go:1467: getParameterValue 90.9%
# After applying the suggestion
$ go test -run TestGetParameterValue -v -covermode=count -coverprofile coverage ./pkg/kfapp/kustomize/...
$ go tool cover -func=coverage
github.com/kubeflow/kfctl/v3/pkg/kfapp/kustomize/kustomize.go:1467: getParameterValue 100.0%
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.
It's no longer required. Removed it. Thanks !
e9439bc
to
e4e1cb9
Compare
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.
/lgtm
/lgtm |
@LaVLaS Could you approve this PR? :) |
@LaVLaS Did you get a chance to review this ? I think this can be merged for 1.4.1 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LaVLaS, samuelvl The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fix(prometheus): mapping for trustyai and rhods operator
Fixes #179
How Has This Been Tested?
Merge criteria: