Skip to content
Open
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
31 changes: 31 additions & 0 deletions apis/repo/v1alpha1/zz_defaultbranch_types.go

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

35 changes: 35 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.

32 changes: 32 additions & 0 deletions apis/repo/v1alpha1/zz_generated.resolvers.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 @@ -33,7 +33,7 @@ var terraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{
// the branch field unavailable. This causes the name of the k8s object to be leading and will cause naming conflict.
"github_branch": config.IdentifierFromProvider,
// Imported by using the following format: {{ repository }}
"github_branch_default": config.TemplatedStringAsIdentifier("repository", "{{ .external_name }}"),
"github_branch_default": config.IdentifierFromProvider,
Copy link
Copy Markdown
Collaborator

@AtzeDeVries AtzeDeVries Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackivanov let me verify this, but i believe this might be a breaking change.

First of all, if the format of the external does not change then this is ok.

If the format of the external name changes then this will change how the provider interprets the external name on current resources. I am not aware of upjet beging able to handle this, but could be

// Imported by using the following format: {{ repository }}:{{ pattern }}
// We cannot use the external_name = pattern here since pattern can contain non alpha numberic characters
"github_branch_protection": config.IdentifierFromProvider,
Expand Down
3 changes: 3 additions & 0 deletions examples-generated/repo/v1alpha1/defaultbranch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ spec:
branchSelector:
matchLabels:
testing.upbound.io/example-name: development
repositorySelector:
matchLabels:
testing.upbound.io/example-name: example

---

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

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

163 changes: 163 additions & 0 deletions package/crds/repo.github.upbound.io_defaultbranches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,85 @@ spec:
Indicate if it should rename the branch rather than use an existing branch. Defaults to false.
Indicate if it should rename the branch rather than use an existing branch. Defaults to 'false'.
type: boolean
repository:
description: |-
The GitHub repository
The GitHub repository.
type: string
repositoryRef:
description: Reference to a Repository in repo to populate repository.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
repositorySelector:
description: Selector for a Repository in repo to populate repository.
properties:
matchControllerRef:
description: |-
MatchControllerRef ensures an object with the same controller reference
as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
type: object
initProvider:
description: |-
Expand Down Expand Up @@ -255,6 +334,85 @@ spec:
Indicate if it should rename the branch rather than use an existing branch. Defaults to false.
Indicate if it should rename the branch rather than use an existing branch. Defaults to 'false'.
type: boolean
repository:
description: |-
The GitHub repository
The GitHub repository.
type: string
repositoryRef:
description: Reference to a Repository in repo to populate repository.
properties:
name:
description: Name of the referenced object.
type: string
policy:
description: Policies for referencing.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
required:
- name
type: object
repositorySelector:
description: Selector for a Repository in repo to populate repository.
properties:
matchControllerRef:
description: |-
MatchControllerRef ensures an object with the same controller reference
as the selecting object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with matching labels
is selected.
type: object
policy:
description: Policies for selection.
properties:
resolution:
default: Required
description: |-
Resolution specifies whether resolution of this reference is required.
The default is 'Required', which means the reconcile will fail if the
reference cannot be resolved. 'Optional' means this reference will be
a no-op if it cannot be resolved.
enum:
- Required
- Optional
type: string
resolve:
description: |-
Resolve specifies when this reference should be resolved. The default
is 'IfNotPresent', which will attempt to resolve the reference only when
the corresponding field is not present. Use 'Always' to resolve the
reference on every reconcile.
enum:
- Always
- IfNotPresent
type: string
type: object
type: object
type: object
managementPolicies:
default:
Expand Down Expand Up @@ -442,6 +600,11 @@ spec:
Indicate if it should rename the branch rather than use an existing branch. Defaults to false.
Indicate if it should rename the branch rather than use an existing branch. Defaults to 'false'.
type: boolean
repository:
description: |-
The GitHub repository
The GitHub repository.
type: string
type: object
conditions:
description: Conditions of the resource.
Expand Down
Loading