-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add support for DevWorkspaces with parents #346
Conversation
Make the utility functions used for resolving plugins by ID, URI, or Kubernetes reference not depend on the PluginComponent type and instead take the relevant information directly. This is required to allow reusing these functions for resolving Devfile parents Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Add support for resolving devfile parents in same way we resolve plugins (supporting id, URI, and kubernetes reference) Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
If attempting to unmarshal a network response to a devfile results in a struct without a schemaVersion, attempt to unmarshal to a DevWorkspace or DevWorkspaceTemplate instead. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Rename plugin-related struct fields in tests to be generic, to allow them to hold any resources referenced. Required for reusing these structs cleanly in parent tests. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Make flatten library work without an HTTP or Kubernetes client to allow supporting only kubernetes or http references. If attempting to flatten a devfile that contains an import that doesn't have the required client, return a descriptive error. Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Adds test cases to cover: - Using resolver when HttpClient or K8sClient are nil - Resolving Kubernetes resources when no namespace can be determined - Resolving resources by ID when no registryURL can be determined Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Add attribute 'controller.devfile.io/imported-by: parent' to Components, Commands, Projects, and StarterProjects imported via a parent in the original devfile, to help track where resources in the resolved Devfile came from Signed-off-by: Angel Misevski <amisevsk@redhat.com> fixup annotate parent
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
aae5e13
to
c80e5eb
Compare
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
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
I looked through the PR diff and only managed to find end-find empty lines )
I did not tested but we have pretty good unit testing )
pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_id.yaml
Outdated
Show resolved
Hide resolved
pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_uri.yaml
Outdated
Show resolved
Hide resolved
pkg/library/flatten/testdata/general/fail-nicely-when-no-k8s-client-provided.yaml
Outdated
Show resolved
Hide resolved
pkg/library/flatten/testdata/general/fail-nicely-when-no-namespace.yaml
Outdated
Show resolved
Hide resolved
pkg/library/flatten/testdata/general/fail-nicely-when-no-registry-url.yaml
Outdated
Show resolved
Hide resolved
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, other than Serhii's comments
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amisevsk, JPinkney, sleshchenko 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 |
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
New changes are detected. LGTM label has been removed. |
/test v5-devworkspaces-operator-e2e |
/retest |
🙄 even writing instructions in my commit message was not enough to get me to remember: 173f242. Sorry all, I should've thought before merging. |
@amisevsk Why you just don't use |
Today I learned... |
What does this PR do?
This PR is a copy of devfile/library#74. It adds support for parents in DevWorkspaces (since most of the functionality was already there, and a majority of the work was renaming things to make sense). It also allows plugins/parents specified by URI to point at devfiles, devworkspaces, or devworkspacetemplates, and processes each accordingly.
What issues does this PR fix or reference?
No issue, but the work was done for #334
Is it tested? How?
I haven't prepared a test that uses parents, but regular functionality we currently use should still be supported.