-
Notifications
You must be signed in to change notification settings - Fork 228
Split packages so we can extract gitops-toolkit
#347
Conversation
gitops-toolkit
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.
Looks great, just some nits.
pkg/serializer/serializer.go
Outdated
func (s *serializer) encode(obj runtime.Object, mediaType string, pretty bool) ([]byte, error) { | ||
info, ok := runtime.SerializerInfoForMediaType(s.codecs.SupportedMediaTypes(), mediaType) | ||
if !ok { | ||
return nil, fmt.Errorf("unable to locate encoder -- %q is not a supported media type", mediaType) |
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.
Replace "--" with ": " for consistency
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.
This was not new code; just the same as before.
// decodable using the given serializer. However, all changes in the manifest directory, are also propagated to | ||
// the structured data directory that's backed by the default storage implementation. Writes to this storage are | ||
// propagated to both the manifest directory, and the data directory. | ||
func NewTwoWayManifestStorage(manifestDir, dataDir string, ser serializer.Serializer) (*ManifestStorage, 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.
TwoWay
might be a bit confusing as this doesn't propagate data directory changes to the manifest directory (like the name implies). Is DataManifestStorage
better?
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.
It does propagate all the manifest that it knows about from before, so I think this is ok for now at least. We can talk about naming later.
@@ -42,8 +40,12 @@ func NewGenericWatchStorage(s storage.Storage) (WatchStorage, error) { | |||
return nil, err | |||
} | |||
|
|||
// TODO: Fix this | |||
gvs := s.Serializer().Scheme().PreferredVersionAllGroups() | |||
groupName := gvs[0].Group |
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.
OK for now
Merging to get going with the gitops-toolkit extraction |
No description provided.