Skip to content

Commit

Permalink
Merge pull request #1624 from haarchri/feature/kafka-fix
Browse files Browse the repository at this point in the history
fix(kafka): add clusterName because of api-changes
  • Loading branch information
Christopher Haar authored Jan 12, 2023
2 parents f86f4ce + e46e21a commit cbc5c75
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 64 deletions.
1 change: 0 additions & 1 deletion apis/kafka/generator-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ignore:
- ClusterV2
field_paths:
- CreateClusterInput.BrokerNodeGroupInfo
- CreateClusterInput.ClusterName
- CreateClusterInput.ConfigurationInfo
- CreateConfigurationInput.Name
- CreateConfigurationInput.ServerProperties
Expand Down
5 changes: 3 additions & 2 deletions apis/kafka/v1alpha1/zz_cluster.go

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

10 changes: 5 additions & 5 deletions apis/kafka/v1alpha1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions examples/kafka/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
name: example
spec:
forProvider:
clusterName: example
region: us-east-1
brokerNodeGroupInfo:
clientSubnetRefs:
Expand Down
7 changes: 4 additions & 3 deletions package/crds/kafka.aws.crossplane.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ spec:
type: boolean
type: object
type: object
clusterName:
description: The name of the cluster.
type: string
configurationInfo:
description: Represents the configuration that you want MSK to
use for the cluster.
Expand Down Expand Up @@ -479,6 +482,7 @@ spec:
description: Create tags when creating the cluster.
type: object
required:
- clusterName
- kafkaVersion
- numberOfBrokerNodes
- region
Expand Down Expand Up @@ -663,9 +667,6 @@ spec:
clusterARN:
description: The Amazon Resource Name (ARN) of the cluster.
type: string
clusterName:
description: The name of the MSK cluster.
type: string
state:
description: The state of the cluster. The possible states are
ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER,
Expand Down
7 changes: 0 additions & 7 deletions pkg/controller/kafka/cluster/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func SetupCluster(mgr ctrl.Manager, o controller.Options) error {
name := managed.ControllerName(svcapitypes.ClusterGroupKind)
opts := []option{
func(e *external) {
e.preObserve = preObserve
e.postObserve = postObserve
e.preDelete = preDelete
e.postDelete = postDelete
Expand Down Expand Up @@ -84,11 +83,6 @@ func postDelete(_ context.Context, cr *svcapitypes.Cluster, obj *svcsdk.DeleteCl
return err
}

func preObserve(_ context.Context, cr *svcapitypes.Cluster, obj *svcsdk.DescribeClusterInput) error {
obj.ClusterArn = awsclients.String(meta.GetExternalName(cr))
return nil
}

func postObserve(_ context.Context, cr *svcapitypes.Cluster, obj *svcsdk.DescribeClusterOutput, obs managed.ExternalObservation, err error) (managed.ExternalObservation, error) {
if err != nil {
return managed.ExternalObservation{}, err
Expand Down Expand Up @@ -118,7 +112,6 @@ func postObserve(_ context.Context, cr *svcapitypes.Cluster, obj *svcsdk.Describ
}

func preCreate(_ context.Context, cr *svcapitypes.Cluster, obj *svcsdk.CreateClusterInput) error {
obj.ClusterName = awsclients.String(meta.GetExternalName(cr))
obj.BrokerNodeGroupInfo = &svcsdk.BrokerNodeGroupInfo{
ClientSubnets: cr.Spec.ForProvider.CustomBrokerNodeGroupInfo.ClientSubnets,
InstanceType: cr.Spec.ForProvider.CustomBrokerNodeGroupInfo.InstanceType,
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/kafka/cluster/zz_controller.go

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

91 changes: 47 additions & 44 deletions pkg/controller/kafka/cluster/zz_conversions.go

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

0 comments on commit cbc5c75

Please sign in to comment.