Skip to content

Commit

Permalink
[OSPK8-437] Move provisioningAgent into common agent
Browse files Browse the repository at this point in the history
We now have a common "agent" container image which can
be used for multiple commands. This patch moves
the provisioning-server-ip-discovery container
command into the common agent image. It also
renames the parameter to reference the more
generic agentImageUrl.

The goal is to decrease the number of container image deliverables
we need to maintain.
  • Loading branch information
dprince committed Feb 1, 2022
1 parent 93d6acf commit e950471
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 186 deletions.
59 changes: 0 additions & 59 deletions Dockerfile.provision-ip-discovery-agent

This file was deleted.

2 changes: 1 addition & 1 deletion api/v1beta1/openstackprovisionserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type OpenStackProvisionServerSpec struct {
// Container image URL for the main container that serves the downloaded RHEL qcow2 image (baseImageUrl)
ApacheImageURL string `json:"apacheImageUrl,omitempty"`
// Container image URL for the sidecar container that discovers provisioning network IPs
ProvisioningAgentImageURL string `json:"provisioningAgentImageUrl,omitempty"`
AgentImageURL string `json:"agentImageUrl,omitempty"`
}

// OpenStackProvisionServerStatus defines the observed state of OpenStackProvisionServer
Expand Down
10 changes: 5 additions & 5 deletions api/v1beta1/openstackprovisionserver_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import (

// OpenStackProvisionServerDefaults -
type OpenStackProvisionServerDefaults struct {
DownloaderImageURL string
ProvisioningAgentImageURL string
ApacheImageURL string
DownloaderImageURL string
AgentImageURL string
ApacheImageURL string
}

var openstackProvisionServerDefaults OpenStackProvisionServerDefaults
Expand Down Expand Up @@ -109,8 +109,8 @@ func (r *OpenStackProvisionServer) Default() {
if r.Spec.DownloaderImageURL == "" {
r.Spec.DownloaderImageURL = openstackProvisionServerDefaults.DownloaderImageURL
}
if r.Spec.ProvisioningAgentImageURL == "" {
r.Spec.ProvisioningAgentImageURL = openstackProvisionServerDefaults.ProvisioningAgentImageURL
if r.Spec.AgentImageURL == "" {
r.Spec.AgentImageURL = openstackProvisionServerDefaults.AgentImageURL
}
if r.Spec.ApacheImageURL == "" {
r.Spec.ApacheImageURL = openstackProvisionServerDefaults.ApacheImageURL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2465,6 +2465,11 @@ spec:
description: OpenStackProvisionServerSpec defines the
desired state of OpenStackProvisionServer
properties:
agentImageUrl:
description: Container image URL for the sidecar
container that discovers provisioning network
IPs
type: string
apacheImageUrl:
description: Container image URL for the main container
that serves the downloaded RHEL qcow2 image (baseImageUrl)
Expand All @@ -2486,11 +2491,6 @@ spec:
description: The port on which the Apache server
should listen
type: integer
provisioningAgentImageUrl:
description: Container image URL for the sidecar
container that discovers provisioning network
IPs
type: string
required:
- baseImageUrl
- port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ spec:
description: OpenStackProvisionServerSpec defines the desired state of
OpenStackProvisionServer
properties:
agentImageUrl:
description: Container image URL for the sidecar container that discovers
provisioning network IPs
type: string
apacheImageUrl:
description: Container image URL for the main container that serves
the downloaded RHEL qcow2 image (baseImageUrl)
Expand All @@ -68,10 +72,6 @@ spec:
port:
description: The port on which the Apache server should listen
type: integer
provisioningAgentImageUrl:
description: Container image URL for the sidecar container that discovers
provisioning network IPs
type: string
required:
- baseImageUrl
- port
Expand Down
2 changes: 0 additions & 2 deletions config/default/manager_default_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ spec:
value: registry.redhat.io/rhosp-rhel8/openstack-rabbitmq:16.2
- name: DOWNLOADER_IMAGE_URL_DEFAULT
value: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-downloader:1.0
- name: PROVISIONING_AGENT_IMAGE_URL_DEFAULT
value: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-provisioner:1.0
- name: AGENT_IMAGE_URL_DEFAULT
value: quay.io/openstack-k8s-operators/osp-director-operator-agent:0.0.1
- name: APACHE_IMAGE_URL_DEFAULT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

var (
startCmd = &cobra.Command{
Use: "start",
Short: "Starts Machine Config Daemon",
Use: "provision-ip-discovery",
Short: "Start Provision IP Discovery Agent",
Long: "",
Run: runStartCmd,
}
Expand Down

This file was deleted.

30 changes: 0 additions & 30 deletions containers/provision_ip_discovery_agent/main.go

This file was deleted.

35 changes: 0 additions & 35 deletions containers/provision_ip_discovery_agent/version.go

This file was deleted.

5 changes: 2 additions & 3 deletions controllers/openstackprovisionserver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,8 @@ func (r *OpenStackProvisionServerReconciler) deploymentCreateOrUpdate(instance *
},
{
Name: "osp-provision-ip-discovery-agent",
Args: []string{"start"},
Command: []string{"provision-ip-discovery-agent"},
Image: instance.Spec.ProvisioningAgentImageURL,
Command: []string{"/osp-director-operator-agent", "provision-ip-discovery"},
Image: instance.Spec.AgentImageURL,
ImagePullPolicy: corev1.PullAlways,
Env: []corev1.EnvVar{
{
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ func main() {
}

provisionServerDefaults := ospdirectorv1beta1.OpenStackProvisionServerDefaults{
DownloaderImageURL: os.Getenv("DOWNLOADER_IMAGE_URL_DEFAULT"),
ProvisioningAgentImageURL: os.Getenv("PROVISIONING_AGENT_IMAGE_URL_DEFAULT"),
ApacheImageURL: os.Getenv("APACHE_IMAGE_URL_DEFAULT"),
DownloaderImageURL: os.Getenv("DOWNLOADER_IMAGE_URL_DEFAULT"),
AgentImageURL: os.Getenv("AGENT_IMAGE_URL_DEFAULT"),
ApacheImageURL: os.Getenv("APACHE_IMAGE_URL_DEFAULT"),
}
openstackDeployDefaults := ospdirectorv1beta1.OpenStackDeployDefaults{
AgentImageURL: os.Getenv("AGENT_IMAGE_URL_DEFAULT"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
baseImageUrl: http://192.168.111.1/images/rhel-guest-image-8.4-992.x86_64.qcow2
downloaderImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-downloader@sha256:dadca151e8712eef8b206b69722c558b2aac035a4a3c52e705bf69c26d649567
port: 6190
provisioningAgentImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-provisioner@sha256:77eab3a61ef569236a17575d5e4f1318d2ac13f164af8a2c94b732a4c50af579
agentImageUrl: quay.io/openstack-k8s-operators/osp-director-operator-agent:0.0.1
status:
conditions:
- message: ProvisionServer compute-provisionserver has been provisioned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
baseImageUrl: http://192.168.111.1/images/rhel-guest-image-8.4-992.x86_64.qcow2
downloaderImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-downloader@sha256:dadca151e8712eef8b206b69722c558b2aac035a4a3c52e705bf69c26d649567
port: 8080
provisioningAgentImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-provisioner@sha256:77eab3a61ef569236a17575d5e4f1318d2ac13f164af8a2c94b732a4c50af579
agentImageUrl: quay.io/openstack-k8s-operators/osp-director-operator-agent:0.0.1
status:
conditions:
- message: ProvisionServer openstack has been provisioned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
baseImageUrl: http://192.168.111.1/images/rhel-guest-image-8.4-992.x86_64.qcow2
downloaderImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-downloader@sha256:dadca151e8712eef8b206b69722c558b2aac035a4a3c52e705bf69c26d649567
port: 8081
provisioningAgentImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-provisioner@sha256:77eab3a61ef569236a17575d5e4f1318d2ac13f164af8a2c94b732a4c50af579
agentImageUrl: quay.io/openstack-k8s-operators/osp-director-operator-agent:0.0.1
status:
conditions:
- message: ProvisionServer goodprov has been provisioned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
baseImageUrl: http://192.168.111.1/images/rhel-guest-image-8.4-992.x86_64.qcow2
downloaderImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-downloader@sha256:dadca151e8712eef8b206b69722c558b2aac035a4a3c52e705bf69c26d649567
port: 6190
provisioningAgentImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-provisioner@sha256:77eab3a61ef569236a17575d5e4f1318d2ac13f164af8a2c94b732a4c50af579
agentImageUrl: quay.io/openstack-k8s-operators/osp-director-operator-agent:0.0.1
status:
conditions:
- message: ProvisionServer compute-provisionserver has been provisioned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
baseImageUrl: http://192.168.111.1/images/rhel-guest-image-8.4-992.x86_64.qcow2
downloaderImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-downloader@sha256:dadca151e8712eef8b206b69722c558b2aac035a4a3c52e705bf69c26d649567
port: 6191
provisioningAgentImageUrl: registry.redhat.io/rhosp-rhel8-tech-preview/osp-director-provisioner@sha256:77eab3a61ef569236a17575d5e4f1318d2ac13f164af8a2c94b732a4c50af579
agentImageUrl: quay.io/openstack-k8s-operators/osp-director-operator-agent:0.0.1
status:
conditions:
- message: ProvisionServer compute2-provisionserver has been provisioned
Expand Down

0 comments on commit e950471

Please sign in to comment.