v5.0.1 Release with Fleet Types (#358)

* extract resource type

* fleet details

* new release with fleet

* format

* type params

* format

* promote input

* format

* fleet type

* format pls
This commit is contained in:
David Gamero
2024-12-09 17:14:44 -05:00
committed by GitHub
parent d1acc1a47b
commit 3d107b044d
7 changed files with 74 additions and 18 deletions
+11 -4
View File
@@ -38,6 +38,7 @@ import {
TrafficSplitMethod
} from '../types/trafficSplitMethod'
import {parseRouteStrategy, RouteStrategy} from '../types/routeStrategy'
import {ResourceTypeFleet, ResourceTypeManagedCluster} from './deploy'
export async function promote(
kubectl: Kubectl,
@@ -166,10 +167,8 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
// checking stability of newly created deployments
core.startGroup('Checking manifest stability')
const resourceType = (
core.getInput('resource-type') ||
'Microsoft.ContainerService/managedClusters'
).toLowerCase()
const resourceType =
core.getInput('resource-type') || ResourceTypeManagedCluster
const deployedManifestFiles = deployResult.manifestFiles
const resources: Resource[] = getResources(
deployedManifestFiles,
@@ -177,6 +176,14 @@ async function promoteBlueGreen(kubectl: Kubectl, manifests: string[]) {
models.DiscoveryAndLoadBalancerResource.SERVICE
])
)
if (
resourceType !== ResourceTypeManagedCluster &&
resourceType !== ResourceTypeFleet
) {
const errMsg = `Invalid resource type: ${resourceType}. Supported resource types are: ${ResourceTypeManagedCluster} (default), fleet`
core.setFailed(errMsg)
throw new Error(errMsg)
}
await KubernetesManifestUtility.checkManifestStability(
kubectl,
resources,