Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGMT-15963: Bump assisted-installer, assisted-installer-agent, assisted-service to latest versions #7

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Dockerfile.assisted-swarm-build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/openshift/release:golang-1.17
FROM registry.ci.openshift.org/openshift/release:golang-1.21
ENV GO111MODULE=on
ENV GOFLAGS=""

Expand Down
5 changes: 5 additions & 0 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class ClusterAgentConfig:
identifier: str
machine_hostname: str
machine_ip: str
machine_ipv6: str
cluster_identifier: str
cluster_dir: Path
cluster_hosts: List[dict]
Expand Down Expand Up @@ -260,6 +261,8 @@ def run_agent(self, next_state):
cluster_hosts_file.write(json.dumps(self.cluster_agent_config.cluster_hosts))
cluster_hosts_file_path = cluster_hosts_file.name

self.logging.info(f"swarm_agent_config.agent_image_path: {self.swarm_agent_config.agent_image_path}")

new_agent_params = assisted_swarm.NewAgentParams(
service_url=self.service_url,
infra_env_id=self.infraenv_id,
Expand All @@ -275,9 +278,11 @@ def run_agent(self, next_state):
# The installer needs to know all the hostnames in the cluster
dry_cluster_hosts_path=cluster_hosts_file_path,
dry_forced_host_ipv4=self.cluster_agent_config.machine_ip,
dry_forced_host_ipv6=self.cluster_agent_config.machine_ipv6
)

response = self.swarm_agent_config.swarm_client.create_new_agent(new_agent_params=new_agent_params)
self.logging.info(f"response: {response}")
try:
return next_state if self.wait_for_completion(response.id) else self.state
finally:
Expand Down
28 changes: 27 additions & 1 deletion assisted_swarm_client/assisted_swarm/models/new_agent_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class NewAgentParams(object):
'containers_storage_conf': 'str',
'dry_forced_host_id': 'str',
'dry_forced_host_ipv4': 'str',
'dry_forced_host_ipv6': 'str',
'dry_forced_mac_address': 'str',
'dry_forced_hostname': 'str',
'dry_fake_reboot_marker_path': 'str',
Expand All @@ -56,13 +57,14 @@ class NewAgentParams(object):
'containers_storage_conf': 'containers_storage_conf',
'dry_forced_host_id': 'dry_forced_host_id',
'dry_forced_host_ipv4': 'dry_forced_host_ipv4',
'dry_forced_host_ipv6': 'dry_forced_host_ipv6',
'dry_forced_mac_address': 'dry_forced_mac_address',
'dry_forced_hostname': 'dry_forced_hostname',
'dry_fake_reboot_marker_path': 'dry_fake_reboot_marker_path',
'dry_cluster_hosts_path': 'dry_cluster_hosts_path'
}

def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cacert=None, pull_secret=None, containers_conf=None, containers_storage_conf=None, dry_forced_host_id=None, dry_forced_host_ipv4=None, dry_forced_mac_address=None, dry_forced_hostname=None, dry_fake_reboot_marker_path=None, dry_cluster_hosts_path=None): # noqa: E501
def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cacert=None, pull_secret=None, containers_conf=None, containers_storage_conf=None, dry_forced_host_id=None, dry_forced_host_ipv4=None, dry_forced_host_ipv6=None, dry_forced_mac_address=None, dry_forced_hostname=None, dry_fake_reboot_marker_path=None, dry_cluster_hosts_path=None): # noqa: E501
"""NewAgentParams - a model defined in Swagger""" # noqa: E501

self._service_url = None
Expand All @@ -74,6 +76,7 @@ def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cace
self._containers_storage_conf = None
self._dry_forced_host_id = None
self._dry_forced_host_ipv4 = None
self._dry_forced_host_ipv6 = None
self._dry_forced_mac_address = None
self._dry_forced_hostname = None
self._dry_fake_reboot_marker_path = None
Expand All @@ -98,6 +101,8 @@ def __init__(self, service_url=None, infra_env_id=None, agent_version=None, cace
self.dry_forced_host_id = dry_forced_host_id
if dry_forced_host_ipv4 is not None:
self.dry_forced_host_ipv4 = dry_forced_host_ipv4
if dry_forced_host_ipv6 is not None:
self.dry_forced_host_ipv6 = dry_forced_host_ipv6
if dry_forced_mac_address is not None:
self.dry_forced_mac_address = dry_forced_mac_address
if dry_forced_hostname is not None:
Expand Down Expand Up @@ -296,6 +301,27 @@ def dry_forced_host_ipv4(self, dry_forced_host_ipv4):

self._dry_forced_host_ipv4 = dry_forced_host_ipv4

@property
def dry_forced_host_ipv6(self):
"""Gets the dry_forced_host_ipv6 of this NewAgentParams. # noqa: E501


:return: The dry_forced_host_ipv6 of this NewAgentParams. # noqa: E501
:rtype: str
"""
return self._dry_forced_host_ipv6

@dry_forced_host_ipv6.setter
def dry_forced_host_ipv6(self, dry_forced_host_ipv6):
"""Sets the dry_forced_host_ipv6 of this NewAgentParams.


:param dry_forced_host_ipv6: The dry_forced_host_ipv6 of this NewAgentParams. # noqa: E501
:type: str
"""

self._dry_forced_host_ipv6 = dry_forced_host_ipv6

@property
def dry_forced_mac_address(self):
"""Gets the dry_forced_mac_address of this NewAgentParams. # noqa: E501
Expand Down
1 change: 1 addition & 0 deletions assisted_swarm_client/docs/NewAgentParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Name | Type | Description | Notes
**containers_storage_conf** | **str** | | [optional]
**dry_forced_host_id** | **str** | | [optional]
**dry_forced_host_ipv4** | **str** | | [optional]
**dry_forced_host_ipv6** | **str** | | [optional]
**dry_forced_mac_address** | **str** | | [optional]
**dry_forced_hostname** | **str** | | [optional]
**dry_fake_reboot_marker_path** | **str** | | [optional]
Expand Down
6 changes: 6 additions & 0 deletions cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def agent_ip(self, agent_index):
ip_index = agent_index + 1
return f"10.123.{ip_index >> 8}.{ip_index & 0xff}/16"

def agent_ipv6(self, agent_index):
ip_index = agent_index + 1
return "2620:52:0:1b2:faf2:1eff:feb2:{:04x}/64".format(ip_index)

def hostname(self, agent_index):
return f"{self.identifier}-{agent_index}"

Expand All @@ -118,6 +122,7 @@ def cluster_hosts(self):
{
"hostname": self.hostname(agent_index),
"ip": self.agent_ip(agent_index),
"ipv6": self.agent_ipv6(agent_index),
"rebootMarkerPath": str(self.dry_reboot_marker(agent_index)),
}
for agent_index in range(self.total_agents)
Expand Down Expand Up @@ -228,6 +233,7 @@ def launch_agents(self, next_state):
index=agent_index,
mac_address=self.make_mac(self.cluster_config.index, agent_index),
machine_ip=self.agent_ip(agent_index),
machine_ipv6=self.agent_ipv6(agent_index),
machine_hostname=self.hostname(agent_index),
cluster_identifier=self.identifier,
cluster_dir=self.cluster_dir,
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
)

func main() {
util.SetLogging("combined-agent", false, true, MainDummyHostID)
util.SetLogging("combined-agent", false, true, false, MainDummyHostID)
failOnError := func(err error, msg string, args ...interface{}) {
if err != nil {
logrus.WithError(err).Fatalf(msg, args...)
Expand Down
Loading