Last active
July 25, 2021 08:25
-
-
Save aaronjwood/cccef38490e14e5eadfa8ed1c769c851 to your computer and use it in GitHub Desktop.
Stitching it together
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func DiscoverParseApply(ctx context.Context, client kubernetes.Interface, dynamicClient dynamic.Interface, manifest string) error { | |
groupResources, err := restmapper.GetAPIGroupResources(client.Discovery()) | |
if err != nil { | |
return err | |
} | |
var resources []*Resource | |
docs := ParseDocuments(manifest) | |
for _, doc := range docs { | |
resource, err := ParseSearchConstruct(groupResources, dynamicClient, doc) | |
if err != nil { | |
return err | |
} | |
resources = append(resources, resource) | |
} | |
return Apply(ctx, resources...) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment