Skip to content

Commit ab194c8

Browse files
Basic HTTPROXY support (#2537)
1 parent 05eeadc commit ab194c8

File tree

19 files changed

+171
-0
lines changed

19 files changed

+171
-0
lines changed

assets/src/generated/graphql.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3729,6 +3729,17 @@ export type HttpIngressRule = {
37293729
paths?: Maybe<Array<Maybe<IngressPath>>>;
37303730
};
37313731

3732+
/** Configuration for http proxy usage in connections to Git or SCM providers */
3733+
export type HttpProxyAttributes = {
3734+
url: Scalars['String']['input'];
3735+
};
3736+
3737+
/** Configuration for http proxy usage in connections to Git or SCM providers */
3738+
export type HttpProxyConfiguration = {
3739+
__typename?: 'HttpProxyConfiguration';
3740+
url: Scalars['String']['output'];
3741+
};
3742+
37323743
export type InfrastructureStack = {
37333744
__typename?: 'InfrastructureStack';
37343745
/** the actor of this stack (defaults to root console user) */
@@ -9557,6 +9568,8 @@ export type ScmConnection = {
95579568
id: Scalars['ID']['output'];
95589569
insertedAt?: Maybe<Scalars['DateTime']['output']>;
95599570
name: Scalars['String']['output'];
9571+
/** a proxy to use for git requests */
9572+
proxy?: Maybe<HttpProxyConfiguration>;
95609573
type: ScmType;
95619574
updatedAt?: Maybe<Scalars['DateTime']['output']>;
95629575
username?: Maybe<Scalars['String']['output']>;
@@ -9571,6 +9584,7 @@ export type ScmConnectionAttributes = {
95719584
name: Scalars['String']['input'];
95729585
/** the owning entity in this scm provider, eg a github organization */
95739586
owner?: InputMaybe<Scalars['String']['input']>;
9587+
proxy?: InputMaybe<HttpProxyAttributes>;
95749588
/** a ssh private key to be used for commit signing */
95759589
signingPrivateKey?: InputMaybe<Scalars['String']['input']>;
95769590
token?: InputMaybe<Scalars['String']['input']>;
66 Bytes
Binary file not shown.
-6 Bytes
Binary file not shown.
69 Bytes
Binary file not shown.
-4 Bytes
Binary file not shown.

charts/controller/crds/deployments.plural.sh_scmconnections.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ spec:
9696
name:
9797
description: Name is a human-readable name of the ScmConnection.
9898
type: string
99+
proxy:
100+
description: Configures usage of an HTTP proxy for all requests involving
101+
this SCM connection.
102+
properties:
103+
url:
104+
description: The url of your HTTP proxy.
105+
type: string
106+
required:
107+
- url
108+
type: object
99109
tokenSecretRef:
100110
description: A secret containing this access token you will use, stored
101111
in the `token` data field.

go/client/models_gen.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/controller/api/v1alpha1/scmconnection_types.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ func (s *ScmConnection) Attributes(ctx context.Context, kubeClient client.Client
6161
Token: token,
6262
Default: s.Spec.Default,
6363
}
64+
65+
if s.Spec.Proxy != nil {
66+
attr.Proxy = &console.HTTPProxyAttributes{
67+
URL: s.Spec.Proxy.URL,
68+
}
69+
}
70+
6471
if s.Spec.Github != nil {
6572
attr.Github = &console.GithubAppAttributes{
6673
AppID: s.Spec.Github.AppID,
@@ -120,6 +127,11 @@ type ScmConnectionSpec struct {
120127
APIUrl *string `json:"apiUrl,omitempty"`
121128
// +kubebuilder:validation:Optional
122129
Github *ScmGithubConnection `json:"github,omitempty"`
130+
131+
// Configures usage of an HTTP proxy for all requests involving this SCM connection.
132+
// +kubebuilder:validation:Optional
133+
Proxy *HttpProxyConfiguration `json:"proxy,omitempty"`
134+
123135
// +kubebuilder:validation:Optional
124136
Default *bool `json:"default,omitempty"`
125137
}
@@ -130,3 +142,9 @@ type ScmGithubConnection struct {
130142
// +kubebuilder:validation:Optional
131143
PrivateKeyRef *corev1.SecretKeySelector `json:"privateKeyRef,omitempty"`
132144
}
145+
146+
type HttpProxyConfiguration struct {
147+
// The url of your HTTP proxy.
148+
// +kubebuilder:validation:Required
149+
URL string `json:"url"`
150+
}

go/controller/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/controller/config/crd/bases/deployments.plural.sh_scmconnections.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ spec:
9696
name:
9797
description: Name is a human-readable name of the ScmConnection.
9898
type: string
99+
proxy:
100+
description: Configures usage of an HTTP proxy for all requests involving
101+
this SCM connection.
102+
properties:
103+
url:
104+
description: The url of your HTTP proxy.
105+
type: string
106+
required:
107+
- url
108+
type: object
99109
tokenSecretRef:
100110
description: A secret containing this access token you will use, stored
101111
in the `token` data field.

0 commit comments

Comments
 (0)