Documentation ¶
Index ¶
- Constants
- func GetMutatingWebhookName(crdSingular, crdGroup string) string
- func GetValidatingWebhookName(crdSingular, crdGroup string) string
- type Resource
- func (rn *Resource) BuildVolume(certificate bool) corev1.Volume
- func (rn *Resource) BuildVolumeMount(certificate bool) corev1.VolumeMount
- func (rn *Resource) GetCertificateAnnotation() map[string]string
- func (rn *Resource) GetCertificateName() string
- func (rn *Resource) GetDnsName(x ...string) string
- func (rn *Resource) GetFileName(kind string, suffixes ...string) string
- func (rn *Resource) GetK8sLabels() map[string]string
- func (rn *Resource) GetLabelKey() string
- func (rn *Resource) GetMutatingWebhookName() string
- func (rn *Resource) GetNameSpace() string
- func (rn *Resource) GetPackagePodName() string
- func (rn *Resource) GetRelativeFilePath(kind string, suffixes ...string) string
- func (rn *Resource) GetResourceName() string
- func (rn *Resource) GetRoleBindingName() string
- func (rn *Resource) GetRoleName() string
- func (rn *Resource) GetServiceAccountName() string
- func (rn *Resource) GetServiceName() string
- func (rn *Resource) GetValidatingWebhookName() string
- func (rn *Resource) RenderCertificate(cfg, obj interface{}) (*yaml.RNode, error)
- func (rn *Resource) RenderClusterRole(rules []rbacv1.PolicyRule, obj interface{}, roleName string) (*yaml.RNode, error)
- func (rn *Resource) RenderClusterRoleBinding() (*yaml.RNode, error)
- func (rn *Resource) RenderDeployment(fc *kptgenv1alpha1.PodSpec) (*yaml.RNode, error)
- func (rn *Resource) RenderMutatingWebhook(cfg, obj interface{}) (*yaml.RNode, error)
- func (rn *Resource) RenderNamespace() (*yaml.RNode, error)
- func (rn *Resource) RenderProviderStatefulSet(fc *kptgenv1alpha1.PodSpec) (*yaml.RNode, error)
- func (rn *Resource) RenderRole(rules []rbacv1.PolicyRule, obj interface{}, roleName string) (*yaml.RNode, error)
- func (rn *Resource) RenderRoleBinding() (*yaml.RNode, error)
- func (rn *Resource) RenderService(cfg, obj interface{}) (*yaml.RNode, error)
- func (rn *Resource) RenderServiceAccount(fc *kptgenv1alpha1.PodSpec) (*yaml.RNode, error)
- func (rn *Resource) RenderValidatingWebhook(cfg, obj interface{}) (*yaml.RNode, error)
- func (rn *Resource) UpdateDeployment(fnCfgName string, fnCfg kptgenv1alpha1.Config, node *yaml.RNode) (*yaml.RNode, error)
- func (rn *Resource) UpdateStatefulSet(fnCfgName string, fnCfg kptgenv1alpha1.Config, node *yaml.RNode) (*yaml.RNode, error)
- type ResourceNameKind
Constants ¶
View Source
const ( ControllerDir = "controller" WebhookDir = "webhook" NamespaceDir = "namespace" RBACDir = "rbac" ControllerSuffix = "controller" PodSuffix = "pod" NamespaceSuffix = "namespace" BindingSuffix = "binding" RoleSuffix = "role" RoleBindingSuffix = "role-binding" WebhookSuffix = "webhook" ServiceSuffix = "svc" CertSuffix = "serving-cert" CertPathSuffix = "serving-certs" CertInjectionKey = "cert-manager.io/inject-ca-from" )
View Source
const ( MutatingWebhookConfigurationKind = "MutatingWebhookConfiguration" ValidatingWebhookConfigurationKind = "ValidatingWebhookConfiguration" )
View Source
const (
ClusterRoleBindingKind = "ClusterRoleBinding"
)
View Source
const (
ClusterRoleKind = "ClusterRole"
)
View Source
const (
DeploymentKind = "Deployment"
)
View Source
const (
NamespaceKind = "Namespace"
)
View Source
const (
RoleBindingKind = "RoleBinding"
)
View Source
const (
RoleKind = "Role"
)
View Source
const (
ServiceAccountKind = "ServiceAccount"
)
View Source
const (
ServiceKind = "Service"
)
View Source
const (
StatefullSetKind = "StatefulSet"
)
Variables ¶
This section is empty.
Functions ¶
func GetMutatingWebhookName ¶
Types ¶
type Resource ¶
type Resource struct { //Prefix string Kind string ResourceNameKind ResourceNameKind // used to define the name of the //PathNameKind NameKind // used to define the name of the path in the package PackageName string // name of the package/provider name PodName string // name of the deployment/statefulset Name string // name of the resource Namespace string TargetDir string SubDir string }
func (*Resource) BuildVolume ¶ added in v0.0.4
func (*Resource) BuildVolumeMount ¶ added in v0.0.4
func (rn *Resource) BuildVolumeMount(certificate bool) corev1.VolumeMount
func (*Resource) GetCertificateAnnotation ¶
func (*Resource) GetCertificateName ¶
func (*Resource) GetDnsName ¶
func (*Resource) GetFileName ¶
func (*Resource) GetK8sLabels ¶ added in v0.0.9
func (*Resource) GetLabelKey ¶
func (*Resource) GetMutatingWebhookName ¶
func (*Resource) GetNameSpace ¶
func (*Resource) GetPackagePodName ¶ added in v0.0.4
func (*Resource) GetRelativeFilePath ¶ added in v0.0.4
func (*Resource) GetResourceName ¶
func (*Resource) GetRoleBindingName ¶
func (*Resource) GetRoleName ¶
func (*Resource) GetServiceAccountName ¶ added in v0.0.4
func (rn *Resource) GetFilePath(kind string, suffixes ...string) string { //fmt.Println("GetFilePath", rn.Kind, kptgenv1alpha1.FnConfigKind, rn.PackageName, rn.PodName, rn.Name) if rn.Kind == kptgenv1alpha1.FnConfigKind { return filepath.Join(rn.TargetDir, rn.PodName, rn.SubDir, strcase.KebabCase(rn.GetFileName(kind, suffixes...))+".yaml") } return filepath.Join(rn.TargetDir, rn.SubDir, strcase.KebabCase(rn.GetFileName(kind, suffixes...))+".yaml") }
func (*Resource) GetServiceName ¶
func (*Resource) GetValidatingWebhookName ¶
func (*Resource) RenderCertificate ¶
func (*Resource) RenderClusterRole ¶
func (*Resource) RenderClusterRoleBinding ¶
func (*Resource) RenderDeployment ¶
func (*Resource) RenderMutatingWebhook ¶
crdObjects fn.KubeObjects
func (*Resource) RenderNamespace ¶ added in v0.0.4
func (*Resource) RenderProviderStatefulSet ¶
func (*Resource) RenderRole ¶
func (*Resource) RenderService ¶
func (*Resource) RenderServiceAccount ¶
func (*Resource) RenderValidatingWebhook ¶
func (*Resource) UpdateDeployment ¶ added in v0.0.4
type ResourceNameKind ¶ added in v0.0.4
type ResourceNameKind string
const ( NameKindFull ResourceNameKind = "packagePodResource" NameKindPackageResource ResourceNameKind = "packageResource" NameKindPackagePod ResourceNameKind = "packagePod" NameKindResource ResourceNameKind = "resource" NameKindKindResource ResourceNameKind = "kindResource" NameKindKind ResourceNameKind = "kind" )
Click to show internal directories.
Click to hide internal directories.