-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(konnect): KongTarget reconciler (#627)
* Add KongTarget reconciler * fix apiauth ref and add unit tests * add assertions for updated entity * add KongTarget sample and do not delete when upstream being deleted
- Loading branch information
1 parent
b449bc7
commit ee21458
Showing
21 changed files
with
1,396 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
kind: KonnectAPIAuthConfiguration | ||
apiVersion: konnect.konghq.com/v1alpha1 | ||
metadata: | ||
name: konnect-api-auth-dev-1 | ||
namespace: default | ||
spec: | ||
type: token | ||
token: kpat_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
serverURL: us.api.konghq.com | ||
--- | ||
kind: KonnectGatewayControlPlane | ||
apiVersion: konnect.konghq.com/v1alpha1 | ||
metadata: | ||
name: test1 | ||
namespace: default | ||
spec: | ||
name: test1 | ||
labels: | ||
app: test1 | ||
key1: test1 | ||
konnect: | ||
authRef: | ||
name: konnect-api-auth-dev-1 | ||
--- | ||
kind: KongUpstream | ||
apiVersion: configuration.konghq.com/v1alpha1 | ||
metadata: | ||
name: upstream-1 | ||
namespace: default | ||
spec: | ||
name: upstream-1 | ||
controlPlaneRef: | ||
type: konnectNamespacedRef | ||
konnectNamespacedRef: | ||
name: test1 | ||
--- | ||
kind: KongTarget | ||
apiVersion: configuration.konghq.com/v1alpha1 | ||
metadata: | ||
name: target-1 | ||
namespace: default | ||
spec: | ||
upstreamRef: | ||
name: upstream-1 | ||
target: "10.0.0.1" | ||
weight: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package ops | ||
|
||
import ( | ||
"context" | ||
|
||
sdkkonnectops "github.com/Kong/sdk-konnect-go/models/operations" | ||
) | ||
|
||
// TargetsSDK is the interface for the Konnect Taret SDK. | ||
type TargetsSDK interface { | ||
CreateTargetWithUpstream(ctx context.Context, req sdkkonnectops.CreateTargetWithUpstreamRequest, opts ...sdkkonnectops.Option) (*sdkkonnectops.CreateTargetWithUpstreamResponse, error) | ||
UpsertTargetWithUpstream(ctx context.Context, req sdkkonnectops.UpsertTargetWithUpstreamRequest, opts ...sdkkonnectops.Option) (*sdkkonnectops.UpsertTargetWithUpstreamResponse, error) | ||
DeleteTargetWithUpstream(ctx context.Context, req sdkkonnectops.DeleteTargetWithUpstreamRequest, opts ...sdkkonnectops.Option) (*sdkkonnectops.DeleteTargetWithUpstreamResponse, error) | ||
} |
Oops, something went wrong.