-
Notifications
You must be signed in to change notification settings - Fork 23
New CR types, controllers and webhooks #23
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
Conversation
Signed-off-by: Kim Tsao <[email protected]>
Signed-off-by: Kim Tsao <[email protected]>
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kim-tsao The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Kim Tsao <[email protected]>
Signed-off-by: Kim Tsao <[email protected]>
Signed-off-by: Kim Tsao <[email protected]>
/retest |
Signed-off-by: Kim Tsao <[email protected]>
Signed-off-by: Kim Tsao <[email protected]>
Signed-off-by: Kim Tsao <[email protected]>
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.
Two small-ish suggestions, otherwise I have no concerns. Some good changes in here 👍
```go | ||
... | ||
|
||
//create a lookup key with the name and namespace of the CR |
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.
Might be useful to show how to get the resource when not running within a controller.
E.g. like what we do in the tests for getting instances of the devfileregistries
CR:
registry-operator/tests/integration/pkg/client/registry.go
Lines 27 to 48 in 2e32d81
func (w *K8sClient) GetRegistryInstance(name string) (*registryv1alpha1.DevfileRegistry, error) { | |
data, err := w.kubeClient.RESTClient(). | |
Get(). | |
AbsPath("/apis/registry.devfile.io/v1alpha1"). | |
Namespace(config.Namespace). | |
Resource("devfileregistries"). | |
Name(name). | |
DoRaw(context.TODO()) | |
if err != nil { | |
return nil, err | |
} | |
// Unmarshall the struct | |
registry := ®istryv1alpha1.DevfileRegistry{} | |
err = yaml.Unmarshal(data, registry) | |
if err != nil { | |
return nil, err | |
} | |
return registry, nil | |
} |
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.
@johnmcollier Does it make sense to keep the existing example too?
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.
Can’t hurt?
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.
Updated README with new example
Signed-off-by: Kim Tsao <[email protected]>
Fixes issue : devfile/api#499