Skip to content

Commit

Permalink
Merge branch 'master' into lahabana-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
lahabana authored Jun 13, 2024
2 parents 103c8ab + 8ded1a1 commit 2fe4494
Show file tree
Hide file tree
Showing 412 changed files with 10,377 additions and 1,158 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-distribute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
- name: Push security assets to cloudsmith
id: push_security_assets
if: ${{ needs.provenance.result == 'success' || needs.build_publish.result == 'success' }}
uses: cloudsmith-io/action@468883caf5ea64dd980d5266ff72dcf281c83df6 # v0.6.7
uses: cloudsmith-io/action@e84016ef48713f4dfdb00210c4720a286662e4f4 # v0.6.8
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
command: "push"
Expand Down
41 changes: 26 additions & 15 deletions api/common/v1alpha1/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ import (
type TargetRefKind string

var (
Mesh TargetRefKind = "Mesh"
MeshSubset TargetRefKind = "MeshSubset"
MeshGateway TargetRefKind = "MeshGateway"
MeshService TargetRefKind = "MeshService"
MeshServiceSubset TargetRefKind = "MeshServiceSubset"
MeshHTTPRoute TargetRefKind = "MeshHTTPRoute"
Mesh TargetRefKind = "Mesh"
MeshSubset TargetRefKind = "MeshSubset"
MeshGateway TargetRefKind = "MeshGateway"
MeshService TargetRefKind = "MeshService"
MeshExternalService TargetRefKind = "MeshExternalService"
MeshServiceSubset TargetRefKind = "MeshServiceSubset"
MeshHTTPRoute TargetRefKind = "MeshHTTPRoute"
)

var order = map[TargetRefKind]int{
Mesh: 1,
MeshSubset: 2,
MeshGateway: 3,
MeshService: 4,
MeshServiceSubset: 5,
MeshHTTPRoute: 6,
Mesh: 1,
MeshSubset: 2,
MeshGateway: 3,
MeshService: 4,
MeshExternalService: 5,
MeshServiceSubset: 6,
MeshHTTPRoute: 7,
}

// +kubebuilder:validation:Enum=Sidecar;Gateway
Expand All @@ -38,8 +40,8 @@ var (
Gateway TargetRefProxyType = "Gateway"
)

func (k TargetRefKind) Less(o TargetRefKind) bool {
return order[k] < order[o]
func (k TargetRefKind) Compare(o TargetRefKind) int {
return order[k] - order[o]
}

func AllTargetRefKinds() []TargetRefKind {
Expand All @@ -57,7 +59,7 @@ func (x TargetRefKindSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
// TargetRef defines structure that allows attaching policy to various objects
type TargetRef struct {
// Kind of the referenced resource
// +kubebuilder:validation:Enum=Mesh;MeshSubset;MeshGateway;MeshService;MeshServiceSubset;MeshHTTPRoute
// +kubebuilder:validation:Enum=Mesh;MeshSubset;MeshGateway;MeshService;MeshExternalService;MeshServiceSubset;MeshHTTPRoute
Kind TargetRefKind `json:"kind,omitempty"`
// Name of the referenced resource. Can only be used with kinds: `MeshService`,
// `MeshServiceSubset` and `MeshGatewayRoute`
Expand All @@ -71,6 +73,15 @@ type TargetRef struct {
// all data plane types are targeted by the policy.
// +kubebuilder:validation:MinItems=1
ProxyTypes []TargetRefProxyType `json:"proxyTypes,omitempty"`
// Namespace specifies the namespace of target resource. If empty only resources in policy namespace
// will be targeted.
Namespace string `json:"namespace,omitempty"`
// Labels are used to select group of MeshServices that match labels. Either Labels or
// Name and Namespace can be used.
Labels map[string]string `json:"labels,omitempty"`
// SectionName is used to target specific section of resource.
// For example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.
SectionName string `json:"sectionName,omitempty"`
}

func IncludesGateways(ref TargetRef) bool {
Expand Down
7 changes: 7 additions & 0 deletions api/common/v1alpha1/zz_generated.deepcopy.go

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

13 changes: 13 additions & 0 deletions api/mesh/v1alpha1/dataplane_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ const (
// at this moment is "shadow". When effect is "shadow" the policy doesn't change the DPPs configs, but could be
// observed using the Inspect API.
EffectLabel = "kuma.io/effect"

// PolicyRoleLabel is a standard label that reflects the role of the policy. The value is automatically set by the
// Kuma CP based on the policy spec. Supported values are "producer", "consumer", "system" and "workload-owner".
PolicyRoleLabel = "kuma.io/policy-role"
)

type ResourceOrigin string
Expand All @@ -65,6 +69,15 @@ const (
ZoneResourceOrigin ResourceOrigin = "zone"
)

type PolicyRole string

const (
ProducerPolicyRole PolicyRole = "producer"
ConsumerPolicyRole PolicyRole = "consumer"
SystemPolicyRole PolicyRole = "system"
WorkloadOwnerPolicyRole PolicyRole = "workload-owner"
)

func (o ResourceOrigin) IsValid() error {
switch o {
case GlobalResourceOrigin, ZoneResourceOrigin:
Expand Down
1 change: 1 addition & 0 deletions app/kuma-dp/pkg/dataplane/envoy/remote_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func (b *remoteBootstrap) requestForBootstrap(ctx context.Context, client *http.
CertPath: params.MetricsCertPath,
KeyPath: params.MetricsKeyPath,
},
SystemCaPath: params.SystemCaPath,
}
jsonBytes, err := json.MarshalIndent(request, "", " ")
if err != nil {
Expand Down

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

This file was deleted.

24 changes: 0 additions & 24 deletions app/kuma-ui/pkg/resources/data/assets/App-CYQiEAq4.js

This file was deleted.

Loading

0 comments on commit 2fe4494

Please sign in to comment.