Skip to content

Commit

Permalink
Merge pull request #33 from coopnorge/do-not-user-name-as-external-na…
Browse files Browse the repository at this point in the history
…me-in-repo

feat: repository - do not use name as provider [breaking]
  • Loading branch information
AtzeDeVries authored Dec 19, 2023
2 parents 38227bd + 4739db7 commit ca47afe
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions apis/repo/v1alpha1/zz_generated.deepcopy.go

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

4 changes: 4 additions & 0 deletions apis/repo/v1alpha1/zz_repository_types.go

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

2 changes: 1 addition & 1 deletion config/external_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "github.com/upbound/upjet/pkg/config"
// provider.
var ExternalNameConfigs = map[string]config.ExternalName{
// Imported by using the following format: {{name}}
"github_repository": config.NameAsIdentifier,
"github_repository": config.IdentifierFromProvider,
// Imported by using the following format: {{ repository }}:{{ name }}:{{ source branch }}
"github_branch": config.TemplatedStringAsIdentifier("branch", "{{ .parameters.repository }}:{{ .external_name }}:{{ .parameters.source_branch }}"),
// Imported by using the following format: {{ repository }}
Expand Down
3 changes: 2 additions & 1 deletion examples-generated/repo/branchprotection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ metadata:
testing.upbound.io/example-name: example
name: example
spec:
forProvider: {}
forProvider:
name: test

---

Expand Down
1 change: 1 addition & 0 deletions examples-generated/repo/defaultbranch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ spec:
forProvider:
autoInit: true
description: My awesome codebase
name: example

---

1 change: 1 addition & 0 deletions examples-generated/repo/repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
spec:
forProvider:
description: My awesome codebase
name: example
template:
- includeAllBranches: true
owner: github
Expand Down
1 change: 1 addition & 0 deletions examples-generated/repo/repositoryfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ metadata:
spec:
forProvider:
autoInit: true
name: tf-acc-test-%s

---

3 changes: 2 additions & 1 deletion examples-generated/team/teamrepository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ metadata:
testing.upbound.io/example-name: some_repo
name: some-repo
spec:
forProvider: {}
forProvider:
name: some-repo

---

Expand Down
1 change: 0 additions & 1 deletion internal/controller/repo/repository/zz_controller.go

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

5 changes: 5 additions & 0 deletions package/crds/repo.github.upbound.io_repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ spec:
description: Can be PR_TITLE or MERGE_MESSAGE for a default merge
commit title.
type: string
name:
description: The name of the repository.
type: string
pages:
description: The repository's GitHub Pages configuration. See
GitHub Pages Configuration below for details.
Expand Down Expand Up @@ -310,6 +313,8 @@ spec:
alerts have not been successfully tested on any GitHub Enterprise
instance and may be unavailable in those settings.'
type: boolean
required:
- name
type: object
providerConfigRef:
default:
Expand Down

0 comments on commit ca47afe

Please sign in to comment.