forked from opserver/Opserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into wdekort/setupcnabv2
- Loading branch information
Showing
13 changed files
with
97 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
function Find-DeploymentGroup([string]$filter) { | ||
Write-MinorStep "Finding GCP deployment group (project) using filter: $filter" | ||
$projects = (gcloud projects list --filter=$filter --format=json | ConvertFrom-Json) | ||
if ($null -eq $projects -Or $projects.Count -eq 0) { | ||
Write-MinorStep "No projects found" | ||
exit 1 | ||
} | ||
elseif ($projects.Count -gt 1) { | ||
Write-MinorStep "$project_count projects found, cannot continue" | ||
exit 1 | ||
} | ||
$project = $projects[0].projectId | ||
Write-MinorStep "Project: $project" | ||
return $project | ||
} | ||
|
||
function Find-DeploymentTarget([string]$filter, [string]$deploymentGroup) { | ||
Write-MinorStep "Finding GCP deployment target (cluster) using filter: $filter and deployment group (project): $deploymentGroup" | ||
|
||
$clusters = (gcloud container clusters list --filter=$filter --project=$deploymentGroup --format=json | ConvertFrom-Json) | ||
$cluster_count = $clusters.Count | ||
if ($cluster_count -eq 0) { | ||
Write-MinorStep "No clusters found" | ||
exit 1 | ||
} | ||
elseif ($cluster_count -gt 1) { | ||
Write-MinorStep "$cluster_count clusters found, cannot continue" | ||
exit 1 | ||
} | ||
$firstCluster = $clusters[0] | ||
$target = new-object psobject -property @{ | ||
Name = $firstCluster.name | ||
Location = $firstCluster.location | ||
} | ||
Write-MinorStep "DeploymentTarget: $($target | ConvertTo-Json)" | ||
|
||
return $target | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<Project Sdk="Microsoft.Build.NoTargets/3.2.14"> | ||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters