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

Remove imageName from deployparameters #157

Merged
merged 1 commit into from
Mar 12, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aosm/azext_aosm/build_processors/vhd_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def generate_parameters_file(self) -> LocalFileBuilder:
else:
params = '{}'
logger.info(
"Created parameters file for Nexus image."
"Created parameters file for VHD image."
)
return LocalFileBuilder(
Path(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _get_processor_list(self) -> List[AzureCoreArmBuildProcessor | VHDProcessor]
arm_input = ArmTemplateInput(
artifact_name=arm_template.artifact_name,
artifact_version=arm_template.version,
default_config=None,
default_config={"imageName": self.config.nf_name + "Image"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if default_config is passed in and gives imageName a different value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can't, we were previously passing no default config. But in this specific case of azure core vnfs, we are now giving imageName. This doesnt come from anywhere else except us giving it here

template_path=Path(arm_template.file_path).absolute(),
)
processor_list.append(
Expand Down Expand Up @@ -146,6 +146,9 @@ def _get_default_config(self, vhd) -> Dict[str, Any]:
default_config.update({"image_hyper_v_generation": "V1"})
if vhd.image_api_version:
default_config.update({"image_api_version": vhd.image_api_version})

# Add imageName
default_config["imageName"] = self.config.nf_name + 'Image'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have this and (basically) the same code on line 75?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One is for the vhd and one is for the arm template

return default_config

def _generate_type_specific_nf_application(self, processor) -> Tuple[List, List]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ class OnboardingCoreVNFInputConfig(OnboardingNFDBaseInputConfig):
)
},
)
image_name_parameter: str = field(
default="",
metadata={
"comment": (
"The parameter name in the VM ARM template which "
"specifies the name of the image to use for the VM."
)
},
)

arm_templates: List[ArmTemplatePropertiesConfig] = field(
default_factory=lambda: [ArmTemplatePropertiesConfig()],
Expand Down Expand Up @@ -160,8 +151,6 @@ def sa_manifest_name(self) -> str:
def validate(self):
"""Validate the configuration."""
super().validate()
if not self.image_name_parameter:
raise ValidationError("image_name_parameter must be set")
if not self.arm_templates:
raise ValidationError("arm_template must be set")
if not self.vhd:
Expand All @@ -177,16 +166,6 @@ def validate(self):
class OnboardingNexusVNFInputConfig(OnboardingNFDBaseInputConfig):
"""Input configuration for onboarding VNFs."""

image_name_parameter: str = field(
default="",
metadata={
"comment": (
"The parameter name in the VM ARM template which "
"specifies the name of the image to use for the VM."
)
},
)

arm_templates: List[ArmTemplatePropertiesConfig] = field(
default_factory=lambda: [ArmTemplatePropertiesConfig()],
metadata={
Expand Down Expand Up @@ -226,8 +205,6 @@ def sa_manifest_name(self) -> str:
def validate(self):
"""Validate the configuration."""
super().validate()
if not self.image_name_parameter:
raise ValidationError("image_name_parameter must be set")
if not self.arm_templates:
raise ValidationError("arm_template must be set")
if not self.images:
Expand Down
Loading