99 "text/template"
1010
1111 mcfgv1 "github.com/openshift/api/machineconfiguration/v1"
12- mcfgv1alpha1 "github.com/openshift/api/machineconfiguration/v1alpha1"
1312 mcfgclientset "github.com/openshift/client-go/machineconfiguration/clientset/versioned"
1413 "github.com/openshift/machine-config-operator/pkg/controller/build/constants"
1514 "github.com/openshift/machine-config-operator/pkg/controller/build/utils"
@@ -45,7 +44,7 @@ type buildRequestImpl struct {
4544}
4645
4746// Constructs an imageBuildRequest from the Kube API server.
48- func NewBuildRequestFromAPI (ctx context.Context , kubeclient clientset.Interface , mcfgclient mcfgclientset.Interface , mosb * mcfgv1alpha1 .MachineOSBuild , mosc * mcfgv1alpha1 .MachineOSConfig ) (BuildRequest , error ) {
47+ func NewBuildRequestFromAPI (ctx context.Context , kubeclient clientset.Interface , mcfgclient mcfgclientset.Interface , mosb * mcfgv1 .MachineOSBuild , mosc * mcfgv1 .MachineOSConfig ) (BuildRequest , error ) {
4948 opts , err := newBuildRequestOptsFromAPI (ctx , kubeclient , mcfgclient , mosb , mosc )
5049 if err != nil {
5150 return nil , err
@@ -61,8 +60,8 @@ func newBuildRequest(opts BuildRequestOpts) BuildRequest {
6160 }
6261
6362 // only support noArch for now
64- for _ , file := range opts .MachineOSConfig .Spec .BuildInputs . Containerfile {
65- if file .ContainerfileArch == mcfgv1alpha1 .NoArch {
63+ for _ , file := range opts .MachineOSConfig .Spec .Containerfile {
64+ if file .ContainerfileArch == mcfgv1 .NoArch {
6665 br .userContainerfile = file .Content
6766 break
6867 }
@@ -226,20 +225,14 @@ func (br buildRequestImpl) renderContainerfile() (string, error) {
226225 // default to a value from a different location, it makes more sense for us
227226 // to implement that logic in Go as opposed to the Go template language.
228227 items := struct {
229- MachineOSBuild * mcfgv1alpha1 .MachineOSBuild
230- MachineOSConfig * mcfgv1alpha1 .MachineOSConfig
228+ MachineOSBuild * mcfgv1 .MachineOSBuild
229+ MachineOSConfig * mcfgv1 .MachineOSConfig
231230 UserContainerfile string
232- ReleaseVersion string
233- BaseOSImage string
234- ExtensionsImage string
235231 ExtensionsPackages []string
236232 }{
237233 MachineOSBuild : br .opts .MachineOSBuild ,
238234 MachineOSConfig : br .opts .MachineOSConfig ,
239235 UserContainerfile : br .userContainerfile ,
240- ReleaseVersion : br .opts .getReleaseVersion (),
241- BaseOSImage : br .opts .getBaseOSImagePullspec (),
242- ExtensionsImage : br .opts .getExtensionsImagePullspec (),
243236 ExtensionsPackages : extPkgs ,
244237 }
245238
@@ -315,7 +308,7 @@ func (br buildRequestImpl) toBuildahPod() *corev1.Pod {
315308 },
316309 {
317310 Name : "TAG" ,
318- Value : br .opts .MachineOSBuild .Spec .RenderedImagePushspec ,
311+ Value : string ( br .opts .MachineOSBuild .Spec .RenderedImagePushSpec ) ,
319312 },
320313 {
321314 Name : "BASE_IMAGE_PULL_CREDS" ,
@@ -525,7 +518,7 @@ func (br buildRequestImpl) toBuildahPod() *corev1.Pod {
525518 // us to avoid parsing log files.
526519 Name : "wait-for-done" ,
527520 Command : append (command , waitScript ),
528- Image : br .opts .getBaseOSImagePullspec (),
521+ Image : br .opts .getBaseOSImagePullspec (), // QOCL: What do we replace this with?
529522 Env : env ,
530523 ImagePullPolicy : corev1 .PullAlways ,
531524 SecurityContext : securityContext ,
@@ -543,7 +536,7 @@ func (br buildRequestImpl) getLabelsForObjectMeta() map[string]string {
543536 return map [string ]string {
544537 constants .EphemeralBuildObjectLabelKey : "" ,
545538 constants .OnClusterLayeringLabelKey : "" ,
546- constants .RenderedMachineConfigLabelKey : br .opts .MachineOSBuild .Spec .DesiredConfig .Name ,
539+ constants .RenderedMachineConfigLabelKey : br .opts .MachineOSBuild .Spec .MachineConfig .Name ,
547540 constants .TargetMachineConfigPoolLabelKey : br .opts .MachineOSConfig .Spec .MachineConfigPool .Name ,
548541 constants .MachineOSConfigNameLabelKey : br .opts .MachineOSConfig .Name ,
549542 constants .MachineOSBuildNameLabelKey : br .opts .MachineOSBuild .Name ,
0 commit comments