Skip to content
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

feat: implement the setting up of the scheme with managed contents #1

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

OchiengEd
Copy link
Collaborator

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Signed-off-by: Edmund Ochieng <ochienged@gmail.com>
// ApiVersion and Kind set. Failure to which the code will panic when adding the types to the scheme
scheme := runtime.NewScheme()
for _, obj := range objs {
gvk := obj.GetObjectKind().GetVersionKind()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref: https://pkg.go.dev/k8s.io/apimachinery/pkg/runtime/schema#ObjectKind

Suggested change
gvk := obj.GetObjectKind().GetVersionKind()
gvk := obj.GetObjectKind().GroupVersionKind()

Applies to all other places the same error is popping up

// if we continue to create a new cache every time, we should ensure that we are appropriately stopping
// the cache and configured sources _before_ replacing it in the mapping.
i.extensionCaches[ce.Name] = c
i.extensionCaches[ce.Name] = extensionsCacheData{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
i.extensionCaches[ce.Name] = extensionsCacheData{
i.extensionCaches[ce.Name] = extensionCacheData{

panic("Not implemented!")
if data, ok := i.extensionCaches[ce.GetName()]; ok {
data.Cancel()
delete(i.extensionCaches, ce.GetName)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
delete(i.extensionCaches, ce.GetName)
delete(i.extensionCaches, ce.GetName())

return &instance{
rcm: rcm,
baseCfg: cfg,
extensionCaches: make(map[string]cache.Cache),
scheme: scheme,
extensionCaches: make(map[string]extensionCacheData{}),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
extensionCaches: make(map[string]extensionCacheData{}),
extensionCaches: make(map[string]extensionCacheData),

Signed-off-by: Edmund Ochieng <ochienged@gmail.com>
@everettraven
Copy link
Owner

Going to ignore the lint failure for now. Will make sure this is addressed before creating a PR against the main repo

@everettraven everettraven merged commit 90e32b2 into feature/managed-content-cache Jul 1, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants