package integration_test import ( "edge-infra.dev/pkg/edge/api/graph/model" "edge-infra.dev/pkg/edge/constants/api/cluster" "edge-infra.dev/pkg/edge/constants/api/fleet" "edge-infra.dev/test/framework/integration" ) func (s *Suite) TestRegisterClusterFlow() { integration.SkipIf(s.Framework) maxNodes := 3 minNodes := 1 createSite := true var registrationResponse struct{ RegisterCluster *model.RegistrationResponse } registrationMutation := registerClusterMutation(&model.RegistrationPayload{ Name: "test-cluster-registration-flow", Fleet: fleet.Store, ClusterType: cluster.GKE, StoreInfo: &model.StoreInfo{ StoreID: &testStoreID, CreateSite: &createSite, }, BannerName: testOrg, ClusterInfo: &model.ClusterInfo{ Location: testLocation, NodeVersion: &testClusterVersion, MachineType: testClusterMachineType, NumNodes: testClusterNumNodes, Autoscale: true, MaxNodes: &maxNodes, MinNodes: &minNodes, }, }) err := ResolverClient.Post(registrationMutation, ®istrationResponse) s.NoError(err) s.NotEmpty(registrationResponse) var bootstrapResponse struct{ BootstrapCluster *model.BootstrapResponse } bootstrapMutation := bootstrapClusterMutation(&model.BootstrapPayload{ ClusterEdgeID: registrationResponse.RegisterCluster.ClusterEdgeID, }) ResolverClient.MustPost(bootstrapMutation, &bootstrapResponse) s.NotNil(bootstrapResponse.BootstrapCluster) s.NotEmpty(bootstrapResponse.BootstrapCluster.ProjectID) s.NotEmpty(bootstrapResponse.BootstrapCluster.Secrets) s.NotEmpty(bootstrapResponse.BootstrapCluster.FluxConfig) s.Equal(1, len(bootstrapResponse.BootstrapCluster.FluxConfig.FluxKustomize)) s.Equal(1, len(bootstrapResponse.BootstrapCluster.FluxConfig.FluxBucket)) }