Skip to content

Commit

Permalink
feat: extend prautomation crd to support condition field (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
floreks authored Jan 30, 2025
1 parent a0a6711 commit cde35f9
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 3 deletions.
Binary file modified charts/console-rapid/charts/controller-0.0.104.tgz
Binary file not shown.
Binary file modified charts/console-rapid/charts/kas-0.1.1.tgz
Binary file not shown.
Binary file modified charts/console/charts/controller-0.0.104.tgz
Binary file not shown.
Binary file modified charts/console/charts/kas-0.1.1.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ spec:
items:
description: PrAutomationTemplate ...
properties:
condition:
description: Condition string that will be evaluated to
determine if source files should be copied or not.
type: string
context:
description: Additional context overrides to apply to this
template, will be merged into the user-provided configuration
Expand Down
5 changes: 5 additions & 0 deletions go/controller/api/v1alpha1/prautomation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ type PrAutomationTemplate struct {
// Additional context overrides to apply to this template, will be merged into the user-provided configuration options
// +kubebuilder:validation:Optional
Context *runtime.RawExtension `json:"context,omitempty"`

// Condition string that will be evaluated to determine if source files should be copied or not.
// +kubebuilder:validation:Optional
Condition *string `json:"condition,omitempty"`
}

func (in *PrAutomationTemplate) Attributes() *console.PrAutomationTemplateAttributes {
Expand All @@ -287,6 +291,7 @@ func (in *PrAutomationTemplate) Attributes() *console.PrAutomationTemplateAttrib
Destination: in.Destination,
External: in.External,
Context: context,
Condition: in.Condition,
}
}

Expand Down
5 changes: 5 additions & 0 deletions go/controller/api/v1alpha1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ spec:
items:
description: PrAutomationTemplate ...
properties:
condition:
description: Condition string that will be evaluated to
determine if source files should be copied or not.
type: string
context:
description: Additional context overrides to apply to this
template, will be merged into the user-provided configuration
Expand Down
10 changes: 8 additions & 2 deletions go/controller/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `accessKey` _string_ | | | Optional: {} <br /> |
| `secretAccessKeySecretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretreference-v1-core)_ | SecretAccessKeySecretRef is a secret reference that should contain secret access key. | | Optional: {} <br /> |
| `secretAccessKeySecretKeyRef` _[SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)_ | | | Optional: {} <br /> |
| `assumeRoleArn` _string_ | | | Optional: {} <br /> |


Expand All @@ -1126,6 +1127,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `clientId` _string_ | | | Optional: {} <br /> |
| `clientSecretSecretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretreference-v1-core)_ | ClientSecretSecretRef is a secret reference that should contain client secret. | | Optional: {} <br /> |
| `clientSecretSecretKeyRef` _[SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)_ | | | Optional: {} <br /> |
| `tenantId` _string_ | | | Optional: {} <br /> |
| `subscriptionId` _string_ | | | Optional: {} <br /> |

Expand All @@ -1144,7 +1146,8 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `username` _string_ | | | Required: {} <br /> |
| `passwordSecretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretreference-v1-core)_ | | | Required: {} <br /> |
| `passwordSecretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretreference-v1-core)_ | | | Optional: {} <br /> |
| `passwordSecretKeyRef` _[SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)_ | | | Optional: {} <br /> |


#### HelmRepositoryAuthBearer
Expand All @@ -1160,7 +1163,8 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `tokenSecretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretreference-v1-core)_ | | | Required: {} <br /> |
| `tokenSecretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretreference-v1-core)_ | | | Optional: {} <br /> |
| `tokenSecretKeyRef` _[SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)_ | | | Optional: {} <br /> |


#### HelmRepositoryAuthGCP
Expand All @@ -1177,6 +1181,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `applicationCredentialsSecretRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretreference-v1-core)_ | ApplicationCredentialsSecretRef is a secret reference that should contain application credentials. | | Optional: {} <br /> |
| `applicationCredentialsSecretKeyRef` _[SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)_ | | | Optional: {} <br /> |


#### HelmRepositorySpec
Expand Down Expand Up @@ -2148,6 +2153,7 @@ _Appears in:_
| `external` _boolean_ | Whether it is being sourced from an external git repository | | Required: {} <br /> |
| `source` _string_ | The source file to use for templating | | Optional: {} <br /> |
| `context` _[RawExtension](https://pkg.go.dev/k8s.io/apimachinery/pkg/runtime#RawExtension)_ | Additional context overrides to apply to this template, will be merged into the user-provided configuration options | | Optional: {} <br /> |
| `condition` _string_ | Condition string that will be evaluated to determine if source files should be copied or not. | | Optional: {} <br /> |


#### PrAutomationTrigger
Expand Down
2 changes: 1 addition & 1 deletion go/controller/internal/test/mocks/ConsoleClient_mock.go

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

Binary file modified plural/helm/console/charts/controller-0.0.104.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ spec:
items:
description: PrAutomationTemplate ...
properties:
condition:
description: Condition string that will be evaluated to
determine if source files should be copied or not.
type: string
context:
description: Additional context overrides to apply to this
template, will be merged into the user-provided configuration
Expand Down

0 comments on commit cde35f9

Please sign in to comment.