enable fleet cluster deployment (#356)

* added fleet exception to rollout cmd

* removed fleet check for rollout

* modified casing

* modified approach for fleet check

* tidying up

* defaulting to Microsoft.ContainerService/managedClusters

* ran prettier command

* modified manifest stablity check

* ran prettier check

* moved lowercase check to beginning

---------

Co-authored-by: audrastump <stumpaudra@microsoft.com>
This commit is contained in:
Audra Stump
2024-12-06 11:32:48 -08:00
committed by GitHub
parent bf768b3109
commit d1acc1a47b
5 changed files with 57 additions and 5 deletions
@@ -0,0 +1,27 @@
import * as manifestStabilityUtils from './manifestStabilityUtils'
import {Kubectl} from '../types/kubectl'
describe('manifestStabilityUtils', () => {
const kc = new Kubectl('')
const resources = [
{
type: 'deployment',
name: 'test',
namespace: 'default'
}
]
const resourceType = 'microsoft.containerservice/fleets'
it('should return immediately if the resource type is microsoft.containerservice/fleets', async () => {
const spy = jest.spyOn(manifestStabilityUtils, 'checkManifestStability')
const checkRolloutStatusSpy = jest.spyOn(kc, 'checkRolloutStatus')
await manifestStabilityUtils.checkManifestStability(
kc,
resources,
resourceType
)
expect(checkRolloutStatusSpy).not.toHaveBeenCalled()
expect(spy).toHaveReturned()
})
})
+9 -1
View File
@@ -9,8 +9,16 @@ const POD = 'pod'
export async function checkManifestStability(
kubectl: Kubectl,
resources: Resource[]
resources: Resource[],
resourceType: string
): Promise<void> {
// Skip if resource type is microsoft.containerservice/fleets
if (resourceType === 'microsoft.containerservice/fleets') {
core.info(
'Skipping checkManifestStability for microsoft.containerservice/fleets'
)
return
}
let rolloutStatusHasErrors = false
for (let i = 0; i < resources.length; i++) {
const resource = resources[i]