github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/storage/v1alpha1/init.go (about) 1 // Code generated by pulumigen DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package v1alpha1 5 6 import ( 7 "fmt" 8 9 "github.com/blang/semver" 10 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 type module struct { 15 version semver.Version 16 } 17 18 func (m *module) Version() semver.Version { 19 return m.version 20 } 21 22 func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { 23 switch typ { 24 case "kubernetes:storage.k8s.io/v1alpha1:VolumeAttachment": 25 r = &VolumeAttachment{} 26 case "kubernetes:storage.k8s.io/v1alpha1:VolumeAttachmentList": 27 r = &VolumeAttachmentList{} 28 case "kubernetes:storage.k8s.io/v1alpha1:VolumeAttachmentPatch": 29 r = &VolumeAttachmentPatch{} 30 default: 31 return nil, fmt.Errorf("unknown resource type: %s", typ) 32 } 33 34 err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) 35 return 36 } 37 38 func init() { 39 version, err := kubernetes.PkgVersion() 40 if err != nil { 41 version = semver.Version{Major: 1} 42 } 43 pulumi.RegisterResourceModule( 44 "kubernetes", 45 "storage.k8s.io/v1alpha1", 46 &module{version}, 47 ) 48 }