Skip to content

Commit

Permalink
Use go:embed for static yaml files
Browse files Browse the repository at this point in the history
Move from bindata to go:embed.
  • Loading branch information
jsafrane committed Jun 29, 2021
1 parent 4bd4a56 commit 818bea0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1,251 deletions.
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ IMAGE_REGISTRY?=registry.svc.ci.openshift.org
# It will generate target "image-$(1)" for building the image and binding it as a prerequisite to target "images".
$(call build-image,csi-driver-manila-operator,$(IMAGE_REGISTRY)/ocp/4.6:csi-driver-manila-operator,./build/Dockerfile.openshift,.)

# generate bindata targets
# $0 - macro name
# $1 - target suffix
# $2 - input dirs
# $3 - prefix
# $4 - pkg
# $5 - output
$(call add-bindata,generated,./assets/...,assets,generated,pkg/generated/bindata.go)

clean:
$(RM) manila-csi-driver-operator
.PHONY: clean
Expand Down
13 changes: 13 additions & 0 deletions assets/assets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package assets

import (
"embed"
)

//go:embed *.yaml rbac/*.yaml
var f embed.FS

// ReadFile reads and returns the content of the named file.
func ReadFile(name string) ([]byte, error) {
return f.ReadFile(name)
}

0 comments on commit 818bea0

Please sign in to comment.