Skip to content

Commit

Permalink
Change resource entrypoint from name to id
Browse files Browse the repository at this point in the history
This gives the perception that the entrypoint should be unique
  • Loading branch information
michaelhtm committed Nov 11, 2024
1 parent 2e15201 commit e5285d4
Show file tree
Hide file tree
Showing 35 changed files with 210 additions and 210 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/resource_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type Validation struct {

type Resource struct {
// +kubebuilder:validation:Required
Name string `json:"name,omitempty"`
ID string `json:"id,omitempty"`
// +kubebuilder:validation:Required
Template runtime.RawExtension `json:"template,omitempty"`
// +kubebuilder:validation:Optional
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/kro.run_resourcegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ spec:
description: The resources that are part of the resourcegroup.
items:
properties:
id:
type: string
includeWhen:
items:
type: string
type: array
name:
type: string
readyWhen:
items:
type: string
Expand All @@ -85,7 +85,7 @@ spec:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- name
- id
- template
type: object
type: array
Expand Down
12 changes: 6 additions & 6 deletions examples/ack-controller/ec2-controller/ec2-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ spec:
serviceAccount:
name: string | default=ec2-controller-sa
resources:
- name: ec2CRDGroup
- id: ec2CRDGroup
template:
apiVersion: kro.run/v1alpha1
kind: EC2CRDGroup
metadata:
name: ${schema.spec.name}-crd-group
spec:
name: ${schema.spec.name}-crd-group
- name: ec2ControllerIamRole
- id: ec2ControllerIamRole
template:
apiVersion: iam.services.k8s.aws/v1alpha1
kind: Role
Expand All @@ -70,7 +70,7 @@ spec:
}
}]
}
- name: serviceAccount
- id: serviceAccount
template:
apiVersion: v1
kind: ServiceAccount
Expand All @@ -79,7 +79,7 @@ spec:
namespace: ${schema.spec.namespace}
annotations:
eks.amazonaws.com/role-arn: ${ec2ControllerIamRole.status.ackResourceMetadata.arn}
- name: deployment
- id: deployment
template:
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -138,7 +138,7 @@ spec:
value: ${schema.spec.values.log.level}
ports:
- containerPort: 80
- name: clusterRoleBinding
- id: clusterRoleBinding
template:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -152,7 +152,7 @@ spec:
- kind: ServiceAccount
name: ${serviceAccount.metadata.name}
namespace: ${serviceAccount.metadata.namespace}
- name: clusterRole
- id: clusterRole
template:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
34 changes: 17 additions & 17 deletions examples/ack-controller/ec2-controller/ec2-crd-group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
spec:
name: string | default=ec2CRDGroup
resources:
- name: dhcpOptionsCRD
- id: dhcpOptionsCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -192,7 +192,7 @@ spec:
storage: true
subresources:
status: {}
- name: elasticIPAddressCRD
- id: elasticIPAddressCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -378,7 +378,7 @@ spec:
storage: true
subresources:
status: {}
- name: flowLogsCRD
- id: flowLogsCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -645,7 +645,7 @@ spec:
storage: true
subresources:
status: {}
- name: instanceCRD
- id: instanceCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1525,7 +1525,7 @@ spec:
storage: true
subresources:
status: {}
- name: internetGatewayCRD
- id: internetGatewayCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1727,7 +1727,7 @@ spec:
storage: true
subresources:
status: {}
- name: natGatewayCRD
- id: natGatewayCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -2029,7 +2029,7 @@ spec:
storage: true
subresources:
status: {}
- name: networkAclCRD
- id: networkAclCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -2265,7 +2265,7 @@ spec:
storage: true
subresources:
status: {}
- name: routeTableCRD
- id: routeTableCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -2611,7 +2611,7 @@ spec:
storage: true
subresources:
status: {}
- name: securityGroupCRD
- id: securityGroupCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3039,7 +3039,7 @@ spec:
storage: true
subresources:
status: {}
- name: subnetCRD
- id: subnetCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3351,7 +3351,7 @@ spec:
storage: true
subresources:
status: {}
- name: transitGatewayCRD
- id: transitGatewayCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3533,7 +3533,7 @@ spec:
storage: true
subresources:
status: {}
- name: vpcEndpointCRD
- id: vpcEndpointCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3876,7 +3876,7 @@ spec:
storage: true
subresources:
status: {}
- name: vpcEndpointServiceConfigurationCRD
- id: vpcEndpointServiceConfigurationCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -4103,7 +4103,7 @@ spec:
storage: true
subresources:
status: {}
- name: vpcPeeringConnectionCRD
- id: vpcPeeringConnectionCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -4431,7 +4431,7 @@ spec:
storage: true
subresources:
status: {}
- name: vpcCRD
- id: vpcCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -4723,7 +4723,7 @@ spec:
storage: true
subresources:
status: {}
- name: adoptedResourceCRD
- id: adoptedResourceCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -4978,7 +4978,7 @@ spec:
storage: true
subresources:
status: {}
- name: fieldExportCRD
- id: fieldExportCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
14 changes: 7 additions & 7 deletions examples/ack-controller/eks-controller/eks-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ spec:
serviceAccount:
name: string | default=eks-controller-sa
resources:
- name: eksCRDGroup
- id: eksCRDGroup
template:
apiVersion: kro.run/v1alpha1
kind: EKSCRDGroup
metadata:
name: ${schema.spec.name}-crd-group
spec:
name: ${schema.spec.name}-crd-group
- name: eksControllerIamPolicy
- id: eksControllerIamPolicy
template:
apiVersion: iam.services.k8s.aws/v1alpha1
kind: Policy
Expand All @@ -75,7 +75,7 @@ spec:
}
]
}
- name: eksControllerIamRole
- id: eksControllerIamRole
template:
apiVersion: iam.services.k8s.aws/v1alpha1
kind: Role
Expand All @@ -100,7 +100,7 @@ spec:
}
}]
}
- name: serviceAccount
- id: serviceAccount
template:
apiVersion: v1
kind: ServiceAccount
Expand All @@ -109,7 +109,7 @@ spec:
namespace: ${schema.spec.namespace}
annotations:
eks.amazonaws.com/role-arn : ${eksControllerIamRole.status.ackResourceMetadata.arn}
- name: deployment
- id: deployment
template:
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -168,7 +168,7 @@ spec:
value: ${schema.spec.values.log.level}
ports:
- containerPort: 80
- name: clusterRoleBinding
- id: clusterRoleBinding
template:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -182,7 +182,7 @@ spec:
- kind: ServiceAccount
name: ${serviceAccount.metadata.name}
namespace: ${serviceAccount.metadata.namespace}
- name: clusterRole
- id: clusterRole
template:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
14 changes: 7 additions & 7 deletions examples/ack-controller/eks-controller/eks-crd-group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
spec:
name: string | default=eksCRDGroup
resources:
- name: accessEntryCRD
- id: accessEntryCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -273,7 +273,7 @@ spec:
storage: true
subresources:
status: {}
- name: addonsCRD
- id: addonsCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -592,7 +592,7 @@ spec:
storage: true
subresources:
status: {}
- name: clusterCRD
- id: clusterCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1028,7 +1028,7 @@ spec:
storage: true
subresources:
status: {}
- name: fargateProfilesCRD
- id: fargateProfilesCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1279,7 +1279,7 @@ spec:
storage: true
subresources:
status: {}
- name: identityProviderCRD
- id: identityProviderCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1456,7 +1456,7 @@ spec:
storage: true
subresources:
status: {}
- name: nodeGroupsCRD
- id: nodeGroupsCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1929,7 +1929,7 @@ spec:
storage: true
subresources:
status: {}
- name: podIdentityAssociationCRD
- id: podIdentityAssociationCRD
template:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
Loading

0 comments on commit e5285d4

Please sign in to comment.