-
Notifications
You must be signed in to change notification settings - Fork 10
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 modulectl create command #49
feat: Implement the modulectl create command #49
Conversation
c309470
to
75ece5b
Compare
75ece5b
to
c2482f3
Compare
c2482f3
to
edfaf2b
Compare
…y exists in the moduleconfig file)
434354f
to
334b96b
Compare
6b1d2c2
to
ed4cefb
Compare
ed4cefb
to
ff3fa58
Compare
/cla |
Successfully reached out to cla-assistant.io to initialize recheck of PR #49 |
3487d22
to
a541a62
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.
Pls ignore comments for now. Just for myself as reminders so far.
return resources, nil | ||
} | ||
|
||
func CreateCredMatchLabels(registryCredSelector string) ([]byte, error) { |
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.
Have we considered making it a private func and test it from the same package?
for { | ||
var res Resource | ||
err := decoder.Decode(&res) | ||
if err != nil { | ||
if err.Error() == "EOF" { | ||
break | ||
} | ||
return "", fmt.Errorf("failed to parse YAML document: %w", err) | ||
} | ||
|
||
if res.Kind == "CustomResourceDefinition" && res.Spec.Group == group && res.Spec.Names.Kind == kind { | ||
return res.Spec.Scope, 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.
I don't understand this for loop. Does decoder.Decode actually change res
?
@@ -1,20 +1,206 @@ | |||
package create | |||
|
|||
type ModuleConfigService interface{} |
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 are we only at 27% coverage?
if s.latestCommit != "" { | ||
return s.latestCommit, 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.
Just for my understanding, what is the reason for "caching" the latest commit? Also considering the other GetRemoteFitFileContent
method where we pass it as argument and not reading it from the property?
return defaultCRPath, nil | ||
} | ||
|
||
path := defaultCRPath |
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.
I think it would be clearer if path is only declared within the if blocks, and at line 199 we return defaultCRPath given that none of the if branches executed.
…g file
Description
Changes proposed in this pull request:
Related issue(s)
#28