Skip to content

Commit 43205dc

Browse files
authored
Add generic provider (#828)
Signed-off-by: David van der Spek <[email protected]>
1 parent 6154990 commit 43205dc

File tree

10 files changed

+35
-4
lines changed

10 files changed

+35
-4
lines changed

apps/core/lib/core/schema/dependencies.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Core.Schema.Dependencies do
22
use Piazza.Ecto.Schema
33

4-
defenum Provider, gcp: 0, aws: 1, azure: 2, equinix: 3, kind: 4
4+
defenum Provider, gcp: 0, aws: 1, azure: 2, equinix: 3, kind: 4, generic: 5
55

66
defmodule Dependency do
77
use Piazza.Ecto.Schema

apps/core/lib/core/schema/provider_scaffold.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defmodule Core.Schema.ProviderScaffold do
22
defstruct [:name, :content]
3-
@providers ~w(aws gcp azure equinix kind)a
3+
@providers ~w(aws gcp azure equinix kind generic)a
44

55
def available(), do: @providers
66

apps/core/lib/core/schema/recipe.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Core.Schema.Recipe do
22
use Piazza.Ecto.Schema
33
alias Core.Schema.{Repository, RecipeSection, RecipeDependency, RecipeTest}
44

5-
defenum Provider, gcp: 0, aws: 1, azure: 2, custom: 3, kubernetes: 4, equinix: 5, kind: 6
5+
defenum Provider, gcp: 0, aws: 1, azure: 2, custom: 3, kubernetes: 4, equinix: 5, kind: 6, generic: 7
66

77
defmodule OIDCSettings do
88
use Piazza.Ecto.Schema
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
terraform {
2+
backend "local" {
3+
path = "../../{{ .Values.Bucket }}/{{ .Values.__CLUSTER__ }}/{{ .Values.Prefix }}/terraform.tfstate"
4+
}
5+
6+
required_providers {
7+
kubernetes = {
8+
source = "hashicorp/kubernetes"
9+
version = "~> 2.16.1"
10+
}
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
terraform {
2+
backend "local" {
3+
path = "../../{{ .Values.Bucket }}/{{ .Values.__CLUSTER__ }}/{{ .Values.Prefix }}/terraform.tfstate"
4+
}
5+
6+
required_providers {
7+
kubernetes = {
8+
source = "hashicorp/kubernetes"
9+
version = "~> 2.16.1"
10+
}
11+
}
12+
}

rel/config/config.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ provider = case get_env("PROVIDER") || "google" do
9797
"azure" -> :azure
9898
"equinix" -> :equinix
9999
"kind" -> :kind
100+
"generic" -> :generic
100101
_ -> :custom
101102
end
102103

www/src/components/repos/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const ProviderIcons = {
1414
AZURE: DEFAULT_AZURE_ICON,
1515
EQUINIX: DEFAULT_EQUINIX_ICON,
1616
KIND: DEFAULT_KIND_ICON,
17+
GENERIC: DEFAULT_CHART_ICON,
1718
}
1819

1920
export const DarkProviderIcons = {

www/src/components/repository/RepositoryPackagesTerraform.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const providerToIcon = {
3535
AZURE: defualtAzureIcon,
3636
EQUINIX: defaultEquinixIcon,
3737
KIND: defaultKindIcon,
38+
GENERIC: defaultChartIcon,
3839
}
3940

4041
const searchOptions = {

www/src/components/utils/InstallDropdownButton.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const providerToDisplayName = {
3232
EQUINIX: 'Equinix Metal',
3333
GCP: 'Google Cloud Platform',
3434
KIND: 'Kind',
35+
GENERIC: 'Generic',
3536
}
3637

3738
export const providerToIcon = {
@@ -40,6 +41,7 @@ export const providerToIcon = {
4041
EQUINIX: '/equinix-metal.png',
4142
GCP: '/gcp.png',
4243
KIND: '/kind.png',
44+
GENERIC: '/chart.png',
4345
}
4446

4547
export const providerToIconHeight = {
@@ -48,6 +50,7 @@ export const providerToIconHeight = {
4850
EQUINIX: 16,
4951
GCP: 14,
5052
KIND: 14,
53+
GENERIC: 14,
5154
}
5255

5356
const visuallyHideMaintainWidth = {

www/src/generated/graphql.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,8 @@ export enum Provider {
18681868
Equinix = 'EQUINIX',
18691869
Gcp = 'GCP',
18701870
Kind = 'KIND',
1871-
Kubernetes = 'KUBERNETES'
1871+
Kubernetes = 'KUBERNETES',
1872+
Generic = 'GENERIC',
18721873
}
18731874

18741875
export type PublicKey = {

0 commit comments

Comments
 (0)