@@ -69,11 +69,8 @@ import (
6969 imageapi "github.com/openshift/api/image/v1"
7070 projectapi "github.com/openshift/api/project/v1"
7171 routev1 "github.com/openshift/api/route/v1"
72- templateapi "github.com/openshift/api/template/v1"
7372 buildclientset "github.com/openshift/client-go/build/clientset/versioned/typed/build/v1"
7473 projectclientset "github.com/openshift/client-go/project/clientset/versioned"
75- templatescheme "github.com/openshift/client-go/template/clientset/versioned/scheme"
76- templateclientset "github.com/openshift/client-go/template/clientset/versioned/typed/template/v1"
7774 hivev1 "github.com/openshift/hive/apis/hive/v1"
7875
7976 "github.com/openshift/ci-tools/pkg/api"
@@ -119,56 +116,12 @@ a consistent name for the target namespace that will change if any of the inputs
119116This allows multiple test jobs to share common artifacts and still perform retries.
120117
121118The standard build steps are designed for simple command-line actions (like invoking
122- "make test") but can be extended by passing one or more templates via the --template flag.
123- The name of the template defines the stage and the template must contain at least one
124- pod. The parameters passed to the template are the current process environment and a set
125- of dynamic parameters that are inferred from previous steps. These parameters are:
119+ "make test").
126120
127- NAMESPACE
128- The namespace generated by the operator for the given inputs or the value of
129- --namespace.
130-
131- IMAGE_FORMAT
132- A string that points to the public image repository URL of the image stream(s)
133- created by the tag step. Example:
134-
135- registry.svc.ci.openshift.org/ci-op-9o8bacu/stable:${component}
136-
137- Will cause the template to depend on all image builds.
138-
139- IMAGE_<component>
140- The public image repository URL for an output image. If specified the template
141- will depend on the image being built.
142-
143- LOCAL_IMAGE_<component>
144- The public image repository URL for an image that was built during this run but
145- was not part of the output (such as pipeline cache images). If specified the
146- template will depend on the image being built.
147-
148- JOB_NAME
149- The job name from the JOB_SPEC
150-
151- JOB_NAME_SAFE
152- The job name in a form safe for use as a Kubernetes resource name.
153-
154- JOB_NAME_HASH
155- A short hash of the job name for making tasks unique. This will not account for the target-additional-suffix.
156-
157- UNIQUE_HASH
158- A hash for making tasks unique, even when the job name may be the same due to using the target-additional-suffix.
159-
160- RPM_REPO_<org>_<repo>
161- If the job creates RPMs this will be the public URL that can be used as the
162- baseurl= value of an RPM repository. The value of org and repo are uppercased
163- and dashes are replaced with underscores.
164-
165- Dynamic environment variables are overridden by process environment variables.
166-
167- Both test and template jobs can gather artifacts created by pods. Set
168- --artifact-dir to define the top level artifact directory, and any test task
169- that defines artifact_dir or template that has an "artifacts" volume mounted
170- into a container will have artifacts extracted after the container has completed.
171- Errors in artifact extraction will not cause build failures.
121+ Artifacts can be gathered from test pods. Set --artifact-dir to define the top level
122+ artifact directory, and any test task that defines artifact_dir will have artifacts
123+ extracted after the container has completed. Errors in artifact extraction will not
124+ cause build failures.
172125
173126In CI environments the inputs to a job may be different than what a normal
174127development workflow would use. The --override file will override fields
@@ -366,7 +319,6 @@ func (s *stringSlice) Set(value string) error {
366319type options struct {
367320 configSpecPath string
368321 unresolvedConfigPath string
369- templatePaths stringSlice
370322 secretDirectories stringSlice
371323 sshKeyPath string
372324 oauthTokenPath string
@@ -392,7 +344,6 @@ type options struct {
392344
393345 inputHash string
394346 secrets []* coreapi.Secret
395- templates []* templateapi.Template
396347 graphConfig api.GraphConfiguration
397348 configSpec * api.ReleaseBuildConfiguration
398349 jobSpec * api.JobSpec
@@ -480,7 +431,6 @@ func bindOptions(flag *flag.FlagSet) *options {
480431 flag .BoolVar (& opt .printGraph , "print-graph" , opt .printGraph , "Print a directed graph of the build steps and exit. Intended for use with the golang digraph utility." )
481432
482433 // add to the graph of things we run or create
483- flag .Var (& opt .templatePaths , "template" , "A set of paths to optional templates to add as stages to this job. Each template is expected to contain at least one restart=Never pod. Parameters are filled from environment or from the automatic parameters generated by the operator." )
484434 flag .Var (& opt .secretDirectories , "secret-dir" , "One or more directories that should converted into secrets in the test namespace. If the directory contains a single file with name .dockercfg or config.json it becomes a pull secret." )
485435 flag .StringVar (& opt .sshKeyPath , "ssh-key-path" , "" , "A path of the private ssh key that is going to be used to clone a private repository." )
486436 flag .StringVar (& opt .oauthTokenPath , "oauth-token-path" , "" , "A path of the OAuth token that is going to be used to clone a private repository." )
@@ -683,26 +633,6 @@ func (o *options) Complete() error {
683633
684634 o .getClusterProfileNamesFromTargets ()
685635
686- for _ , path := range o .templatePaths .values {
687- contents , err := os .ReadFile (path )
688- if err != nil {
689- return fmt .Errorf ("could not read dir %s for template: %w" , path , err )
690- }
691- obj , gvk , err := templatescheme .Codecs .UniversalDeserializer ().Decode (contents , nil , nil )
692- if err != nil {
693- return fmt .Errorf ("unable to parse template %s: %w" , path , err )
694- }
695- template , ok := obj .(* templateapi.Template )
696- if ! ok {
697- return fmt .Errorf ("%s is not a template: %v" , path , gvk )
698- }
699- if len (template .Name ) == 0 {
700- template .Name = filepath .Base (path )
701- template .Name = strings .TrimSuffix (template .Name , filepath .Ext (template .Name ))
702- }
703- o .templates = append (o .templates , template )
704- }
705-
706636 clusterConfig , err := util .LoadClusterConfig ()
707637 if err != nil {
708638 return fmt .Errorf ("failed to load cluster config: %w" , err )
@@ -761,7 +691,6 @@ func (o *options) ToGraphConfig() *defaults.Config {
761691 CIConfig : o .configSpec ,
762692 GraphConf : & o .graphConfig ,
763693 JobSpec : o .jobSpec ,
764- Templates : o .templates ,
765694 ParamFile : o .writeParams ,
766695 Promote : o .promote ,
767696 ClusterConfig : o .clusterConfig ,
@@ -1997,13 +1926,6 @@ func (o *options) saveNamespaceArtifacts() {
19971926 _ = api .SaveArtifact (o .censor , path , data )
19981927 }
19991928
2000- if templateClient , err := templateclientset .NewForConfig (o .clusterConfig ); err == nil {
2001- templateInstances , _ := templateClient .TemplateInstances (o .namespace ).List (context .TODO (), metav1.ListOptions {})
2002- data , _ := json .MarshalIndent (templateInstances , "" , " " )
2003- path := filepath .Join (namespaceDir , "templateinstances.json" )
2004- _ = api .SaveArtifact (o .censor , path , data )
2005- }
2006-
20071929 o .metricsAgent .Record (metrics .NewInsightsEvent (metrics .InsightNamespaceArtifacts , metrics.Context {"namespace" : o .namespace }))
20081930}
20091931
@@ -2240,7 +2162,7 @@ func eventRecorder(kubeClient *coreclientset.CoreV1Client, authClient *authclien
22402162 eventBroadcaster .StartRecordingToSink (& coreclientset.EventSinkImpl {
22412163 Interface : coreclientset .New (kubeClient .RESTClient ()).Events ("" )})
22422164 return eventBroadcaster .NewRecorder (
2243- templatescheme .Scheme , coreapi.EventSource {Component : namespace }), nil
2165+ scheme .Scheme , coreapi.EventSource {Component : namespace }), nil
22442166}
22452167
22462168func getCloneSecretFromPath (cloneAuthType steps.CloneAuthType , secretPath string ) (* coreapi.Secret , error ) {
@@ -2538,9 +2460,6 @@ func addSchemes() error {
25382460 if err := buildv1 .AddToScheme (scheme .Scheme ); err != nil {
25392461 return fmt .Errorf ("failed to add buildv1 to scheme: %w" , err )
25402462 }
2541- if err := templateapi .AddToScheme (scheme .Scheme ); err != nil {
2542- return fmt .Errorf ("failed to add templatev1 to scheme: %w" , err )
2543- }
25442463 if err := hivev1 .AddToScheme (scheme .Scheme ); err != nil {
25452464 return fmt .Errorf ("failed to add hivev1 to scheme: %w" , err )
25462465 }
0 commit comments