Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRDKustomizeFile ¶
type CRDKustomizeFile struct { Resources []string `yaml:"resources"` // File paths to resource CRDs Patches []string `yaml:"patches"` // File paths to patch files used to enable conversions Configurations []string `yaml:"configurations"` // File paths to configuration files }
CRDKustomizeFile captures the structure of the kustomization.yaml file we want to write All file paths specified as relative paths from the location of kustomize.yaml
The final file output looks like this:
resources: - bases/microsoft.authorization.azure.com_roleassignments.yaml - bases/microsoft.batch.azure.com_batchaccounts.yaml ... patches: - patches/webhook-conversion-microsoft.authorization.azure.com_roleassignments.yaml - patches/webhook-conversion-microsoft.batch.azure.com_batchaccounts.yaml ...
func NewCRDKustomizeFile ¶
func NewCRDKustomizeFile() *CRDKustomizeFile
NewCRDKustomizeFile creates a new CRDKustomizeFile ready to populate
func (*CRDKustomizeFile) AddConfiguration ¶
func (k *CRDKustomizeFile) AddConfiguration(configFilePath string)
func (*CRDKustomizeFile) AddPatch ¶
func (k *CRDKustomizeFile) AddPatch(patchFilePath string)
AddPatch adds a filepath specifying another CRD patch to include
func (*CRDKustomizeFile) AddResource ¶
func (k *CRDKustomizeFile) AddResource(resourceFilePath string)
AddResource adds a filepath specifying another CRD definition to include
func (*CRDKustomizeFile) Save ¶
func (k *CRDKustomizeFile) Save(destination string) error
Save writes the kustomize configuration to the specified file path
type ConversionPatchFile ¶
type ConversionPatchFile struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata conversionPatchMetadata `yaml:"metadata"` Spec conversionPatchSpec `yaml:"spec"` }
ConversionPatchFile specifies a fragment of YAML we create to configure storage conversions via Kustomize
The final file looks like this:
apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata:
name: roleassignments.microsoft.authorization.azure.com annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
spec:
preserveUnknownFields: false conversion: strategy: Webhook webhook: conversionReviewVersions: - v1 clientConfig: service: namespace: system name: webhook-service path: /convert
func NewConversionPatchFile ¶
func NewConversionPatchFile(resourceName string) *ConversionPatchFile
func (*ConversionPatchFile) Save ¶
func (p *ConversionPatchFile) Save(destination string) error
Save writes the patch to the specified file path
type ResourceDefinition ¶
type ResourceDefinition struct {
Metadata ResourceDefinitionMetadata `yaml:"metadata"`
}
func LoadResourceDefinition ¶
func LoadResourceDefinition(filePath string) (*ResourceDefinition, error)
func (*ResourceDefinition) Name ¶
func (d *ResourceDefinition) Name() string
type ResourceDefinitionMetadata ¶
type ResourceDefinitionMetadata struct {
Name string `yaml:"name"`
}