Skip to content

Commit

Permalink
Fix typos in comments and documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Widmer <sebastian.widmer@vshn.net>
Co-authored-by: Simon Gerber <simon.gerber@vshn.ch>
  • Loading branch information
3 people committed Sep 29, 2022
1 parent 4b306db commit f858235
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type ClusterSpec struct {
DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
// CreationPolicy defines how the external resources should be treated upon CR creation.
// Create: will only create a new external resource and will not manage already existing resources
// Adopt: will create a new external resource or will adopt and manage en already existing resource
// Adopt: will create a new external resource or will adopt and manage an already existing resource
// +kubebuilder:validation:Enum=Create;Adopt
CreationPolicy CreationPolicy `json:"creationPolicy,omitempty"`
}
Expand Down Expand Up @@ -104,7 +104,7 @@ func (c *Cluster) GetDeletionPolicy() DeletionPolicy {
return c.Spec.DeletionPolicy
}

// GetCreationPolicy returns the object's deletion policy
// GetCreationPolicy returns the object's creation policy
func (c *Cluster) GetCreationPolicy() CreationPolicy {
return c.Spec.CreationPolicy
}
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/gitrepo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ type GitRepoTemplate struct {
DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
// CreationPolicy defines how the external resources should be treated upon CR creation.
// Create: will only create a new external resource and will not manage already existing resources
// Adopt: will create a new external resource or will adopt and manage en already existing resource
// Adopt: will create a new external resource or will adopt and manage an already existing resource
// +kubebuilder:validation:Enum=Create;Adopt
CreationPolicy CreationPolicy `json:"creationPolicy,omitempty"`
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func (g *GitRepo) GetDeletionPolicy() DeletionPolicy {
return g.Spec.DeletionPolicy
}

// GetCreationPolicy returns the object's deletion policy
// GetCreationPolicy returns the object's creation policy
func (g *GitRepo) GetCreationPolicy() CreationPolicy {
return g.Spec.CreationPolicy
}
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/tenant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type TenantSpec struct {
DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
// CreationPolicy defines how the external resources should be treated upon CR creation.
// Create: will only create a new external resource and will not manage already existing resources
// Adopt: will create a new external resource or will adopt and manage en already existing resource
// Adopt: will create a new external resource or will adopt and manage an already existing resource
// +kubebuilder:validation:Enum=Create;Adopt
CreationPolicy CreationPolicy `json:"creationPolicy,omitempty"`
// ClusterTemplate defines a template which will be used to set defaults for the clusters of this tenant.
Expand Down Expand Up @@ -90,7 +90,7 @@ func (t *Tenant) GetDeletionPolicy() DeletionPolicy {
return t.Spec.DeletionPolicy
}

// GetCreationPolicy returns the object's deletion policy
// GetCreationPolicy returns the object's creation policy
func (t *Tenant) GetCreationPolicy() CreationPolicy {
return t.Spec.CreationPolicy
}
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/syn.tools_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
description: 'CreationPolicy defines how the external resources should
be treated upon CR creation. Create: will only create a new external
resource and will not manage already existing resources Adopt: will
create a new external resource or will adopt and manage en already
create a new external resource or will adopt and manage an already
existing resource'
enum:
- Create
Expand Down Expand Up @@ -99,7 +99,7 @@ spec:
should be treated upon CR creation. Create: will only create
a new external resource and will not manage already existing
resources Adopt: will create a new external resource or will
adopt and manage en already existing resource'
adopt and manage an already existing resource'
enum:
- Create
- Adopt
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/syn.tools_gitrepos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
description: 'CreationPolicy defines how the external resources should
be treated upon CR creation. Create: will only create a new external
resource and will not manage already existing resources Adopt: will
create a new external resource or will adopt and manage en already
create a new external resource or will adopt and manage an already
existing resource'
enum:
- Create
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/syn.tools_tenants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
should be treated upon CR creation. Create: will only create
a new external resource and will not manage already existing
resources Adopt: will create a new external resource or will
adopt and manage en already existing resource'
adopt and manage an already existing resource'
enum:
- Create
- Adopt
Expand Down Expand Up @@ -105,7 +105,7 @@ spec:
should be treated upon CR creation. Create: will only create
a new external resource and will not manage already existing
resources Adopt: will create a new external resource or
will adopt and manage en already existing resource'
will adopt and manage an already existing resource'
enum:
- Create
- Adopt
Expand Down Expand Up @@ -198,7 +198,7 @@ spec:
description: 'CreationPolicy defines how the external resources should
be treated upon CR creation. Create: will only create a new external
resource and will not manage already existing resources Adopt: will
create a new external resource or will adopt and manage en already
create a new external resource or will adopt and manage an already
existing resource'
enum:
- Create
Expand Down Expand Up @@ -244,7 +244,7 @@ spec:
should be treated upon CR creation. Create: will only create
a new external resource and will not manage already existing
resources Adopt: will create a new external resource or will
adopt and manage en already existing resource'
adopt and manage an already existing resource'
enum:
- Create
- Adopt
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/syn.tools_tenanttemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
should be treated upon CR creation. Create: will only create
a new external resource and will not manage already existing
resources Adopt: will create a new external resource or will
adopt and manage en already existing resource'
adopt and manage an already existing resource'
enum:
- Create
- Adopt
Expand Down Expand Up @@ -105,7 +105,7 @@ spec:
should be treated upon CR creation. Create: will only create
a new external resource and will not manage already existing
resources Adopt: will create a new external resource or
will adopt and manage en already existing resource'
will adopt and manage an already existing resource'
enum:
- Create
- Adopt
Expand Down Expand Up @@ -198,7 +198,7 @@ spec:
description: 'CreationPolicy defines how the external resources should
be treated upon CR creation. Create: will only create a new external
resource and will not manage already existing resources Adopt: will
create a new external resource or will adopt and manage en already
create a new external resource or will adopt and manage an already
existing resource'
enum:
- Create
Expand Down Expand Up @@ -244,7 +244,7 @@ spec:
should be treated upon CR creation. Create: will only create
a new external resource and will not manage already existing
resources Adopt: will create a new external resource or will
adopt and manage en already existing resource'
adopt and manage an already existing resource'
enum:
- Create
- Adopt
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/explanations/adoption.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Repository Adoption is the process of managing Git repositories that weren't created by Lieutenant.

By default if you create a `GitRepo` resource that references a Git repository that already exits, Lieutenant will not adopt and manage it.
This should prevent accidental modification of exiting repositories and also avoids issues if two `GitRepo` resources reference the same repository.
This should prevent accidental modification of existing repositories and also avoids issues if two `GitRepo` resources reference the same repository.

Adoption can be enabled per `GitRepo` by setting `spec.creationPolicy` to `Adopt` or as a global default by setting `DEFAULT_CREATION_POLICY` to `Adopt`.
Enabling adoption can be helpful for migrations or disaster recovery.
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/references/api-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ClusterSpec defines the desired state of Cluster
| *`tokenLifeTime`* __string__ | TokenLifetime set the token lifetime
| *`facts`* __object (keys:string, values:string)__ | Facts are key/value pairs for statically configured facts
| *`deletionPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-deletionpolicy[$$DeletionPolicy$$]__ | DeletionPolicy defines how the external resources should be treated upon CR deletion. Retain: will not delete any external resources Delete: will delete the external resources Archive: will archive the external resources, if it supports that
| *`creationPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-creationpolicy[$$CreationPolicy$$]__ | CreationPolicy defines how the external resources should be treated upon CR creation. Create: will only create a new external resource and will not manage already existing resources Adopt: will create a new external resource or will adopt and manage en already existing resource
| *`creationPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-creationpolicy[$$CreationPolicy$$]__ | CreationPolicy defines how the external resources should be treated upon CR creation. Create: will only create a new external resource and will not manage already existing resources Adopt: will create a new external resource or will adopt and manage an already existing resource
|===


Expand Down Expand Up @@ -205,7 +205,7 @@ GitRepoTemplate is used for templating git repos, it does not contain the tenant
| *`displayName`* __string__ | DisplayName of Git repository
| *`templateFiles`* __object (keys:string, values:string)__ | TemplateFiles is a list of files that should be pushed to the repository after its creation.
| *`deletionPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-deletionpolicy[$$DeletionPolicy$$]__ | DeletionPolicy defines how the external resources should be treated upon CR deletion. Retain: will not delete any external resources Delete: will delete the external resources Archive: will archive the external resources, if it supports that
| *`creationPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-creationpolicy[$$CreationPolicy$$]__ | CreationPolicy defines how the external resources should be treated upon CR creation. Create: will only create a new external resource and will not manage already existing resources Adopt: will create a new external resource or will adopt and manage en already existing resource
| *`creationPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-creationpolicy[$$CreationPolicy$$]__ | CreationPolicy defines how the external resources should be treated upon CR creation. Create: will only create a new external resource and will not manage already existing resources Adopt: will create a new external resource or will adopt and manage an already existing resource
|===


Expand Down Expand Up @@ -263,7 +263,7 @@ TenantSpec defines the desired state of Tenant
| *`globalGitRepoRevision`* __string__ | GlobalGitRepoRevision allows to configure the revision of the global configuration to use. It can be any git tree-ish reference. Defaults to HEAD if left empty.
| *`gitRepoTemplate`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-gitrepotemplate[$$GitRepoTemplate$$]__ | GitRepoTemplate Template for managing the GitRepo object. If not set, no GitRepo object will be created.
| *`deletionPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-deletionpolicy[$$DeletionPolicy$$]__ | DeletionPolicy defines how the external resources should be treated upon CR deletion. Retain: will not delete any external resources Delete: will delete the external resources Archive: will archive the external resources, if it supports that
| *`creationPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-creationpolicy[$$CreationPolicy$$]__ | CreationPolicy defines how the external resources should be treated upon CR creation. Create: will only create a new external resource and will not manage already existing resources Adopt: will create a new external resource or will adopt and manage en already existing resource
| *`creationPolicy`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-creationpolicy[$$CreationPolicy$$]__ | CreationPolicy defines how the external resources should be treated upon CR creation. Create: will only create a new external resource and will not manage already existing resources Adopt: will create a new external resource or will adopt and manage an already existing resource
| *`clusterTemplate`* __xref:{anchor_prefix}-github-com-projectsyn-lieutenant-operator-api-v1alpha1-clusterspec[$$ClusterSpec$$]__ | ClusterTemplate defines a template which will be used to set defaults for the clusters of this tenant. The fields within this can use Go templating. See https://syn.tools/lieutenant-operator/explanations/templating.html for details.
|===

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const (
// which specifies the Namespace to watch.
// An empty value means the operator is running with cluster scope.
watchNamespaceEnvVar = "WATCH_NAMESPACE"
// createSAEnvVar is the contant for the env variable which indicates
// createSAEnvVar is the constant for the env variable which indicates
// whether to create ServiceAccount token secrets
createSATokenEnvVar = "LIEUTENANT_CREATE_SERVICEACCOUNT_TOKEN_SECRET"
// createSAEnvVar is the contant for the env variable which indicates
// createSAEnvVar is the constant for the env variable which indicates
// the default creation policy for git repositories
defaultCreationPolicy = "DEFAULT_CREATION_POLICY"
)
Expand Down

0 comments on commit f858235

Please sign in to comment.