Replace pkger with embed.FS compatibility

This commit is contained in:
Katrina Verey
2021-05-17 09:26:30 -07:00
parent 53c87a32e9
commit 3f3d3b17a4
59 changed files with 888 additions and 357 deletions

View File

@@ -0,0 +1,43 @@
// Copyright 2021 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
// Package parser contains implementations of the framework.TemplateParser and framework.SchemaParser interfaces.
// Typically, you would use these in a framework.TemplateProcessor.
//
// Example:
//
// processor := framework.TemplateProcessor{
// ResourceTemplates: []framework.ResourceTemplate{{
// Templates: parser.TemplateFiles("path/to/templates"),
// }},
// PatchTemplates: []framework.PatchTemplate{
// &framework.ResourcePatchTemplate{
// Templates: parser.TemplateFiles("path/to/patches/ingress.template.yaml"),
// },
// },
// AdditionalSchemas: parser.SchemaFiles("path/to/crd-schemas"),
// }
//
//
// All the parser in this file are compatible with embed.FS filesystems. To load from an embed.FS
// instead of local disk, use `.FromFS`. For example, if you embed filesystems as follows:
//
// //go:embed resources/* patches/*
// var templateFS embed.FS
// //go:embed schemas/*
// var schemaFS embed.FS
//
// Then you can use them like so:
//
// processor := framework.TemplateProcessor{
// ResourceTemplates: []framework.ResourceTemplate{{
// Templates: parser.TemplateFiles("resources").FromFS(templateFS),
// }},
// PatchTemplates: []framework.PatchTemplate{
// &framework.ResourcePatchTemplate{
// Templates: parser.TemplateFiles("patches/ingress.template.yaml").FromFS(templateFS),
// },
// },
// AdditionalSchemas: parser.SchemaFiles("schemas").FromFS(schemaFS),
// }
package parser