Skip to content

Commit 11dac0b

Browse files
committed
tmp cmt
1 parent e9f2823 commit 11dac0b

23 files changed

+20536
-41
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,17 @@ WORKDIR /workspace
2828
# Copy the Go Modules manifests
2929
COPY go.mod go.mod
3030
COPY go.sum go.sum
31+
COPY ./rosa /workspace/rosa
32+
33+
3134
# Cache deps before building and copying source so that we don't need to re-download as much
3235
# and so that source changes don't invalidate our downloaded layer
3336
RUN --mount=type=cache,target=/root/.local/share/golang \
3437
--mount=type=cache,target=/go/pkg/mod \
3538
go mod download
3639

40+
# RUN go mod download
41+
3742
# Copy the sources
3843
COPY ./ ./
3944

PROJECT

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,61 @@
1-
version: "2"
21
domain: cluster.x-k8s.io
32
repo: sigs.k8s.io/cluster-api-provider-aws
43
resources:
5-
# v1beta1 types
64
- group: infrastructure
7-
version: v1beta1
85
kind: AWSMachine
9-
- group: infrastructure
106
version: v1beta1
11-
kind: AWSCluster
127
- group: infrastructure
8+
kind: AWSCluster
139
version: v1beta1
14-
kind: AWSMachineTemplate
1510
- group: infrastructure
11+
kind: AWSMachineTemplate
1612
version: v1beta1
17-
kind: AWSClusterStaticIdentity
1813
- group: infrastructure
14+
kind: AWSClusterStaticIdentity
1915
version: v1beta1
20-
kind: AWSClusterRoleIdentity
2116
- group: infrastructure
17+
kind: AWSClusterRoleIdentity
2218
version: v1beta1
23-
kind: AWSClusterControllerIdentity
2419
- group: infrastructure
20+
kind: AWSClusterControllerIdentity
2521
version: v1beta1
26-
kind: AWSClusterTemplate
2722
- group: infrastructure
23+
kind: AWSClusterTemplate
2824
version: v1beta1
29-
kind: AWSManagedControlPlanes
3025
- group: infrastructure
26+
kind: AWSManagedControlPlanes
3127
version: v1beta1
28+
- group: infrastructure
3229
kind: AWSManagedCluster
33-
# v1beta2 types
30+
version: v1beta1
3431
- group: infrastructure
35-
version: v1beta2
3632
kind: AWSMachine
37-
- group: infrastructure
3833
version: v1beta2
39-
kind: AWSCluster
4034
- group: infrastructure
35+
kind: AWSCluster
4136
version: v1beta2
42-
kind: AWSMachineTemplate
4337
- group: infrastructure
38+
kind: AWSMachineTemplate
4439
version: v1beta2
45-
kind: AWSClusterStaticIdentity
4640
- group: infrastructure
41+
kind: AWSClusterStaticIdentity
4742
version: v1beta2
48-
kind: AWSClusterRoleIdentity
4943
- group: infrastructure
44+
kind: AWSClusterRoleIdentity
5045
version: v1beta2
51-
kind: AWSClusterControllerIdentity
5246
- group: infrastructure
47+
kind: AWSClusterControllerIdentity
5348
version: v1beta2
54-
kind: AWSClusterTemplate
5549
- group: infrastructure
50+
kind: AWSClusterTemplate
5651
version: v1beta2
57-
kind: AWSManagedControlPlanes
5852
- group: infrastructure
53+
kind: AWSManagedControlPlanes
5954
version: v1beta2
55+
- group: infrastructure
6056
kind: AWSManagedCluster
57+
version: v1beta2
58+
- group: infrastructure
59+
kind: ROSARoleConfig
60+
version: v1beta2
61+
version: "2"

