Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the support for configmap wrapper #554

Merged
merged 7 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions apis/placement/v1beta1/commons.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,29 @@ const (
WorkFinalizer = fleetPrefix + "work-cleanup"

// CRPTrackingLabel is the label that points to the cluster resource policy that creates a resource binding.
CRPTrackingLabel = fleetPrefix + "parentCRP"
CRPTrackingLabel = fleetPrefix + "parent-CRP"

// ResourceSnapshotTrackingLabel is the label that points to the cluster resource snapshot that this work is generated from.
ResourceSnapshotTrackingLabel = fleetPrefix + "parent-resource-snapshot"

// IsLatestSnapshotLabel tells if the snapshot is the latest one.
IsLatestSnapshotLabel = fleetPrefix + "isLatestSnapshot"
IsLatestSnapshotLabel = fleetPrefix + "is-latest-snapshot"

// FleetResourceLabelKey is that label that indicates the resource is a fleet resource.
FleetResourceLabelKey = fleetPrefix + "isFleetResource"
FleetResourceLabelKey = fleetPrefix + "is-fleet-resource"

// FirstWorkNameFmt is the format of the name of the first work.
// FirstWorkNameFmt is the format of the name of the work generated with first resource snapshot .
// The name of the first work is {crpName}-work.
FirstWorkNameFmt = "%s-work"

// WorkNameWithSubindexFmt is the format of the name of a work with subindex.
// WorkNameWithSubindexFmt is the format of the name of a work generated with resource snapshot with subindex.
// The name of the first work is {crpName}-{subindex}.
WorkNameWithSubindexFmt = "%s-%d"

// WorkNameWithConfigEnvelopeFmt is the format of the name of a work generated with config envelop.
// The format is {workPrefix}-configMap-uuid
WorkNameWithConfigEnvelopeFmt = "%s-configmap-%s"

// ParentResourceSnapshotIndexLabel is the label applied to work that contains the index of the resource snapshot that generates the work.
ParentResourceSnapshotIndexLabel = fleetPrefix + "parent-resource-snapshot-index"

Expand All @@ -52,13 +61,23 @@ const (

// CRPGenerationAnnotation is the annotation that indicates the generation of the CRP from
// which an object is derived or last updated.
CRPGenerationAnnotation = fleetPrefix + "CRPGeneration"

// PreviousBindingStateAnnotation is the annotation that records the previous state of a binding.
// This is used to remember if an "unscheduled" binding was moved from a "bound" state or a "scheduled" state.
PreviousBindingStateAnnotation = fleetPrefix + "PreviousBindingState"
CRPGenerationAnnotation = fleetPrefix + "CRP-generation"

// EnvelopeConfigMapAnnotation is the annotation that indicates the configmap is an envelope configmap that contains resources
// we need to apply to the member cluster instead of the configMap itself.
EnvelopeConfigMapAnnotation = fleetPrefix + "EnvelopeConfigMap"
EnvelopeConfigMapAnnotation = fleetPrefix + "envelope-configmap"

// EnvelopeTypeLabel is the label that marks the work object as generated from an envelope object.
// The value of the annotation is the type of the envelope object.
EnvelopeTypeLabel = fleetPrefix + "envelope-work"

// EnvelopeNamespaceLabel is the label that contains the namespace of the envelope object that the work is generated from.
EnvelopeNamespaceLabel = fleetPrefix + "envelope-namespace"

// EnvelopeNameLabel is the label that contains the name of the envelope object that the work is generated from.
EnvelopeNameLabel = fleetPrefix + "envelope-name"

// PreviousBindingStateAnnotation is the annotation that records the previous state of a binding.
// This is used to remember if an "unscheduled" binding was moved from a "bound" state or a "scheduled" state.
PreviousBindingStateAnnotation = fleetPrefix + "previous-binding-state"
)
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ module go.goms.io/fleet
go 1.20

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0
github.com/crossplane/crossplane-runtime v0.19.2
github.com/go-logr/logr v1.2.4
github.com/google/go-cmp v0.5.9
github.com/onsi/ginkgo/v2 v2.9.5
github.com/onsi/gomega v1.27.7
github.com/openkruise/kruise v1.2.0
github.com/prometheus/client_golang v1.15.1
github.com/prometheus/client_golang v1.16.0
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.4
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.24.0
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
golang.org/x/sync v0.3.0
golang.org/x/time v0.3.0
k8s.io/api v0.26.1
Expand All @@ -33,8 +33,8 @@ require (
)

require (
github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -48,7 +48,7 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
Expand All @@ -70,7 +70,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
Expand Down
Loading
Loading