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
Workload resource mapping #1086
Workload resource mapping #1086
Conversation
Skipping CI for Draft Pull Request. |
2a673a5
to
ce9e9bf
Compare
Codecov Report
@@ Coverage Diff @@
## master #1086 +/- ##
==========================================
- Coverage 58.92% 57.50% -1.43%
==========================================
Files 30 31 +1
Lines 1670 2673 +1003
==========================================
+ Hits 984 1537 +553
- Misses 560 974 +414
- Partials 126 162 +36
Continue to review full report at Codecov.
|
0cdacdc
to
2bbf251
Compare
2bbf251
to
ea2ef16
Compare
This is probably good enough to review, at least from a high level. There are still some parts that might change: some acceptance tests are failing, and I know I need to add some more unit tests to make code coverage happy. However, I doubt the design is going to change all that much from these fixes, and most of this should be in good-enough shape to review. |
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.
Changes to the userguide should be also a part of this PR.
Side note: I somehow expected less changes on pkg/reconcile/pipeline/handler/project/impl.go
_, err = client. | ||
Resource(v1alpha3.WorkloadResourceMappingGroupVersionResource). | ||
Get(c.Background(), serviceGVK.GroupKind().String(), metav1.GetOptions{}) | ||
Expect(err).To(Equal(errors.NewNotFound(v1alpha3.WorkloadResourceMappingGroupVersionResource.GroupResource(), serviceGVK.GroupKind().String())), "Binding should occur without a workload resource mapping") |
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.
why do we need this assertion in the integration scenario?
@@ -425,9 +445,31 @@ func (i *impl) Close() error { | |||
} | |||
for _, app := range i.applications { | |||
if app.IsUpdated() { | |||
_, err = i.client.Resource(*app.gvr).Namespace(i.bindingMeta.Namespace).Update(context.Background(), app.Resource(), metav1.UpdateOptions{}) |
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.
why we needed to replace this line?
fefec0d
to
0322a92
Compare
0322a92
to
1e55fd7
Compare
1e55fd7
to
3caa5df
Compare
3caa5df
to
6895640
Compare
4ab5023
to
2311f33
Compare
ee81c5f
to
f241192
Compare
/retest |
I think tests in spec API are enough. |
/retest |
d628f53
to
3a2b276
Compare
/retest |
2 similar comments
/retest |
/retest |
3a2b276
to
28dcc77
Compare
/retest |
1 similar comment
/retest |
28dcc77
to
f98a9bc
Compare
Implement support for ClusterWorkloadResourceMapping resources and most of their required semantics as dictated by the specification. The following are not implemented, and will be submitted in later patches: - validation on resource creation/modification - correct unbind behavior when the mapping changes - necessary documentation Signed-off-by: Andy Sadler <ansadler@redhat.com>
f98a9bc
to
c6b8005
Compare
/retest |
2 similar comments
/retest |
/retest |
@sadlerap: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
/lgtm |
This PR looks good to merge, any improvements we will like to see, lets add a Jira story under epic https://issues.redhat.com/browse/APPSVC-1082, any regression we notice lets add a jira bug. |
Implement support for ClusterWorkloadResourceMapping resources and most of their required semantics as dictated by the specification. The following are not implemented, and will be submitted in later patches: - validation on resource creation/modification - correct unbind behavior when the mapping changes - necessary documentation Signed-off-by: Andy Sadler <ansadler@redhat.com>
Motivation
We need to be able to be informed where container data lives within a workload resource. This introduces support for workload resource mapping, which is how the specification API defines how we can be informed of this data.
Changes
A lot of the functionality of
pipeline.Application
has been changed to meet this need. To facilitate the requirement to look up data almost arbitrarily within an workload resource, we need to store and carry around the data to look up where our workload's data lives.Testing
Unit tests should largely pass (with one exception, see below). The infrastructure for acceptance tests is largely there, but we're still a little short on the actual tests. I'll be working to have some more before this gets merged.
Other notes
[]map[string]interface
); I haven't quite figured out why this is happing nor how to fix it.bindingPath
entry within a service binding; this is probably a more robust solution (current spec issues aside).