konfluxgen

package
v0.0.0-...-0ae212b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationsDirectoryName          = "applications"
	ReleasePlanAdmissionsDirectoryName = "releaseplanadmissions"
	ReleasePlansDirName                = "releaseplans"

	StageEnv = "stage"
	ProdEnv  = "prod"
)

Variables

View Source
var ApplicationTemplate embed.FS
View Source
var ComponentReleasePlanAdmissionsTemplate embed.FS
View Source
var DockerfileComponentTemplate embed.FS
View Source
var EnterpriseContractTestScenarioTemplate embed.FS
View Source
var FBCReleasePlanAdmissionsTemplate embed.FS
View Source
var ImageRepositoryTemplate embed.FS
View Source
var PipelineDockerBuildTemplate embed.FS
View Source
var PipelineDockerJavaBuildTemplate embed.FS
View Source
var PipelineFBCBuildTemplate embed.FS
View Source
var PipelineRunTemplate embed.FS
View Source
var ReleasePlanTemplate embed.FS

Functions

func Generate

func Generate(cfg Config) error

func GenerateComponentReleasePlanAdmission

func GenerateComponentReleasePlanAdmission(csv *operatorsv1alpha1.ClusterServiceVersion, bundleName string, bundleRepoName string, resourceOutputPath string, appName string) error

func GenerateComponentsReleasePlans

func GenerateComponentsReleasePlans(resourceOutputPath string, appName string, soVersion string, planNameFunc releasePlanNameFunc, rpaNameFunc releasePlanNameFunc) error

func GenerateFBCReleasePlanAdmission

func GenerateFBCReleasePlanAdmission(applications []string, resourceOutputPath string, appName string, soVersion string) error

func GenerateReleasePlans

func GenerateReleasePlans(applications []string, resourceOutputPath string, appName string, soVersion string) error

func Name

func Name(parent, suffix string) string

Name generates a name for the resource based upon the parent resource and suffix. If the concatenated name is longer than K8s permits the name is hashed and truncated to permit construction of the resource, but still keeps it unique. If the suffix itself is longer than 31 characters, then the whole string will be hashed and `parent|hash|suffix` will be returned, where parent and suffix will be trimmed to fit (prefix of parent at most of length 31, and prefix of suffix at most length 30).

func Sanitize

func Sanitize(input interface{}) string

func Truncate

func Truncate(input interface{}) string

func WriteFileReplacingNewerTaskImages

func WriteFileReplacingNewerTaskImages(name string, data []byte, perm os.FileMode) error

Types

type ComponentImageRepoRef

type ComponentImageRepoRef struct {
	ComponentName   string
	ImageRepository string
}

type ComponentReleasePlanConfig

type ComponentReleasePlanConfig struct {
	ClusterServiceVersionPath string
	BundleComponentName       string
	BundleImageRepoName       string
}

type Config

type Config struct {
	OpenShiftReleasePath string
	ApplicationName      string
	BuildArgs            []string
	ComponentNameFunc    func(cfg cioperatorapi.ReleaseBuildConfiguration, ib cioperatorapi.ProjectDirectoryImageBuildStepConfiguration) string

	Includes       []string
	Excludes       []string
	ExcludesImages []string

	FBCImages  []string
	JavaImages []string

	ResourcesOutputPathSkipRemove bool
	ResourcesOutputPath           string

	PipelinesOutputPathSkipRemove bool
	PipelinesOutputPath           string

	AdditionalTektonCELExpressionFunc func(cfg cioperatorapi.ReleaseBuildConfiguration, ib cioperatorapi.ProjectDirectoryImageBuildStepConfiguration) string
	NudgesFunc                        func(cfg cioperatorapi.ReleaseBuildConfiguration, ib cioperatorapi.ProjectDirectoryImageBuildStepConfiguration) []string

	Nudges []string

	// Preserve the version tag as first tag in any instance since SO, when bumping the patch version
	// will change it before merging the PR.
	// See `openshift-knative/serverless-operator/hack/generate/update-pipelines.sh` for more details.
	Tags []string

	PrefetchDeps PrefetchDeps

	IsHermetic func(cfg cioperatorapi.ReleaseBuildConfiguration, ib cioperatorapi.ProjectDirectoryImageBuildStepConfiguration) bool

	ComponentReleasePlanConfig *ComponentReleasePlanConfig
	AdditionalComponentConfigs []TemplateConfig
}

type DockerfileApplicationConfig

type DockerfileApplicationConfig struct {
	ApplicationName                             string
	ComponentName                               string
	ReleaseBuildConfiguration                   cioperatorapi.ReleaseBuildConfiguration
	Path                                        string
	ProjectDirectoryImageBuildStepConfiguration cioperatorapi.ProjectDirectoryImageBuildStepConfiguration
	Nudges                                      []string

	AdditionalTektonCELExpression string
	Event                         PipelineEvent
	Pipeline                      Pipeline

	Tags      []string
	BuildArgs []string

	PrefetchDeps PrefetchDeps

	Hermetic string

	DockerfilePath string
}

type IntegrationTestConfig

type IntegrationTestConfig struct {
	Name                  string
	ApplicationName       string
	ECPolicyConfiguration string
	Contexts              []IntegrationTestContext
}

type IntegrationTestContext

type IntegrationTestContext struct {
	Name        string
	Description string
}

type Pipeline

type Pipeline string
const (
	DockerBuild     Pipeline = "docker-build"
	DockerJavaBuild Pipeline = "docker-java-build"
	FBCBuild        Pipeline = "fbc-builder"
)

type PipelineEvent

type PipelineEvent string
const (
	PushEvent        PipelineEvent = "push"
	PullRequestEvent PipelineEvent = "pull_request"
)

type PrefetchDeps

type PrefetchDeps struct {
	DevPackageManagers string
	/*
		Example: '[{ "type": "rpm" }, {"type": "gomod", "path": "."}]'
	*/
	PrefetchInput string
}

func (*PrefetchDeps) WithRPMs

func (pd *PrefetchDeps) WithRPMs()

func (*PrefetchDeps) WithUnvendoredGo

func (pd *PrefetchDeps) WithUnvendoredGo(path string)

type ReleasePlan

type ReleasePlan struct {
	Name                     string
	ApplicationName          string
	AutoRelease              string
	ReleasePlanAdmissionName string
	SOVersion                string
}

type TemplateConfig

type TemplateConfig struct {
	cioperatorapi.ReleaseBuildConfiguration
	Path string
}

func (TemplateConfig) IsContained

func (c TemplateConfig) IsContained(configs []TemplateConfig) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL