diff --git a/gql-queries-generator/doc/queries.graphql b/gql-queries-generator/doc/queries.graphql index 186a49004..0c3d585e7 100644 --- a/gql-queries-generator/doc/queries.graphql +++ b/gql-queries-generator/doc/queries.graphql @@ -442,7 +442,6 @@ query consoleGetCluster($name: String!) { syncScheduledAt } updateTime - clusterToken } } @@ -2491,7 +2490,6 @@ query consoleGetPvc($clusterName: String!, $name: String!) { status { accessModes allocatedResources - allocatedResourceStatuses capacity conditions { lastProbeTime @@ -2559,7 +2557,6 @@ query consoleListPvcs($clusterName: String!, $search: SearchPersistentVolumeClai status { accessModes allocatedResources - allocatedResourceStatuses capacity conditions { lastProbeTime @@ -2706,6 +2703,13 @@ query consoleGetBuildRun($repoName: String!, $buildRunName: String!) { } } +query authCheckOauthEnabled { + auth_listOAuthProviders { + enabled + provider + } +} + mutation authAddOauthCredientials($provider: String!, $state: String!, $code: String!) { oAuth_addLogin(provider: $provider, state: $state, code: $code) } diff --git a/src/apps/auth/routes/_auth._providers.tsx b/src/apps/auth/routes/_auth._providers.tsx index 5b6b10606..7c089e30c 100644 --- a/src/apps/auth/routes/_auth._providers.tsx +++ b/src/apps/auth/routes/_auth._providers.tsx @@ -20,6 +20,22 @@ const Provider = () => { }; export const restActions = async (ctx: IRemixCtx) => { + const { data: checkData, errors: checkError } = await GQLServerHandler( + ctx.request + ).checkOauthEnabled({}); + + if (checkError) { + logger.error(checkError); + } + + if (checkData.find((v) => !v.enabled)) { + return { + githubLoginUrl: '', + gitlabLoginUrl: '', + googleLoginUrl: '', + }; + } + const { data, errors } = await GQLServerHandler( ctx.request ).loginPageInitUrls(); diff --git a/src/apps/auth/server/gql/saved-queries.ts b/src/apps/auth/server/gql/saved-queries.ts index 5274140fc..644df2804 100644 --- a/src/apps/auth/server/gql/saved-queries.ts +++ b/src/apps/auth/server/gql/saved-queries.ts @@ -21,11 +21,29 @@ import { AuthVerifyEmailMutationVariables, AuthWhoAmIQuery, AuthWhoAmIQueryVariables, + AuthCheckOauthEnabledQuery, + AuthCheckOauthEnabledQueryVariables, } from '~/root/src/generated/gql/server'; export const GQLServerHandler = ({ headers, cookies }: IGQLServerProps) => { const executor = ExecuteQueryWithContext(headers, cookies); return { + checkOauthEnabled: executor( + gql` + query Auth_listOAuthProviders { + auth_listOAuthProviders { + enabled + provider + } + } + `, + { + transformer(data: AuthCheckOauthEnabledQuery) { + return data.auth_listOAuthProviders; + }, + vars(_: AuthCheckOauthEnabledQueryVariables) {}, + } + ), addOauthCredientials: executor( gql` mutation Mutation($provider: String!, $state: String!, $code: String!) { diff --git a/src/apps/console/page-components/new-cluster.tsx b/src/apps/console/page-components/new-cluster.tsx index 362e87cac..51594add2 100644 --- a/src/apps/console/page-components/new-cluster.tsx +++ b/src/apps/console/page-components/new-cluster.tsx @@ -132,6 +132,7 @@ export const NewCluster = ({ providerSecrets, cloudProvider }: props) => { aws: { region: selectedRegion.Name, k3sMasters: { + nvidiaGpuEnabled: true, instanceType: 'c6a.xlarge', }, }, diff --git a/src/apps/console/server/gql/queries/cluster-queries.ts b/src/apps/console/server/gql/queries/cluster-queries.ts index 264e369cb..b8d869d7c 100644 --- a/src/apps/console/server/gql/queries/cluster-queries.ts +++ b/src/apps/console/server/gql/queries/cluster-queries.ts @@ -278,7 +278,6 @@ export const clusterQueries = (executor: IExecutor) => ({ syncScheduledAt } updateTime - clusterToken } } `, diff --git a/src/apps/console/server/gql/queries/pvc-queries.ts b/src/apps/console/server/gql/queries/pvc-queries.ts index ec9b65d1f..a463e8a08 100644 --- a/src/apps/console/server/gql/queries/pvc-queries.ts +++ b/src/apps/console/server/gql/queries/pvc-queries.ts @@ -62,7 +62,6 @@ export const pvcQueries = (executor: IExecutor) => ({ status { accessModes allocatedResources - allocatedResourceStatuses capacity conditions { lastProbeTime @@ -143,7 +142,6 @@ export const pvcQueries = (executor: IExecutor) => ({ status { accessModes allocatedResources - allocatedResourceStatuses capacity conditions { lastProbeTime diff --git a/src/generated/codegen-sdl.yml b/src/generated/codegen-sdl.yml index a30b91f63..63558efeb 100644 --- a/src/generated/codegen-sdl.yml +++ b/src/generated/codegen-sdl.yml @@ -1,5 +1,5 @@ overwrite: true -schema: "http://gateway-api.kl-core.svc.cluster.local" +schema: "http://gateway.karthik-testing.svc.cluster.local" generates: gql/sdl.graphql: plugins: diff --git a/src/generated/codegen.yml b/src/generated/codegen.yml index 31ed68c16..77dc7fdf8 100644 --- a/src/generated/codegen.yml +++ b/src/generated/codegen.yml @@ -1,5 +1,5 @@ overwrite: true -schema: "http://gateway-api.kl-core.svc.cluster.local" +schema: "http://gateway.karthik-testing.svc.cluster.local" generates: gql/server.ts: documents: diff --git a/src/generated/gql/sdl.graphql b/src/generated/gql/sdl.graphql index 36c0a3008..0fa1935ce 100644 --- a/src/generated/gql/sdl.graphql +++ b/src/generated/gql/sdl.graphql @@ -187,7 +187,6 @@ type BuildRunPaginatedRecords { type BYOCCluster { accountName: String! apiVersion: String! - clusterToken: String! createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! @@ -271,7 +270,6 @@ type Cluster { accountName: String! adminKubeconfig: EncodedValue apiVersion: String! - clusterToken: String! createdBy: Kloudlite__io___common__CreatedOrUpdatedBy! creationTime: Date! displayName: String! @@ -281,7 +279,7 @@ type Cluster { markedForDeletion: Boolean metadata: Metadata! recordVersion: Int! - spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec + spec: Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec! status: Github__com___kloudlite___operator___pkg___operator__Status syncStatus: Kloudlite__io___pkg___types__SyncStatus! updateTime: Date! @@ -541,6 +539,7 @@ type Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersCon input Github__com___kloudlite___operator___apis___clusters___v1__AWSK3sMastersConfigIn { instanceType: String! + nvidiaGpuEnabled: Boolean! } type Github__com___kloudlite___operator___apis___clusters___v1__AWSNodePoolConfig { @@ -1467,19 +1466,19 @@ input K8s__io___api___core___v1__PersistentVolumeClaimSpecIn { type K8s__io___api___core___v1__PersistentVolumeClaimStatus { accessModes: [String!] allocatedResources: Map - allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimCondition!] phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase + resizeStatus: String } input K8s__io___api___core___v1__PersistentVolumeClaimStatusIn { accessModes: [String!] allocatedResources: Map - allocatedResourceStatuses: Map capacity: Map conditions: [K8s__io___api___core___v1__PersistentVolumeClaimConditionIn!] phase: K8s__io___api___core___v1__PersistentVolumeClaimPhase + resizeStatus: String } type K8s__io___api___core___v1__ResourceClaim { @@ -2008,7 +2007,6 @@ type Mutation { cr_triggerBuild(id: ID!): Boolean! cr_updateBuild(build: BuildIn!, id: ID!): Build cr_updateBuildCacheKey(buildCacheKey: BuildCacheKeyIn!, id: ID!): BuildCacheKey - generateClusterToken(accountName: String!, clusterName: String!): String! infra_createBYOCCluster(byocCluster: BYOCClusterIn!): BYOCCluster infra_createCluster(cluster: ClusterIn!): Cluster infra_createDomainEntry(domainEntry: DomainEntryIn!): DomainEntry diff --git a/src/generated/gql/server.ts b/src/generated/gql/server.ts index 4b710189f..8e9ffb682 100644 --- a/src/generated/gql/server.ts +++ b/src/generated/gql/server.ts @@ -713,6 +713,7 @@ export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__AwsCluste export type Github__Com___Kloudlite___Operator___Apis___Clusters___V1__Awsk3sMastersConfigIn = { instanceType: Scalars['String']['input']; + nvidiaGpuEnabled: Scalars['Boolean']['input']; }; export type Github__Com___Kloudlite___Operator___Apis___Common____Types__SecretRefIn = @@ -929,12 +930,12 @@ export type K8s__Io___Apimachinery___Pkg___Apis___Meta___V1__LabelSelectorRequir export type K8s__Io___Api___Core___V1__PersistentVolumeClaimStatusIn = { accessModes?: InputMaybe>; allocatedResources?: InputMaybe; - allocatedResourceStatuses?: InputMaybe; capacity?: InputMaybe; conditions?: InputMaybe< Array >; phase?: InputMaybe; + resizeStatus?: InputMaybe; }; export type K8s__Io___Apimachinery___Pkg___Api___Resource__Format = @@ -1280,7 +1281,7 @@ export type ConsoleListClustersQuery = { }>; message?: { RawMessage?: any }; }; - spec?: { + spec: { messageQueueTopicName: string; kloudliteRelease: string; accountId: string; @@ -1334,7 +1335,6 @@ export type ConsoleGetClusterQuery = { markedForDeletion?: boolean; recordVersion: number; updateTime: any; - clusterToken: string; createdBy: { userEmail: string; userId: string; userName: string }; lastUpdatedBy: { userEmail: string; userId: string; userName: string }; metadata: { @@ -1346,7 +1346,7 @@ export type ConsoleGetClusterQuery = { name: string; namespace?: string; }; - spec?: { + spec: { accountId: string; accountName: string; availabilityMode: Github__Com___Kloudlite___Operator___Apis___Clusters___V1__ClusterSpecAvailabilityMode; @@ -3387,7 +3387,6 @@ export type ConsoleGetPvcQuery = { status?: { accessModes?: Array; allocatedResources?: any; - allocatedResourceStatuses?: any; capacity?: any; phase?: K8s__Io___Api___Core___V1__PersistentVolumeClaimPhase; conditions?: Array<{ @@ -3456,7 +3455,6 @@ export type ConsoleListPvcsQuery = { status?: { accessModes?: Array; allocatedResources?: any; - allocatedResourceStatuses?: any; capacity?: any; phase?: K8s__Io___Api___Core___V1__PersistentVolumeClaimPhase; conditions?: Array<{ @@ -3592,6 +3590,14 @@ export type ConsoleGetBuildRunQuery = { }; }; +export type AuthCheckOauthEnabledQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type AuthCheckOauthEnabledQuery = { + auth_listOAuthProviders?: Array<{ enabled: boolean; provider: string }>; +}; + export type AuthAddOauthCredientialsMutationVariables = Exact<{ provider: Scalars['String']['input']; state: Scalars['String']['input'];