1 // Copyright 2022 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 //go:build integration 16 // +build integration 17 18 package generated 19 20 import ( 21 "net/http" 22 "path" 23 24 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/util/repo" 25 26 "github.com/shurcooL/vfsgen" 27 ) 28 29 var ( 30 AssetsDir = http.Dir(repo.GetAutoGeneratedServiceMappingsPathOrLogFatal()) 31 Assets http.FileSystem = AssetsDir 32 outputPath = path.Join(repo.GetCallerPackagePathOrLogFatal(), "assets_vfsdata.go") 33 // the options used by vfsgen (in assets_generate.go) when generating the data for Assets that will be embedded in the binary 34 // the reason to keep the options in this file is then we have file without the build tag 'ignore' that has a dependency on 35 // vfsgen. Without this dependency, 'go mod vendor' will not import the dependency into vendor. 36 VfsgenOptions = vfsgen.Options{ 37 PackageName: "generated", 38 BuildTags: "!integration", 39 VariableName: "Assets", 40 Filename: outputPath, 41 } 42 ) 43