private Task <FileInfo?> InternalUpdateApplicationImageTag( RawDeploymentManifest manifest, DeploymentManifestInfo deploymentManifestInfo, ApplicationImage applicationImage, string instance, string targetTag ) { var yamlUtilities = new YamlUtilities(); var key = new DeploymentManifestInstanceKey(applicationImage, instance); string currentImageTag = deploymentManifestInfo.ManifestTags.GetValueOrDefault(key) ?? "n/a"; if (!deploymentManifestInfo.ApplicationImageToFileMapping.TryGetValue(key, out FileInfo? file)) { // TODO: warn that we have an image tag update but no corresponding file // _log.LogWarning("Update to {Repository} cannot be applied since there isn't matching file."); throw new InvalidOperationException("Update cannot be applied since there isn't matching file."); } _log.LogTrace("Upgrading {Repository} to {NewTag} from {Tag}", applicationImage.Repository, targetTag, currentImageTag ); return(yamlUtilities.UpdateValueInYamlFile(file, applicationImage.TagProperty.Path, targetTag) ? Task.FromResult((FileInfo?)file) : Task.FromResult((FileInfo?)null)); }
public KubernetesManifestInfo() { // Create deployment and service by default Deployment = new DeploymentManifestInfo(); Service = new ServiceManifestInfo(); }