mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-30 00:51:14 +08:00
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:
+11
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user