Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions api/v1alpha1/gitrepo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ type GitRepoTemplate struct {
// DeployKeys optional list of SSH deploy keys. If not set, not deploy keys will be configured
DeployKeys map[string]DeployKey `json:"deployKeys,omitempty"`
// Path to Git repository
GeneratedDeployKeys map[string]DeployKeyTemplate `json:"generatedDeployKeys,omitempty"`
// Path to Git repository
Path string `json:"path,omitempty"`
// RepoName name of Git repository
RepoName string `json:"repoName,omitempty"`
Expand Down Expand Up @@ -153,6 +155,21 @@ type DeployKey struct {
WriteAccess bool `json:"writeAccess,omitempty"`
}

// DeployKeyTemplate defines an SSH key to be generated for git operations.
type DeployKeyTemplate struct {
// Type defines what type the key is. For key generation, currently only `ssh-rsa` and `ssh-ed25519` are supported.
Type string `json:"type,omitempty"`
// WriteAccess if the key has RW access or not
WriteAccess bool `json:"writeAccess,omitempty"`
}

// DeployKeyStatus tracks the status for a generated Deploy Key
type DeployKeyStatus struct {
DeployKey `json:",inline"`
// SecretRef is the name of the secret in which the SSH keypair is stored.
SecretRef corev1.LocalObjectReference `json:"secretRef,omitempty"`
}

// GitRepoStatus defines the observed state of GitRepo
type GitRepoStatus struct {
// Updated by Operator with current phase. The GitPhase enum will be used for application logic
Expand All @@ -166,6 +183,8 @@ type GitRepoStatus struct {
HostKeys string `json:"hostKeys,omitempty"`
// LastAppliedCIVariables contains the last applied CI variables as a json string
LastAppliedCIVariables string `json:"lastAppliedCIVariables,omitempty"`
// GeneratedDeployKeys contains all SSH deploy keys that were generated for the git repo
GeneratedDeployKeys map[string]DeployKeyStatus `json:"generatedDeployKeys,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
46 changes: 46 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions config/crd/bases/syn.tools_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,22 @@ spec:
displayName:
description: DisplayName of Git repository
type: string
generatedDeployKeys:
additionalProperties:
description: DeployKeyTemplate defines an SSH key to be generated
for git operations.
properties:
type:
description: Type defines what type the key is. For key
generation, currently only `ssh-rsa` and `ssh-ed25519`
are supported.
type: string
writeAccess:
description: WriteAccess if the key has RW access or not
type: boolean
type: object
description: Path to Git repository
type: object
path:
description: Path to Git repository
type: string
Expand Down
49 changes: 49 additions & 0 deletions config/crd/bases/syn.tools_gitrepos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,21 @@ spec:
displayName:
description: DisplayName of Git repository
type: string
generatedDeployKeys:
additionalProperties:
description: DeployKeyTemplate defines an SSH key to be generated
for git operations.
properties:
type:
description: Type defines what type the key is. For key generation,
currently only `ssh-rsa` and `ssh-ed25519` are supported.
type: string
writeAccess:
description: WriteAccess if the key has RW access or not
type: boolean
type: object
description: Path to Git repository
type: object
path:
description: Path to Git repository
type: string
Expand Down Expand Up @@ -225,6 +240,40 @@ spec:
status:
description: GitRepoStatus defines the observed state of GitRepo
properties:
generatedDeployKeys:
additionalProperties:
description: DeployKeyStatus tracks the status for a generated Deploy
Key
properties:
key:
description: Key is the actual key
type: string
secretRef:
description: SecretRef is the name of the secret in which the
SSH keypair is stored.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type:
description: Type defines what type the key is (rsa, ed25519,
etc...)
type: string
writeAccess:
description: WriteAccess if the key has RW access or not
type: boolean
type: object
description: GeneratedDeployKeys contains all SSH deploy keys that
were generated for the git repo
type: object
hostKeys:
description: SSH HostKeys of the git server
type: string
Expand Down
33 changes: 33 additions & 0 deletions config/crd/bases/syn.tools_tenants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ spec:
displayName:
description: DisplayName of Git repository
type: string
generatedDeployKeys:
additionalProperties:
description: DeployKeyTemplate defines an SSH key to be
generated for git operations.
properties:
type:
description: Type defines what type the key is. For
key generation, currently only `ssh-rsa` and `ssh-ed25519`
are supported.
type: string
writeAccess:
description: WriteAccess if the key has RW access or
not
type: boolean
type: object
description: Path to Git repository
type: object
path:
description: Path to Git repository
type: string
Expand Down Expand Up @@ -476,6 +493,22 @@ spec:
displayName:
description: DisplayName of Git repository
type: string
generatedDeployKeys:
additionalProperties:
description: DeployKeyTemplate defines an SSH key to be generated
for git operations.
properties:
type:
description: Type defines what type the key is. For key
generation, currently only `ssh-rsa` and `ssh-ed25519`
are supported.
type: string
writeAccess:
description: WriteAccess if the key has RW access or not
type: boolean
type: object
description: Path to Git repository
type: object
path:
description: Path to Git repository
type: string
Expand Down
33 changes: 33 additions & 0 deletions config/crd/bases/syn.tools_tenanttemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ spec:
displayName:
description: DisplayName of Git repository
type: string
generatedDeployKeys:
additionalProperties:
description: DeployKeyTemplate defines an SSH key to be
generated for git operations.
properties:
type:
description: Type defines what type the key is. For
key generation, currently only `ssh-rsa` and `ssh-ed25519`
are supported.
type: string
writeAccess:
description: WriteAccess if the key has RW access or
not
type: boolean
type: object
description: Path to Git repository
type: object
path:
description: Path to Git repository
type: string
Expand Down Expand Up @@ -476,6 +493,22 @@ spec:
displayName:
description: DisplayName of Git repository
type: string
generatedDeployKeys:
additionalProperties:
description: DeployKeyTemplate defines an SSH key to be generated
for git operations.
properties:
type:
description: Type defines what type the key is. For key
generation, currently only `ssh-rsa` and `ssh-ed25519`
are supported.
type: string
writeAccess:
description: WriteAccess if the key has RW access or not
type: boolean
type: object
description: Path to Git repository
type: object
path:
description: Path to Git repository
type: string
Expand Down
Loading