api/v1beta2/rosaroleconfig_types.go

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
/*
2+
Copyright The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta2
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
)
23+
24+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
25+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
26+
27+
// ROSARoleConfigSpec defines the desired state of ROSARoleConfig
28+
29+
type ROSARoleConfigSpec struct {
30+
AccountRoleConfig AccountRoleConfig `json:"accountRoleConfig"`
31+
OperatorRoleConfig OperatorRoleConfig `json:"operatorRoleConfig"`
32+
OIDCConfig OIDCConfig `json:"oidcConfig"`
33+
34+
// IdentityRef is a reference to an identity to be used when reconciling rosa roles config.
35+
// If no identity is specified, the default identity for this controller will be used.
36+
//
37+
// +optional
38+
IdentityRef *AWSIdentityReference `json:"identityRef,omitempty"`
39+
Region string `json:"region,omitempty"`
40+
}
41+
42+
// +kubebuilder:object:root=true
43+
44+
// ROSARoleConfig is the Schema for the rosaroleconfigs API
45+
type ROSARoleConfig struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ObjectMeta `json:"metadata,omitempty"`
48+
49+
Spec ROSARoleConfigSpec `json:"spec,omitempty"`
50+
Status ROSARoleConfigStatus `json:"status,omitempty"`
51+
}
52+
53+
type AccountRoleConfig struct {
54+
// TODO: verify max len
55+
// +kubebuilder:validation:MaxLength:=4
56+
// +kubebuilder:validation:Required
57+
Prefix string `json:"prefix"`
58+
// +optional
59+
PermissionsBoundaryARN string `json:"permissionsBoundaryARN,omitempty"`
60+
// +optional
61+
Path string `json:"path,omitempty"`
62+
// +kubebuilder:validation:Required
63+
Version string `json:"version"`
64+
// +optional
65+
SharedVPCConfig SharedVPCConfig `json:"sharedVPCConfig,omitempty"`
66+
}
67+
68+
type OperatorRoleConfig struct {
69+
// TODO: verify max len
70+
// +kubebuilder:validation:MaxLength:=4
71+
// +kubebuilder:validation:Required
72+
Prefix string `json:"prefix"`
73+
// +optional
74+
PermissionsBoundaryARN string `json:"permissionsBoundaryARN,omitempty"`
75+
OIDCConfigID string `json:"oidcConfigId,omitempty"`
76+
// +optional
77+
SharedVPCConfig SharedVPCConfig `json:"sharedVPCConfig,omitempty"`
78+
}
79+
80+
type SharedVPCConfig struct {
81+
RouteRoleARN string `json:"routeRoleARN,omitempty"`
82+
VPCEndpointRoleARN string `json:"vpcEndpointRoleArn,omitempty"`
83+
}
84+
85+
type OIDCConfig struct {
86+
ManagedOIDC bool `json:"managedOIDC"`
87+
// Prefix is required for Unmanaged OIDC
88+
// +optional
89+
Prefix string `json:"prefix"`
90+
// Region is required for Unmanaged OIDC
91+
// +optional
92+
Region string `json:"region"`
93+
ExternalAuthProviders []ExternalAuthProvider `json:"externalAuthProviders,omitempty"`
94+
}
95+
96+
type ExternalAuthProvider struct {
97+
Name string `json:"name"`
98+
Issuer Issuer `json:"issuer"`
99+
ClaimMappings ClaimMappings `json:"claimMappings"`
100+
OIDCClients []OIDCClient `json:"oidcClients,omitempty"`
101+
}
102+
103+
type Issuer struct {
104+
IssuerURL string `json:"issuerURL"`
105+
Audiences []string `json:"audiences,omitempty"`
106+
}
107+
108+
type ClaimMappings struct {
109+
Username Mapping `json:"username"`
110+
Groups Mapping `json:"groups,omitempty"`
111+
}
112+
113+
type Mapping struct {
114+
Claim string `json:"claim"`
115+
PrefixPolicy string `json:"prefixPolicy,omitempty"`
116+
}
117+
118+
type OIDCClient struct {
119+
ComponentName string `json:"componentName"`
120+
ComponentNamespace string `json:"componentNamespace"`
121+
ClientID string `json:"clientID"`
122+
ClientSecret SecretReference `json:"clientSecret"`
123+
}
124+
125+
type SecretReference struct {
126+
Name string `json:"name"`
127+
}
128+
129+
// ROSARoleConfigStatus defines the observed state of ROSARoleConfig
130+
type ROSARoleConfigStatus struct {
131+
// Conditions []metav1.Condition `json:"conditions,omitempty"`
132+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
133+
OIDCID string `json:"oidcID,omitempty"`
134+
OIDCProviderARN string `json:"oidcProviderARN,omitempty"`
135+
AccountRolesRef AccountRolesRef `json:"accountRolesRef,omitempty"`
136+
OperatorRolesRef OperatorRolesRef `json:"operatorRolesRef,omitempty"`
137+
}
138+
139+
type AccountRolesRef struct {
140+
InstallerRoleARN string `json:"installerRoleARN,omitempty"`
141+
SupportRoleARN string `json:"supportRoleARN,omitempty"`
142+
WorkerRoleARN string `json:"workerRoleARN,omitempty"`
143+
}
144+
145+
type OperatorRolesRef struct {
146+
IngressARN string `json:"ingressARN,omitempty"`
147+
ImageRegistryARN string `json:"imageRegistryARN,omitempty"`
148+
StorageARN string `json:"storageARN,omitempty"`
149+
NetworkARN string `json:"networkARN,omitempty"`
150+
KubeCloudControllerARN string `json:"kubeCloudControllerARN,omitempty"`
151+
NodePoolManagementARN string `json:"nodePoolManagementARN,omitempty"`
152+
ControlPlaneOperatorARN string `json:"controlPlaneOperatorARN,omitempty"`
153+
KMSProviderARN string `json:"kmsProviderARN,omitempty"`
154+
}
155+
156+
// +kubebuilder:object:root=true
157+
158+
// ROSARoleConfigList contains a list of ROSARoleConfig
159+
type ROSARoleConfigList struct {
160+
metav1.TypeMeta `json:",inline"`
161+
metav1.ListMeta `json:"metadata,omitempty"`
162+
Items []ROSARoleConfig `json:"items"`
163+
}
164+
165+
const (
166+
// RosaRoleConfigReadyCondition condition reports on the successful reconciliation of RosaNetwork.
167+
RosaRoleConfigReadyCondition clusterv1.ConditionType = "RosaRoleConfigReady"
168+
169+
// RosaRoleConfigDeletionFailedReason used to report failures while deleting RosaNetwork.
170+
RosaRoleConfigDeletionFailedReason = "DeletionFailed"
171+
)
172+
173+
// GetConditions returns the observations of the operational state of the RosaNetwork resource.
174+
func (r *ROSARoleConfig) GetConditions() clusterv1.Conditions {
175+
return r.Status.Conditions
176+
}
177+
178+
// SetConditions sets the underlying service state of the RosaNetwork to the predescribed clusterv1.Conditions.
179+
func (r *ROSARoleConfig) SetConditions(conditions clusterv1.Conditions) {
180+
r.Status.Conditions = conditions
181+
}
182+
183+
func init() {
184+
SchemeBuilder.Register(&ROSARoleConfig{}, &ROSARoleConfigList{})
185+
}

0 commit comments

Comments
 (0)