From 7c872121667fb17a0b40b6a6e057e446321cfcb2 Mon Sep 17 00:00:00 2001 From: Qing Hao Date: Tue, 28 Mar 2023 16:50:32 +0800 Subject: [PATCH] add config-spec-hash annotation to manifestwork (#157) Signed-off-by: haoqing0110 --- go.mod | 4 +- go.sum | 8 +- .../controllers/agentdeploy/util_test.go | 77 ++ .../controllers/agentdeploy/utils.go | 48 + .../addon_configuration_reconciler_test.go | 8 +- .../addonmanagement/controller_test.go | 10 +- test/integration/addon_configs_test.go | 5 +- .../integration/addon_manager_install_test.go | 5 +- .../build-machinery-go/.ci-operator.yaml | 4 + .../openshift/build-machinery-go/Makefile | 24 +- .../make/default.example.mk.help.log | 1 + .../make/golang.example.mk.help.log | 1 + .../build-machinery-go/make/lib/golang.mk | 2 +- .../make/operator.example.mk.help.log | 1 + .../make/targets/golang/test-unit.mk | 4 +- .../make/targets/golang/vulncheck.mk | 31 + .../make/targets/openshift/controller-gen.mk | 4 +- .../make/targets/openshift/crd-schema-gen.mk | 57 +- .../build-machinery-go/scripts/vulncheck.sh | 22 + vendor/modules.txt | 4 +- ...gement.io_clustermanagementaddons.crd.yaml | 625 ++++++++++--- ...anagement.io_managedclusteraddons.crd.yaml | 611 ++++++++----- ...agement.io_addondeploymentconfigs.crd.yaml | 181 ++-- .../v1alpha1/types_clustermanagementaddon.go | 150 +++- .../v1alpha1/types_managedclusteraddon.go | 14 + .../addon/v1alpha1/zz_generated.deepcopy.go | 194 +++- .../zz_generated.swagger_doc_generated.go | 78 +- .../addon/clientset/versioned/clientset.go | 3 +- .../informers/externalversions/factory.go | 79 +- .../cluster/clientset/versioned/clientset.go | 3 +- .../informers/externalversions/factory.go | 79 +- .../work/clientset/versioned/clientset.go | 3 +- .../informers/externalversions/factory.go | 79 +- ...ter-management.io_managedclusters.crd.yaml | 439 +++++---- ...uster-management.io_clusterclaims.crd.yaml | 61 +- ...anagement.io_addonplacementscores.crd.yaml | 228 +++-- ...uster-management.io_clusterclaims.crd.yaml | 46 - ...-management.io_managedclustersets.crd.yaml | 303 ++++--- ...ment.io_managedclustersetbindings.crd.yaml | 193 ++-- ...-cluster-management.io_placements.crd.yaml | 734 +++++++++------ ...-management.io_placementdecisions.crd.yaml | 98 +- .../api/cluster/v1beta1/helpers.go | 10 +- ...-management.io_managedclustersets.crd.yaml | 595 ++++++++----- ...ment.io_managedclustersetbindings.crd.yaml | 374 ++++---- .../utils/work/v1/workbuilder/workbuilder.go | 13 + ...uster-management.io_manifestworks.crd.yaml | 839 +++++++++++------- ...anagement.io_appliedmanifestworks.crd.yaml | 173 ++-- ...anagement.io_appliedmanifestworks.crd.yaml | 90 -- .../api/work/v1/types.go | 6 + ...gement.io_manifestworkreplicasets.crd.yaml | 678 ++++++++------ 50 files changed, 4752 insertions(+), 2547 deletions(-) create mode 100644 vendor/github.com/openshift/build-machinery-go/.ci-operator.yaml create mode 100644 vendor/github.com/openshift/build-machinery-go/make/targets/golang/vulncheck.mk create mode 100644 vendor/github.com/openshift/build-machinery-go/scripts/vulncheck.sh delete mode 100644 vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml delete mode 100644 vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml diff --git a/go.mod b/go.mod index 5414361c5..301b66844 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/fatih/structs v1.1.0 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.24.1 - github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3 + github.com/openshift/build-machinery-go v0.0.0-20230306181456-d321ffa04533 github.com/openshift/library-go v0.0.0-20220525173854-9b950a41acdc github.com/spf13/cobra v1.6.0 github.com/spf13/pflag v1.0.5 @@ -21,7 +21,7 @@ require ( k8s.io/component-base v0.26.1 k8s.io/klog/v2 v2.80.1 k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 - open-cluster-management.io/api v0.10.1-0.20230315095131-f784db2cd015 + open-cluster-management.io/api v0.10.1-0.20230327022939-01b4ef0a6c5e sigs.k8s.io/controller-runtime v0.14.4 ) diff --git a/go.sum b/go.sum index eef5704fd..8612b78b3 100644 --- a/go.sum +++ b/go.sum @@ -305,8 +305,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= -github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3 h1:65oBhJYHzYK5VL0gF1eiYY37lLzyLZ47b9y5Kib1nf8= -github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= +github.com/openshift/build-machinery-go v0.0.0-20230306181456-d321ffa04533 h1:mh3ZYs7kPIIe3UUY6tJcTExmtjnXXUu0MrBuK2W/Qvw= +github.com/openshift/build-machinery-go v0.0.0-20230306181456-d321ffa04533/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE= github.com/openshift/library-go v0.0.0-20220525173854-9b950a41acdc h1:j+upvKc1uLzuL+q/JXie8+IMohOooTCaEC9w+4d1Ztk= github.com/openshift/library-go v0.0.0-20220525173854-9b950a41acdc/go.mod h1:AMZwYwSdbvALDl3QobEzcJ2IeDO7DYLsr42izKzh524= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -805,8 +805,8 @@ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+O k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -open-cluster-management.io/api v0.10.1-0.20230315095131-f784db2cd015 h1:kbZTH7u23/WcRdsaPFOwM/g0viTwTg2TSC2PgVcV394= -open-cluster-management.io/api v0.10.1-0.20230315095131-f784db2cd015/go.mod h1:wmPEOyy+AUn0KYr32J4TZBW/FTPlmF0/Nc4whZSXlIc= +open-cluster-management.io/api v0.10.1-0.20230327022939-01b4ef0a6c5e h1:9CqVKR0f94T1wnIbUF9Q89EeEJWkFU05/Ozbov2zelI= +open-cluster-management.io/api v0.10.1-0.20230327022939-01b4ef0a6c5e/go.mod h1:WgKUCJ7+Bf40DsOmH1Gdkpyj3joco+QLzrlM6Ak39zE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/pkg/addonmanager/controllers/agentdeploy/util_test.go b/pkg/addonmanager/controllers/agentdeploy/util_test.go index 5f8e4d204..51df17896 100644 --- a/pkg/addonmanager/controllers/agentdeploy/util_test.go +++ b/pkg/addonmanager/controllers/agentdeploy/util_test.go @@ -1 +1,78 @@ package agentdeploy + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/assert" + addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1" + workapiv1 "open-cluster-management.io/api/work/v1" +) + +func TestConfigsToAnnotations(t *testing.T) { + cases := []struct { + name string + configReference []addonapiv1alpha1.ConfigReference + expectAnnotations map[string]string + }{ + { + name: "generate annotaions", + configReference: []addonapiv1alpha1.ConfigReference{ + { + ConfigGroupResource: addonapiv1alpha1.ConfigGroupResource{ + Group: "addon.open-cluster-management.io", + Resource: "addondeploymentconfigs", + }, + DesiredConfig: &addonapiv1alpha1.ConfigSpecHash{ + ConfigReferent: addonapiv1alpha1.ConfigReferent{ + Name: "test", + Namespace: "open-cluster-management", + }, + SpecHash: "hash1", + }, + }, + { + ConfigGroupResource: addonapiv1alpha1.ConfigGroupResource{ + Resource: "addonhubconfigs", + }, + DesiredConfig: &addonapiv1alpha1.ConfigSpecHash{ + ConfigReferent: addonapiv1alpha1.ConfigReferent{ + Name: "test", + }, + SpecHash: "hash2", + }, + }, + }, + expectAnnotations: map[string]string{ + workapiv1.ManifestConfigSpecHashAnnotationKey: `{"addondeploymentconfigs.addon.open-cluster-management.io/open-cluster-management/test":"hash1","addonhubconfigs//test":"hash2"}`}, + }, + { + name: "generate annotaions without configReference", + configReference: []addonapiv1alpha1.ConfigReference{}, + expectAnnotations: nil, + }, + { + name: "generate annotaions without DesiredConfig", + configReference: []addonapiv1alpha1.ConfigReference{ + { + ConfigGroupResource: addonapiv1alpha1.ConfigGroupResource{ + Group: "addon.open-cluster-management.io", + Resource: "addondeploymentconfigs", + }, + }, + }, + expectAnnotations: map[string]string{ + workapiv1.ManifestConfigSpecHashAnnotationKey: `{}`}, + }, + } + + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + annotations, err := configsToAnnotations(c.configReference) + assert.NoError(t, err) + if !reflect.DeepEqual(annotations, c.expectAnnotations) { + t.Fatalf("Expected annotations to be equal but got %v (expected) and %v (actual)", c.expectAnnotations, annotations) + } + }) + } +} diff --git a/pkg/addonmanager/controllers/agentdeploy/utils.go b/pkg/addonmanager/controllers/agentdeploy/utils.go index 9ee6069b3..5dc706147 100644 --- a/pkg/addonmanager/controllers/agentdeploy/utils.go +++ b/pkg/addonmanager/controllers/agentdeploy/utils.go @@ -1,6 +1,7 @@ package agentdeploy import ( + "encoding/json" "fmt" "k8s.io/apimachinery/pkg/api/meta" @@ -293,10 +294,16 @@ func (b *addonWorksBuilder) BuildDeployWorks(addonWorkNamespace string, } } + annotations, err := configsToAnnotations(addon.Status.ConfigReferences) + if err != nil { + return nil, nil, err + } + return b.workBuilder.Build(deployObjects, newAddonWorkObjectMeta(b.processor.manifestWorkNamePrefix(addon.Namespace, addon.Name), addon.Name, addon.Namespace, addonWorkNamespace, owner), workbuilder.ExistingManifestWorksOption(existingWorks), workbuilder.ManifestConfigOption(manifestOptions), + workbuilder.ManifestAnnotations(annotations), workbuilder.DeletionOption(deletionOption)) } @@ -494,3 +501,44 @@ func getDeletionOrphaningRule(obj runtime.Object) (*workapiv1.OrphaningRule, err } return rule, nil } + +// convert config reference to annotations. +func configsToAnnotations(configReference []addonapiv1alpha1.ConfigReference) (map[string]string, error) { + if len(configReference) == 0 { + return nil, nil + } + + // annotations is a map stores the config name and config spec hash. + // + // config name follows the format of .//, for example, + // addondeploymentconfigs.addon.open-cluster-management.io/open-cluster-management/default. + // for a cluster scoped resource, the namespace would be empty, for example, + // addonhubconfigs.addon.open-cluster-management.io//default. + annotations := make(map[string]string, len(configReference)) + for _, v := range configReference { + if v.DesiredConfig == nil { + continue + } + resourceStr := v.Resource + if len(v.Group) > 0 { + resourceStr += fmt.Sprintf(".%s", v.Group) + } + resourceStr += fmt.Sprintf("/%s/%s", v.DesiredConfig.Namespace, v.DesiredConfig.Name) + + annotations[resourceStr] = v.DesiredConfig.SpecHash + } + + // converts the annotations map into a JSON byte string. + jsonBytes, err := json.Marshal(annotations) + if err != nil { + return nil, err + } + + // return a map with key as "open-cluster-management.io/config-spec-hash" and value is the JSON byte string. + // For example: + // open-cluster-management.io/config-spec-hash: '{"addonhubconfigs.addon.open-cluster-management.io//default":"613d134a2ec072a8a6451af913979f496d657ef5", + // "addondeploymentconfigs.addon.open-cluster-management.io/open-cluster-management/default":"cca7df9188fb920dcfab374940452393e2037619"}' + return map[string]string{ + workapiv1.ManifestConfigSpecHashAnnotationKey: string(jsonBytes), + }, nil +} diff --git a/pkg/manager/controllers/addonconfiguration/addon_configuration_reconciler_test.go b/pkg/manager/controllers/addonconfiguration/addon_configuration_reconciler_test.go index f45a528b0..1e5762404 100644 --- a/pkg/manager/controllers/addonconfiguration/addon_configuration_reconciler_test.go +++ b/pkg/manager/controllers/addonconfiguration/addon_configuration_reconciler_test.go @@ -89,7 +89,7 @@ func TestAddonConfigReconcile(t *testing.T) { clusterManagementAddon: newClusterManagementAddon("test", []addonv1alpha1.ConfigMeta{{ConfigGroupResource: addonv1alpha1.ConfigGroupResource{Group: "core", Resource: "Foo"}, DefaultConfig: &addonv1alpha1.ConfigReferent{Name: "test"}}}, addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, @@ -142,7 +142,7 @@ func TestAddonConfigReconcile(t *testing.T) { clusterManagementAddon: newClusterManagementAddon("test", []addonv1alpha1.ConfigMeta{{ConfigGroupResource: addonv1alpha1.ConfigGroupResource{Group: "core", Resource: "Foo"}, DefaultConfig: &addonv1alpha1.ConfigReferent{Name: "test"}}}, addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, @@ -194,7 +194,7 @@ func TestAddonConfigReconcile(t *testing.T) { clusterManagementAddon: newClusterManagementAddon("test", []addonv1alpha1.ConfigMeta{{ConfigGroupResource: addonv1alpha1.ConfigGroupResource{Group: "core", Resource: "Foo"}, DefaultConfig: &addonv1alpha1.ConfigReferent{Name: "test"}}}, addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, @@ -241,7 +241,7 @@ func TestAddonConfigReconcile(t *testing.T) { clusterManagementAddon: newClusterManagementAddon("test", []addonv1alpha1.ConfigMeta{{ConfigGroupResource: addonv1alpha1.ConfigGroupResource{Group: "core", Resource: "Foo"}, DefaultConfig: &addonv1alpha1.ConfigReferent{Name: "test"}}}, addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, diff --git a/pkg/manager/controllers/addonmanagement/controller_test.go b/pkg/manager/controllers/addonmanagement/controller_test.go index 47373bf58..f049cab6a 100644 --- a/pkg/manager/controllers/addonmanagement/controller_test.go +++ b/pkg/manager/controllers/addonmanagement/controller_test.go @@ -57,7 +57,7 @@ func TestAddonInstallReconcile(t *testing.T) { clusterManagementAddon: func() *addonv1alpha1.ClusterManagementAddOn { addon := addontesting.NewClusterManagementAddon("test", "", "") addon.Spec.InstallStrategy = addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, @@ -76,7 +76,7 @@ func TestAddonInstallReconcile(t *testing.T) { clusterManagementAddon: func() *addonv1alpha1.ClusterManagementAddOn { addon := addontesting.NewClusterManagementAddon("test", "", "") addon.Spec.InstallStrategy = addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, @@ -97,7 +97,7 @@ func TestAddonInstallReconcile(t *testing.T) { clusterManagementAddon: func() *addonv1alpha1.ClusterManagementAddOn { addon := addontesting.NewClusterManagementAddon("test", "", "") addon.Spec.InstallStrategy = addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, @@ -134,7 +134,7 @@ func TestAddonInstallReconcile(t *testing.T) { clusterManagementAddon: func() *addonv1alpha1.ClusterManagementAddOn { addon := addontesting.NewClusterManagementAddon("test", "", "") addon.Spec.InstallStrategy = addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, @@ -171,7 +171,7 @@ func TestAddonInstallReconcile(t *testing.T) { clusterManagementAddon: func() *addonv1alpha1.ClusterManagementAddOn { addon := addontesting.NewClusterManagementAddon("test", "", "") addon.Spec.InstallStrategy = addonv1alpha1.InstallStrategy{ - Type: addonv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonv1alpha1.AddonInstallStrategyPlacements, Placements: []addonv1alpha1.PlacementStrategy{ { PlacementRef: addonv1alpha1.PlacementRef{Name: "test-placement", Namespace: "default"}, diff --git a/test/integration/addon_configs_test.go b/test/integration/addon_configs_test.go index 9369250b6..e09c411bd 100644 --- a/test/integration/addon_configs_test.go +++ b/test/integration/addon_configs_test.go @@ -121,7 +121,7 @@ var _ = ginkgo.Describe("AddConfigs", func() { gomega.Expect(err).ToNot(gomega.HaveOccurred()) cma.Spec.InstallStrategy = addonapiv1alpha1.InstallStrategy{ - Type: addonapiv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonapiv1alpha1.AddonInstallStrategyPlacements, Placements: []addonapiv1alpha1.PlacementStrategy{ { PlacementRef: addonapiv1alpha1.PlacementRef{Name: "test-placement", Namespace: configDefaultNamespace}, @@ -137,6 +137,9 @@ var _ = ginkgo.Describe("AddConfigs", func() { }, }, }, + RolloutStrategy: addonapiv1alpha1.RolloutStrategy{ + Type: addonapiv1alpha1.AddonRolloutStrategyUpdateAll, + }, }, }, } diff --git a/test/integration/addon_manager_install_test.go b/test/integration/addon_manager_install_test.go index 5d74e91b6..fa67e40ee 100644 --- a/test/integration/addon_manager_install_test.go +++ b/test/integration/addon_manager_install_test.go @@ -101,10 +101,13 @@ var _ = ginkgo.Describe("Agent deploy", func() { gomega.Expect(err).ToNot(gomega.HaveOccurred()) clusterManagementAddon.Spec.InstallStrategy = addonapiv1alpha1.InstallStrategy{ - Type: addonapiv1alpha1.AddonInstallStrategyManualPlacements, + Type: addonapiv1alpha1.AddonInstallStrategyPlacements, Placements: []addonapiv1alpha1.PlacementStrategy{ { PlacementRef: addonapiv1alpha1.PlacementRef{Name: "test-placement", Namespace: placementNamespace}, + RolloutStrategy: addonapiv1alpha1.RolloutStrategy{ + Type: addonapiv1alpha1.AddonRolloutStrategyUpdateAll, + }, }, }, } diff --git a/vendor/github.com/openshift/build-machinery-go/.ci-operator.yaml b/vendor/github.com/openshift/build-machinery-go/.ci-operator.yaml new file mode 100644 index 000000000..00d7adfcf --- /dev/null +++ b/vendor/github.com/openshift/build-machinery-go/.ci-operator.yaml @@ -0,0 +1,4 @@ +build_root_image: + name: release + namespace: openshift + tag: rhel-8-release-golang-1.17-openshift-4.10 diff --git a/vendor/github.com/openshift/build-machinery-go/Makefile b/vendor/github.com/openshift/build-machinery-go/Makefile index 7b69ea411..5dfb18876 100644 --- a/vendor/github.com/openshift/build-machinery-go/Makefile +++ b/vendor/github.com/openshift/build-machinery-go/Makefile @@ -7,7 +7,6 @@ examples :=$(wildcard ./make/examples/*/Makefile.test) # $1 - makefile name relative to ./make/ folder # $2 - target -# $3 - output folder # We need to change dir to the final makefile directory or relative paths won't match. # Dynamic values are replaced with "" so we can do diff against checkout versions. # Avoid comparing local paths by stripping the prefix. @@ -16,39 +15,36 @@ examples :=$(wildcard ./make/examples/*/Makefile.test) # Ignore old cp errors on centos7 # Ignore different make output with `-k` option define update-makefile-log -mkdir -p "$(3)" -set -o pipefail; $(MAKE) -j 1 -C "$(dir $(1))" -f "$(notdir $(1))" --no-print-directory --warn-undefined-variables $(2) 2>&1 | \ - sed 's/\.\(buildDate\|versionFromGit\|commitFromGit\|gitTreeState\)="[^"]*" /.\1="" /g' | \ +set -o pipefail; $(MAKE) -j 1 -C "$(dir $(1))" -f "$(notdir $(1))" --no-print-directory --warn-undefined-variables $(2) > "$(1)$(subst ..,.,.$(2).log.raw)" 2>&1 || (cat "$(1)$(subst ..,.,.$(2).log.raw)" && exit 1) +sed 's/\.\(buildDate\|versionFromGit\|commitFromGit\|gitTreeState\)="[^"]*" /.\1="" /g' "$(1)$(subst ..,.,.$(2).log.raw)" | \ sed -E 's~/[^ ]*/(github.com/openshift/build-machinery-go/[^ ]*)~/\1~g' | \ sed '/\/tmp\/tmp./d' | \ sed '/git checkout -b/d' | \ sed -E 's~^[<> ]*((\+\+\+|\-\-\-) \./(testing/)?manifests/.*.yaml).*~\1~' | \ sed -E 's/^(make\[2\]: \*\*\* \[).*: (.*\] Error 1)/\1\2/' | \ grep -v 'are the same file' | \ - grep -E -v -e '^make\[2\]: Target `.*'"'"' not remade because of errors\.$$' | \ - tee "$(3)"/"$(notdir $(1))"$(subst ..,.,.$(2).log) + grep -E -v -e '^make\[2\]: Target `.*'"'"' not remade because of errors\.$$' \ + > "$(1)$(subst ..,.,.$(2).log)" endef # $1 - makefile name relative to ./make/ folder # $2 - target -# $3 - output folder define check-makefile-log -$(call update-makefile-log,$(1),$(2),$(3)) -diff -N "$(1)$(subst ..,.,.$(2).log)" "$(3)/$(notdir $(1))$(subst ..,.,.$(2).log)" +$(call update-makefile-log,$(1),$(2)) +git diff --exit-code endef update-makefiles: - $(foreach f,$(makefiles),$(call check-makefile-log,$(f),help,$(dir $(f)))) - $(foreach f,$(examples),$(call check-makefile-log,$(f),,$(dir $(f)))) + $(foreach f,$(makefiles),$(call check-makefile-log,$(f),help)) + $(foreach f,$(examples),$(call check-makefile-log,$(f),)) .PHONY: update-makefiles -verify-makefiles: tmp_dir:=$(shell mktemp -d) verify-makefiles: - $(foreach f,$(makefiles),$(call check-makefile-log,$(f),help,$(tmp_dir)/$(dir $(f)))) - $(foreach f,$(examples),$(call check-makefile-log,$(f),,$(tmp_dir)/$(dir $(f)))) + $(foreach f,$(makefiles),$(call check-makefile-log,$(f),help)) + $(foreach f,$(examples),$(call check-makefile-log,$(f),)) .PHONY: verify-makefiles verify: verify-makefiles diff --git a/vendor/github.com/openshift/build-machinery-go/make/default.example.mk.help.log b/vendor/github.com/openshift/build-machinery-go/make/default.example.mk.help.log index befafb1e2..713d8c72a 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/default.example.mk.help.log +++ b/vendor/github.com/openshift/build-machinery-go/make/default.example.mk.help.log @@ -24,3 +24,4 @@ verify-gofmt verify-golang-versions verify-golint verify-govet +vulncheck diff --git a/vendor/github.com/openshift/build-machinery-go/make/golang.example.mk.help.log b/vendor/github.com/openshift/build-machinery-go/make/golang.example.mk.help.log index 2a908b013..1265d975e 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/golang.example.mk.help.log +++ b/vendor/github.com/openshift/build-machinery-go/make/golang.example.mk.help.log @@ -13,3 +13,4 @@ verify-gofmt verify-golang-versions verify-golint verify-govet +vulncheck diff --git a/vendor/github.com/openshift/build-machinery-go/make/lib/golang.mk b/vendor/github.com/openshift/build-machinery-go/make/lib/golang.mk index a6ebe6cd4..d08f74a42 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/lib/golang.mk +++ b/vendor/github.com/openshift/build-machinery-go/make/lib/golang.mk @@ -50,7 +50,7 @@ GO_TEST_FLAGS ?=-race GO_LD_EXTRAFLAGS ?= -SOURCE_GIT_TAG ?=$(shell git describe --long --tags --abbrev=7 --match 'v[0-9]*' || echo 'v0.0.0-unknown') +SOURCE_GIT_TAG ?=$(shell git describe --long --tags --abbrev=7 --match 'v[0-9]*' || echo 'v0.0.0-unknown-$(SOURCE_GIT_COMMIT)') SOURCE_GIT_COMMIT ?=$(shell git rev-parse --short "HEAD^{commit}" 2>/dev/null) SOURCE_GIT_TREE_STATE ?=$(shell ( ( [ ! -d ".git/" ] || git diff --quiet ) && echo 'clean' ) || echo 'dirty') diff --git a/vendor/github.com/openshift/build-machinery-go/make/operator.example.mk.help.log b/vendor/github.com/openshift/build-machinery-go/make/operator.example.mk.help.log index 4c99d2901..47b04e6fe 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/operator.example.mk.help.log +++ b/vendor/github.com/openshift/build-machinery-go/make/operator.example.mk.help.log @@ -31,3 +31,4 @@ verify-golang-versions verify-golint verify-govet verify-profile-manifests +vulncheck diff --git a/vendor/github.com/openshift/build-machinery-go/make/targets/golang/test-unit.mk b/vendor/github.com/openshift/build-machinery-go/make/targets/golang/test-unit.mk index 5afb24af6..5b3fa5248 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/targets/golang/test-unit.mk +++ b/vendor/github.com/openshift/build-machinery-go/make/targets/golang/test-unit.mk @@ -4,11 +4,11 @@ include $(addprefix $(dir $(lastword $(MAKEFILE_LIST))), \ test-unit: ifndef JUNITFILE - $(GO) test $(GO_MOD_FLAGS) $(GO_TEST_FLAGS) $(GO_TEST_PACKAGES) + $(GO) test $(GO_MOD_FLAGS) $(GO_TEST_FLAGS) $(GO_TEST_PACKAGES) $(GO_TEST_ARGS) else ifeq (, $(shell which gotest2junit 2>/dev/null)) $(error gotest2junit not found! Get it by `go get -mod='' -u github.com/openshift/release/tools/gotest2junit`.) endif - set -o pipefail; $(GO) test $(GO_MOD_FLAGS) $(GO_TEST_FLAGS) -json $(GO_TEST_PACKAGES) | gotest2junit > $(JUNITFILE) + set -o pipefail; $(GO) test $(GO_MOD_FLAGS) $(GO_TEST_FLAGS) -json $(GO_TEST_PACKAGES) $(GO_TEST_ARGS) | gotest2junit > $(JUNITFILE) endif .PHONY: test-unit diff --git a/vendor/github.com/openshift/build-machinery-go/make/targets/golang/vulncheck.mk b/vendor/github.com/openshift/build-machinery-go/make/targets/golang/vulncheck.mk new file mode 100644 index 000000000..963a9797a --- /dev/null +++ b/vendor/github.com/openshift/build-machinery-go/make/targets/golang/vulncheck.mk @@ -0,0 +1,31 @@ +scripts_dir :=$(shell realpath $(dir $(lastword $(MAKEFILE_LIST)))../../../scripts) + +# `make vulncheck` will emit a report similar to: +# +# [ +# "golang.org/x/net", +# "v0.5.0", +# "v0.7.0" +# ] +# [ +# "stdlib", +# "go1.19.3", +# "go1.20.1" +# ] +# [ +# "stdlib", +# "go1.19.3", +# "go1.19.4" +# ] +# +# Each stanza lists +# - where the vulnerability exists +# - the version it was found in +# - the version it's fixed in +# +# If the report contains any entries that are not in stdlib, the check +# will fail (exit nonzero). Otherwise it will succeed -- i.e. the stdlib +# entries are only warnings. +vulncheck: + bash $(scripts_dir)/vulncheck.sh +.PHONY: vulncheck diff --git a/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/controller-gen.mk b/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/controller-gen.mk index d80c62c39..4e15c771a 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/controller-gen.mk +++ b/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/controller-gen.mk @@ -8,7 +8,7 @@ include $(addprefix $(dir $(lastword $(MAKEFILE_LIST))), \ # reporting `(devel)`. To build for a given platform: # GOOS=xxx GOARCH=yyy go install sigs.k8s.io/controller-tools/cmd/controller-gen@$version # e.g. -# GOOS=darwin GOARCH=amd64 go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.0 +# GOOS=darwin GOARCH=amd64 go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2 # # If GOOS and GOARCH match your current go env, this will install the binary at # $(go env GOPATH)/bin/controller-gen @@ -16,7 +16,7 @@ include $(addprefix $(dir $(lastword $(MAKEFILE_LIST))), \ # $(go env GOPATH)/bin/${GOOS}_${GOARCH}/conroller-gen # e.g. # /home/efried/.gvm/pkgsets/go1.16/global/bin/darwin_amd64/controller-gen -CONTROLLER_GEN_VERSION ?=v0.6.0 +CONTROLLER_GEN_VERSION ?=v0.9.2 CONTROLLER_GEN ?=$(PERMANENT_TMP_GOPATH)/bin/controller-gen-$(CONTROLLER_GEN_VERSION) ifneq "" "$(wildcard $(CONTROLLER_GEN))" _controller_gen_installed_version = $(shell $(CONTROLLER_GEN) --version | awk '{print $$2}') diff --git a/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk b/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk index 11187f539..bce780dc8 100644 --- a/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk +++ b/vendor/github.com/openshift/build-machinery-go/make/targets/openshift/crd-schema-gen.mk @@ -13,6 +13,12 @@ define patch-crd-yq endef +# $1 - crd file +define format-yaml + cat '$(1)' | $(YQ) read - > t.yaml + mv t.yaml '$(1)' +endef + # $1 - crd file # $2 - patch file define patch-crd-yaml-patch @@ -23,41 +29,33 @@ endef empty := -define diff-file - diff -Naup '$(1)' '$(2)' - -endef - # $1 - apis # $2 - manifests -# $3 - output define run-crd-gen '$(CONTROLLER_GEN)' \ schemapatch:manifests="$(2)" \ paths="$(subst $(empty) ,;,$(1))" \ - output:dir="$(3)" - $$(foreach p,$$(wildcard $(2)/*.crd.yaml-merge-patch),$$(call patch-crd-yq,$$(subst $(2),$(3),$$(basename $$(p))).yaml,$$(p))) - $$(foreach p,$$(wildcard $(2)/*.crd.yaml-patch),$$(call patch-crd-yaml-patch,$$(subst $(2),$(3),$$(basename $$(p))).yaml,$$(p))) + 'output:dir="$(2)"' + $$(foreach p,$$(wildcard $(2)/*.crd.yaml-merge-patch),$$(call patch-crd-yq,$$(basename $$(p)).yaml,$$(p))) + $$(foreach p,$$(wildcard $(2)/*.crd.yaml-patch),$$(call patch-crd-yaml-patch,$$(basename $$(p)).yaml,$$(p))) + $$(foreach p,$$(wildcard $(2)/*.crd.yaml),$$(call patch-crd-yq,$$(basename $$(p)).yaml,$$(p))) endef # $1 - target name # $2 - apis # $3 - manifests -# $4 - output define add-crd-gen-internal update-codegen-crds-$(1): ensure-controller-gen ensure-yq ensure-yaml-patch - $(call run-crd-gen,$(2),$(3),$(4)) + $(call run-crd-gen,$(2),$(3)) .PHONY: update-codegen-crds-$(1) update-codegen-crds: update-codegen-crds-$(1) .PHONY: update-codegen-crds -verify-codegen-crds-$(1): VERIFY_CODEGEN_CRD_TMP_DIR:=$$(shell mktemp -d) -verify-codegen-crds-$(1): ensure-controller-gen ensure-yq ensure-yaml-patch - $(call run-crd-gen,$(2),$(3),$$(VERIFY_CODEGEN_CRD_TMP_DIR)) - $$(foreach p,$$(wildcard $(4)/*crd.yaml),$$(call diff-file,$$(p),$$(subst $(4),$$(VERIFY_CODEGEN_CRD_TMP_DIR),$$(p)))) +verify-codegen-crds-$(1): update-codegen-crds-$(1) + git diff --exit-code .PHONY: verify-codegen-crds-$(1) verify-codegen-crds: verify-codegen-crds-$(1) @@ -66,6 +64,28 @@ verify-codegen-crds: verify-codegen-crds-$(1) endef +# $1 - target name +# $2 - apis +# $3 - manifests +# $4 - featureSet +define add-crd-gen-for-featureset-internal + +update-codegen-$(4)-crds-$(1): ensure-controller-gen ensure-yq ensure-yaml-patch + OPENSHIFT_REQUIRED_FEATURESET=$(4) $(call run-crd-gen,$(2),$(3)) +.PHONY: update-codegen-$(4)-crds-$(1) + +update-codegen-$(4)-crds: update-codegen-$(4)-crds-$(1) +.PHONY: update-codegen-$(4)-crds + +verify-codegen-$(4)-crds-$(1): update-codegen-$(4)-crds-$(1) + git diff --exit-code +.PHONY: verify-codegen-$(4)-crds-$(1) + +verify-codegen-$(4)-crds: verify-codegen-$(4)-crds-$(1) +.PHONY: verify-codegen-$(4)-crds + +endef + update-generated: update-codegen-crds .PHONY: update-generated @@ -80,5 +100,10 @@ verify: verify-generated define add-crd-gen -$(eval $(call add-crd-gen-internal,$(1),$(2),$(3),$(4))) +$(eval $(call add-crd-gen-internal,$(1),$(2),$(3))) +endef + +define add-crd-gen-for-featureset +$(eval $(call add-crd-gen-for-featureset-internal,$(1),$(2),$(3),$(5))) endef + diff --git a/vendor/github.com/openshift/build-machinery-go/scripts/vulncheck.sh b/vendor/github.com/openshift/build-machinery-go/scripts/vulncheck.sh new file mode 100644 index 000000000..71dfe7216 --- /dev/null +++ b/vendor/github.com/openshift/build-machinery-go/scripts/vulncheck.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +### Use govulncheck to check for known vulnerabilities in the project. +### Fail if vulnerabilities are found in module dependencies. +### Warn (but do not fail) on stdlib vulnerabilities. +### TODO: Include useful information (ID, URL) about the vulnerability. + +go install golang.org/x/vuln/cmd/govulncheck@latest + +report=`mktemp` +trap "rm $report" EXIT + +govulncheck -json ./... > $report + +modvulns=$(jq -r '.Vulns[].Modules[] | select(.Path != "stdlib") | [.Path, .FoundVersion, .FixedVersion]' < $report) +libvulns=$(jq -r '.Vulns[].Modules[] | select(.Path == "stdlib") | [.Path, .FoundVersion, .FixedVersion]' < $report) + +echo "$modvulns" +echo "$libvulns" + +# Exit nonzero iff there are any vulnerabilities in module dependencies +test -z "$modvulns" diff --git a/vendor/modules.txt b/vendor/modules.txt index 34c41f9b8..36d84dd33 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -233,7 +233,7 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/openshift/build-machinery-go v0.0.0-20211213093930-7e33a7eb4ce3 +# github.com/openshift/build-machinery-go v0.0.0-20230306181456-d321ffa04533 ## explicit; go 1.13 github.com/openshift/build-machinery-go github.com/openshift/build-machinery-go/make @@ -1226,7 +1226,7 @@ k8s.io/utils/path k8s.io/utils/pointer k8s.io/utils/strings/slices k8s.io/utils/trace -# open-cluster-management.io/api v0.10.1-0.20230315095131-f784db2cd015 +# open-cluster-management.io/api v0.10.1-0.20230327022939-01b4ef0a6c5e ## explicit; go 1.19 open-cluster-management.io/api/addon/v1alpha1 open-cluster-management.io/api/client/addon/clientset/versioned diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml index 6f37446a6..70c2a0077 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml @@ -9,157 +9,522 @@ spec: listKind: ClusterManagementAddOnList plural: clustermanagementaddons singular: clustermanagementaddon - scope: Cluster preserveUnknownFields: false + scope: Cluster versions: - - additionalPrinterColumns: - - jsonPath: .spec.addOnMeta.displayName - name: DISPLAY NAME - type: string - - jsonPath: .spec.addOnConfiguration.crdName - name: CRD NAME - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: ClusterManagementAddOn represents the registration of an add-on to the cluster manager. This resource allows the user to discover which add-on is available for the cluster manager and also provides metadata information about the add-on. This resource also provides a linkage to ManagedClusterAddOn, the name of the ClusterManagementAddOn resource will be used for the namespace-scoped ManagedClusterAddOn resource. ClusterManagementAddOn is a cluster-scoped resource. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: spec represents a desired configuration for the agent on the cluster management add-on. - type: object - properties: - addOnConfiguration: - description: 'Deprecated: Use supportedConfigs filed instead addOnConfiguration is a reference to configuration information for the add-on. In scenario where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn resources need to be created and reference the same AddOnConfiguration.' - type: object + - additionalPrinterColumns: + - jsonPath: .spec.addOnMeta.displayName + name: DISPLAY NAME + type: string + - jsonPath: .spec.addOnConfiguration.crdName + name: CRD NAME + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterManagementAddOn represents the registration of an add-on + to the cluster manager. This resource allows the user to discover which + add-on is available for the cluster manager and also provides metadata information + about the add-on. This resource also provides a linkage to ManagedClusterAddOn, + the name of the ClusterManagementAddOn resource will be used for the namespace-scoped + ManagedClusterAddOn resource. ClusterManagementAddOn is a cluster-scoped + resource. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: spec represents a desired configuration for the agent on + the cluster management add-on. + properties: + addOnConfiguration: + description: 'Deprecated: Use supportedConfigs filed instead addOnConfiguration + is a reference to configuration information for the add-on. In scenario + where a multiple add-ons share the same add-on CRD, multiple ClusterManagementAddOn + resources need to be created and reference the same AddOnConfiguration.' + properties: + crName: + description: crName is the name of the CR used to configure instances + of the managed add-on. This field should be configured if add-on + CR have a consistent name across the all of the ManagedCluster + instaces. + type: string + crdName: + description: crdName is the name of the CRD used to configure + instances of the managed add-on. This field should be configured + if the add-on have a CRD that controls the configuration of + the add-on. + type: string + lastObservedGeneration: + description: lastObservedGeneration is the observed generation + of the custom resource for the configuration of the addon. + format: int64 + type: integer + type: object + addOnMeta: + description: addOnMeta is a reference to the metadata information + for the add-on. + properties: + description: + description: description represents the detailed description of + the add-on. + type: string + displayName: + description: displayName represents the name of add-on that will + be displayed. + type: string + type: object + installStrategy: + default: + type: Manual + description: InstallStrategy represents that related ManagedClusterAddOns + should be installed on certain clusters. + properties: + placements: + description: Placements is a list of placement references honored + when install strategy type is Placements. All clusters selected + by these placements will install the addon If one cluster belongs + to multiple placements, it will only apply the strategy defined + later in the order. That is to say, The latter strategy overrides + the previous one. + items: + properties: + configs: + description: Configs is the configuration of managedClusterAddon + during installation. User can override the configuration + by updating the managedClusterAddon directly. + items: + properties: + group: + default: "" + description: group of the add-on configuration. + type: string + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. + If this field is not set, the configuration is in + the cluster scope. + type: string + resource: + description: resource of the add-on configuration. + minLength: 1 + type: string + required: + - name + - resource + type: object + type: array + name: + description: Name is the name of the placement + minLength: 1 + type: string + namespace: + description: Namespace is the namespace of the placement + minLength: 1 + type: string + rolloutStrategy: + default: + type: UpdateAll + description: The rollout strategy to apply addon configurations + change. The rollout strategy only watches the addon configurations + defined in ClusterManagementAddOn. + properties: + rollingUpdate: + description: Rolling update with placement config params. + Present only if the type is RollingUpdate. + properties: + maxConcurrency: + anyOf: + - type: integer + - type: string + default: 25% + description: 'The maximum concurrently updating + number of clusters. Value can be an absolute number + (ex: 5) or a percentage of desired addons (ex: + 10%). Absolute number is calculated from percentage + by rounding up. Defaults to 25%. Example: when + this is set to 30%, once the addon configs change, + the addon on 30% of the selected clusters will + adopt the new configs. When the addons with new + configs are healthy, the addon on the remaining + clusters will be further updated.' + x-kubernetes-int-or-string: true + type: object + rollingUpdateWithCanary: + description: Rolling update with placement config params. + Present only if the type is RollingUpdateWithCanary. + properties: + maxConcurrency: + anyOf: + - type: integer + - type: string + default: 25% + description: 'The maximum concurrently updating + number of clusters. Value can be an absolute number + (ex: 5) or a percentage of desired addons (ex: + 10%). Absolute number is calculated from percentage + by rounding up. Defaults to 25%. Example: when + this is set to 30%, once the addon configs change, + the addon on 30% of the selected clusters will + adopt the new configs. When the addons with new + configs are healthy, the addon on the remaining + clusters will be further updated.' + x-kubernetes-int-or-string: true + placement: + description: Canary placement reference. + properties: + name: + description: Name is the name of the placement + minLength: 1 + type: string + namespace: + description: Namespace is the namespace of the + placement + minLength: 1 + type: string + required: + - name + - namespace + type: object + required: + - placement + type: object + type: + default: UpdateAll + description: "Type is the type of the rollout strategy, + it supports UpdateAll, RollingUpdate and RollingUpdateWithCanary: + - UpdateAll: when configs change, apply the new configs + to all the selected clusters at once. This is the + default strategy. - RollingUpdate: when configs change, + apply the new configs to all the selected clusters + with the concurrence rate defined in MaxConcurrency. + - RollingUpdateWithCanary: when configs change, wait + and check if add-ons on the canary placement selected + clusters have applied the new configs and are healthy, + then apply the new configs to all the selected clusters + with the concurrence rate defined in MaxConcurrency. + \n The field lastKnownGoodConfig in the status record + the last successfully applied spec hash of canary + placement. If the config spec hash changes after the + canary is passed and before the rollout is done, the + current rollout will continue, then roll out to the + latest change. \n For example, the addon configs have + spec hash A. The canary is passed and the lastKnownGoodConfig + would be A, and all the selected clusters are rolling + out to A. Then the config spec hash changes to B. + At this time, the clusters will continue rolling out + to A. When the rollout is done and canary passed B, + the lastKnownGoodConfig would be B and all the clusters + will start rolling out to B. \n The canary placement + does not have to be a subset of the install placement, + and it is more like a reference for finding and checking + canary clusters before upgrading all. To trigger the + rollout on the canary clusters, you can define another + rollout strategy with the type RollingUpdate, or even + manually upgrade the addons on those clusters." + enum: + - UpdateAll + - RollingUpdate + - RollingUpdateWithCanary + type: string + type: object + required: + - name + - namespace + type: object + type: array + x-kubernetes-list-map-keys: + - namespace + - name + x-kubernetes-list-type: map + type: + default: Manual + description: 'Type is the type of the install strategy, it can + be: - Manual: no automatic install - Placements: install to + clusters selected by placements.' + enum: + - Manual + - Placements + type: string + type: object + supportedConfigs: + description: supportedConfigs is a list of configuration types supported + by add-on. An empty list means the add-on does not require configurations. + The default is an empty list + items: + description: ConfigMeta represents a collection of metadata information + for add-on configuration. properties: - crName: - description: crName is the name of the CR used to configure instances of the managed add-on. This field should be configured if add-on CR have a consistent name across the all of the ManagedCluster instaces. + defaultConfig: + description: defaultConfig represents the namespace and name + of the default add-on configuration. In scenario where all + add-ons have a same configuration. + properties: + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. If this + field is not set, the configuration is in the cluster + scope. + type: string + required: + - name + type: object + group: + default: "" + description: group of the add-on configuration. type: string - crdName: - description: crdName is the name of the CRD used to configure instances of the managed add-on. This field should be configured if the add-on have a CRD that controls the configuration of the add-on. + resource: + description: resource of the add-on configuration. + minLength: 1 type: string - lastObservedGeneration: - description: lastObservedGeneration is the observed generation of the custom resource for the configuration of the addon. - type: integer - format: int64 - addOnMeta: - description: addOnMeta is a reference to the metadata information for the add-on. + required: + - resource type: object + type: array + x-kubernetes-list-map-keys: + - group + - resource + x-kubernetes-list-type: map + type: object + status: + description: status represents the current status of cluster management + add-on. + properties: + defaultconfigReferences: + description: defaultconfigReferences is a list of current add-on default + configuration references. + items: + description: DefaultConfigReference is a reference to the current + add-on configuration. This resource is used to record the configuration + resource for the current add-on. properties: - description: - description: description represents the detailed description of the add-on. + desiredConfig: + description: desiredConfig record the desired config spec hash. + properties: + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. If this + field is not set, the configuration is in the cluster + scope. + type: string + specHash: + description: spec hash for an add-on configuration. + type: string + required: + - name + type: object + group: + default: "" + description: group of the add-on configuration. type: string - displayName: - description: displayName represents the name of add-on that will be displayed. + resource: + description: resource of the add-on configuration. + minLength: 1 type: string - installStrategy: - description: InstallStrategy represents that related ManagedClusterAddOns should be installed on certain clusters. + required: + - resource type: object - default: - type: Manual + type: array + installProgressions: + description: installProgression is a list of current add-on configuration + references per placement. + items: properties: - placements: - description: Placements is a list of placement references honored when install strategy type is Placements. All clusters selected by these placements will install the addon If one cluster belongs to multiple placements, it will only apply the strategy defined later in the order. That is to say, The latter strategy overrides the previous one. - type: array + conditions: + description: conditions describe the state of the managed and + monitored components for the operator. items: - type: object - required: - - name - - namespace + description: "Condition contains details for one aspect of + the current state of this API Resource. --- This struct + is intended for direct use as an array at the field path + .status.conditions. For example, \n type FooStatus struct{ + // Represents the observations of a foo's current state. + // Known .status.conditions.type are: \"Available\", \"Progressing\", + and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields + }" properties: - configs: - description: Configs is the configuration of managedClusterAddon during installation. User can override the configuration by updating the managedClusterAddon directly. - type: array - items: - type: object - required: - - name - - resource - properties: - group: - description: group of the add-on configuration. - type: string - default: "" - name: - description: name of the add-on configuration. - type: string - minLength: 1 - namespace: - description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope. - type: string - resource: - description: resource of the add-on configuration. - type: string - minLength: 1 - name: - description: Name is the name of the placement + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should + be when the underlying condition changed. If that is + not known, then using the time when the API field changed + is acceptable. + format: date-time type: string - minLength: 1 - namespace: - description: Namespace is the namespace of the placement + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, + if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the + current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier + indicating the reason for the condition's last transition. + Producers of specific condition types may define expected + values and meanings for this field, and whether the + values are considered a guaranteed API. The value should + be a CamelCase string. This field may not be empty. + maxLength: 1024 minLength: 1 - x-kubernetes-list-map-keys: - - namespace - - name - x-kubernetes-list-type: map - type: - description: 'Type is the type of the install strategy, it can be: - Manual: no automatic install - Placements: install to clusters selected by placements.' - type: string - default: Manual - enum: - - Manual - - Placements - supportedConfigs: - description: supportedConfigs is a list of configuration types supported by add-on. An empty list means the add-on does not require configurations. The default is an empty list - type: array - items: - description: ConfigMeta represents a collection of metadata information for add-on configuration. - type: object - required: - - resource - properties: - defaultConfig: - description: defaultConfig represents the namespace and name of the default add-on configuration. In scenario where all add-ons have a same configuration. - type: object + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across + resources like Available, but because arbitrary conditions + can be useful (see .node.status.conditions), the ability + to deconflict is important. The regex it matches is + (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string required: - - name + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + configReferences: + description: configReferences is a list of current add-on configuration + references. + items: + description: InstallConfigReference is a reference to the + current add-on configuration. This resource is used to record + the configuration resource for the current add-on. properties: - name: - description: name of the add-on configuration. + desiredConfig: + description: desiredConfig record the desired config name + and spec hash. + properties: + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. + If this field is not set, the configuration is in + the cluster scope. + type: string + specHash: + description: spec hash for an add-on configuration. + type: string + required: + - name + type: object + group: + default: "" + description: group of the add-on configuration. type: string + lastAppliedConfig: + description: lastAppliedConfig records the config spec + hash when the all the corresponding ManagedClusterAddOn + are applied successfully. + properties: + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. + If this field is not set, the configuration is in + the cluster scope. + type: string + specHash: + description: spec hash for an add-on configuration. + type: string + required: + - name + type: object + lastKnownGoodConfig: + description: lastKnownGoodConfig records the last known + good config spec hash. For fresh install or rollout + with type UpdateAll or RollingUpdate, the lastKnownGoodConfig + is the same as lastAppliedConfig. For rollout with type + RollingUpdateWithCanary, the lastKnownGoodConfig is + the last successfully applied config spec hash of the + canary placement. + properties: + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. + If this field is not set, the configuration is in + the cluster scope. + type: string + specHash: + description: spec hash for an add-on configuration. + type: string + required: + - name + type: object + resource: + description: resource of the add-on configuration. minLength: 1 - namespace: - description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope. type: string - group: - description: group of the add-on configuration. - type: string - default: "" - resource: - description: resource of the add-on configuration. - type: string - minLength: 1 - x-kubernetes-list-map-keys: - - group - - resource - x-kubernetes-list-type: map - status: - description: status represents the current status of cluster management add-on. - type: object - served: true - storage: true - subresources: - status: {} + required: + - resource + type: object + type: array + name: + description: Name is the name of the placement + minLength: 1 + type: string + namespace: + description: Namespace is the namespace of the placement + minLength: 1 + type: string + required: + - name + - namespace + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml index 209f09f9e..a6fa44bb4 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_01_addon.open-cluster-management.io_managedclusteraddons.crd.yaml @@ -9,261 +9,392 @@ spec: listKind: ManagedClusterAddOnList plural: managedclusteraddons singular: managedclusteraddon - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="Available")].status - name: Available - type: string - - jsonPath: .status.conditions[?(@.type=="Degraded")].status - name: Degraded - type: string - - jsonPath: .status.conditions[?(@.type=="Progressing")].status - name: Progressing - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: ManagedClusterAddOn is the Custom Resource object which holds the current state of an add-on. This object is used by add-on operators to convey their state. This resource should be created in the ManagedCluster namespace. - type: object - required: - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: spec holds configuration that could apply to any operator. - type: object - properties: - configs: - description: configs is a list of add-on configurations. In scenario where the current add-on has its own configurations. An empty list means there are no defautl configurations for add-on. The default is an empty list - type: array - items: - type: object - required: - - name - - resource - properties: - group: - description: group of the add-on configuration. - type: string - default: "" - name: - description: name of the add-on configuration. - type: string - minLength: 1 - namespace: - description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope. - type: string - resource: - description: resource of the add-on configuration. - type: string - minLength: 1 - installNamespace: - description: installNamespace is the namespace on the managed cluster to install the addon agent. If it is not set, open-cluster-management-agent-addon namespace is used to install the addon agent. - type: string - default: open-cluster-management-agent-addon - maxLength: 63 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ - status: - description: status holds the information about the state of an operator. It is consistent with status information across the Kubernetes ecosystem. - type: object - properties: - addOnConfiguration: - description: 'Deprecated: Use configReferences instead. addOnConfiguration is a reference to configuration information for the add-on. This resource is used to locate the configuration resource for the add-on.' + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="Available")].status + name: Available + type: string + - jsonPath: .status.conditions[?(@.type=="Degraded")].status + name: Degraded + type: string + - jsonPath: .status.conditions[?(@.type=="Progressing")].status + name: Progressing + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: ManagedClusterAddOn is the Custom Resource object which holds + the current state of an add-on. This object is used by add-on operators + to convey their state. This resource should be created in the ManagedCluster + namespace. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: spec holds configuration that could apply to any operator. + properties: + configs: + description: configs is a list of add-on configurations. In scenario + where the current add-on has its own configurations. An empty list + means there are no defautl configurations for add-on. The default + is an empty list + items: + properties: + group: + default: "" + description: group of the add-on configuration. + type: string + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. If this + field is not set, the configuration is in the cluster scope. + type: string + resource: + description: resource of the add-on configuration. + minLength: 1 + type: string + required: + - name + - resource type: object + type: array + installNamespace: + default: open-cluster-management-agent-addon + description: installNamespace is the namespace on the managed cluster + to install the addon agent. If it is not set, open-cluster-management-agent-addon + namespace is used to install the addon agent. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + type: object + status: + description: status holds the information about the state of an operator. It + is consistent with status information across the Kubernetes ecosystem. + properties: + addOnConfiguration: + description: 'Deprecated: Use configReferences instead. addOnConfiguration + is a reference to configuration information for the add-on. This + resource is used to locate the configuration resource for the add-on.' + properties: + crName: + description: crName is the name of the CR used to configure instances + of the managed add-on. This field should be configured if add-on + CR have a consistent name across the all of the ManagedCluster + instaces. + type: string + crdName: + description: crdName is the name of the CRD used to configure + instances of the managed add-on. This field should be configured + if the add-on have a CRD that controls the configuration of + the add-on. + type: string + lastObservedGeneration: + description: lastObservedGeneration is the observed generation + of the custom resource for the configuration of the addon. + format: int64 + type: integer + type: object + addOnMeta: + description: addOnMeta is a reference to the metadata information + for the add-on. This should be same as the addOnMeta for the corresponding + ClusterManagementAddOn resource. + properties: + description: + description: description represents the detailed description of + the add-on. + type: string + displayName: + description: displayName represents the name of add-on that will + be displayed. + type: string + type: object + conditions: + description: conditions describe the state of the managed and monitored + components for the operator. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" properties: - crName: - description: crName is the name of the CR used to configure instances of the managed add-on. This field should be configured if add-on CR have a consistent name across the all of the ManagedCluster instaces. + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time type: string - crdName: - description: crdName is the name of the CRD used to configure instances of the managed add-on. This field should be configured if the add-on have a CRD that controls the configuration of the add-on. + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 type: string - lastObservedGeneration: - description: lastObservedGeneration is the observed generation of the custom resource for the configuration of the addon. - type: integer + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. format: int64 - addOnMeta: - description: addOnMeta is a reference to the metadata information for the add-on. This should be same as the addOnMeta for the corresponding ClusterManagementAddOn resource. + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type type: object + type: array + configReferences: + description: configReferences is a list of current add-on configuration + references. This will be overridden by the clustermanagementaddon + configuration references. + items: + description: ConfigReference is a reference to the current add-on + configuration. This resource is used to locate the configuration + resource for the current add-on. properties: - description: - description: description represents the detailed description of the add-on. - type: string - displayName: - description: displayName represents the name of add-on that will be displayed. + desiredConfig: + description: desiredConfig record the desired config spec hash. + properties: + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. If this + field is not set, the configuration is in the cluster + scope. + type: string + specHash: + description: spec hash for an add-on configuration. + type: string + required: + - name + type: object + group: + default: "" + description: group of the add-on configuration. type: string - conditions: - description: conditions describe the state of the managed and monitored components for the operator. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - configReferences: - description: configReferences is a list of current add-on configuration references. This will be overridden by the clustermanagementaddon configuration references. - type: array - items: - description: ConfigReference is a reference to the current add-on configuration. This resource is used to locate the configuration resource for the current add-on. - type: object - required: + lastAppliedConfig: + description: lastAppliedConfig record the config spec hash when + the corresponding ManifestWork is applied successfully. + properties: + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. If this + field is not set, the configuration is in the cluster + scope. + type: string + specHash: + description: spec hash for an add-on configuration. + type: string + required: - name - - resource - properties: - group: - description: group of the add-on configuration. - type: string - default: "" - lastObservedGeneration: - description: lastObservedGeneration is the observed generation of the add-on configuration. - type: integer - format: int64 - name: - description: name of the add-on configuration. - type: string - minLength: 1 - namespace: - description: namespace of the add-on configuration. If this field is not set, the configuration is in the cluster scope. - type: string - resource: - description: resource of the add-on configuration. - type: string - minLength: 1 - healthCheck: - description: healthCheck indicates how to check the healthiness status of the current addon. It should be set by each addon implementation, by default, the lease mode will be used. + type: object + lastObservedGeneration: + description: 'Deprecated: Use LastAppliedConfig instead lastObservedGeneration + is the observed generation of the add-on configuration.' + format: int64 + type: integer + name: + description: name of the add-on configuration. + minLength: 1 + type: string + namespace: + description: namespace of the add-on configuration. If this + field is not set, the configuration is in the cluster scope. + type: string + resource: + description: resource of the add-on configuration. + minLength: 1 + type: string + required: + - name + - resource type: object + type: array + healthCheck: + description: healthCheck indicates how to check the healthiness status + of the current addon. It should be set by each addon implementation, + by default, the lease mode will be used. + properties: + mode: + default: Lease + description: mode indicates which mode will be used to check the + healthiness status of the addon. + enum: + - Lease + - Customized + type: string + type: object + namespace: + description: namespace is the namespace on the managedcluster to put + registration secret or lease for the addon. It is required when + registration is set or healthcheck mode is Lease. + type: string + registrations: + description: registrations is the configurations for the addon agent + to register to hub. It should be set by each addon controller on + hub to define how the addon agent on managedcluster is registered. + With the registration defined, The addon agent can access to kube + apiserver with kube style API or other endpoints on hub cluster + with client certificate authentication. A csr will be created per + registration configuration. If more than one registrationConfig + is defined, a csr will be created for each registration configuration. + It is not allowed that multiple registrationConfigs have the same + signer name. After the csr is approved on the hub cluster, the klusterlet + agent will create a secret in the installNamespace for the registrationConfig. + If the signerName is "kubernetes.io/kube-apiserver-client", the + secret name will be "{addon name}-hub-kubeconfig" whose contents + includes key/cert and kubeconfig. Otherwise, the secret name will + be "{addon name}-{signer name}-client-cert" whose contents includes + key/cert. + items: + description: RegistrationConfig defines the configuration of the + addon agent to register to hub. The Klusterlet agent will create + a csr for the addon agent with the registrationConfig. properties: - mode: - description: mode indicates which mode will be used to check the healthiness status of the addon. + signerName: + description: signerName is the name of signer that addon agent + will use to create csr. + maxLength: 571 + minLength: 5 type: string - default: Lease - enum: - - Lease - - Customized - namespace: - description: namespace is the namespace on the managedcluster to put registration secret or lease for the addon. It is required when registration is set or healthcheck mode is Lease. - type: string - registrations: - description: registrations is the configurations for the addon agent to register to hub. It should be set by each addon controller on hub to define how the addon agent on managedcluster is registered. With the registration defined, The addon agent can access to kube apiserver with kube style API or other endpoints on hub cluster with client certificate authentication. A csr will be created per registration configuration. If more than one registrationConfig is defined, a csr will be created for each registration configuration. It is not allowed that multiple registrationConfigs have the same signer name. After the csr is approved on the hub cluster, the klusterlet agent will create a secret in the installNamespace for the registrationConfig. If the signerName is "kubernetes.io/kube-apiserver-client", the secret name will be "{addon name}-hub-kubeconfig" whose contents includes key/cert and kubeconfig. Otherwise, the secret name will be "{addon name}-{signer name}-client-cert" whose contents includes key/cert. - type: array - items: - description: RegistrationConfig defines the configuration of the addon agent to register to hub. The Klusterlet agent will create a csr for the addon agent with the registrationConfig. - type: object - properties: - signerName: - description: signerName is the name of signer that addon agent will use to create csr. - type: string - maxLength: 571 - minLength: 5 - subject: - description: "subject is the user subject of the addon agent to be registered to the hub. If it is not set, the addon agent will have the default subject \"subject\": { \t\"user\": \"system:open-cluster-management:addon:{addonName}:{clusterName}:{agentName}\", \t\"groups: [\"system:open-cluster-management:addon\", \"system:open-cluster-management:addon:{addonName}\", \"system:authenticated\"] }" - type: object - properties: - groups: - description: groups is the user group of the addon agent. - type: array - items: - type: string - organizationUnit: - description: organizationUnit is the ou of the addon agent - type: array - items: - type: string - user: - description: user is the user name of the addon agent. + subject: + description: 'subject is the user subject of the addon agent + to be registered to the hub. If it is not set, the addon agent + will have the default subject "subject": { "user": "system:open-cluster-management:addon:{addonName}:{clusterName}:{agentName}", + "groups: ["system:open-cluster-management:addon", "system:open-cluster-management:addon:{addonName}", + "system:authenticated"] }' + properties: + groups: + description: groups is the user group of the addon agent. + items: type: string - relatedObjects: - description: 'relatedObjects is a list of objects that are "interesting" or related to this operator. Common uses are: 1. the detailed resource driving the operator 2. operator namespaces 3. operand namespaces 4. related ClusterManagementAddon resource' - type: array - items: - description: ObjectReference contains enough information to let you inspect or modify the referred object. - type: object - required: - - group - - name - - resource - properties: - group: - description: group of the referent. - type: string - name: - description: name of the referent. - type: string - namespace: - description: namespace of the referent. - type: string - resource: - description: resource of the referent. - type: string - supportedConfigs: - description: SupportedConfigs is a list of configuration types that are allowed to override the add-on configurations defined in ClusterManagementAddOn spec. The default is an empty list, which means the add-on configurations can not be overridden. - type: array - items: - description: ConfigGroupResource represents the GroupResource of the add-on configuration - type: object - required: - - resource - properties: - group: - description: group of the add-on configuration. - type: string - default: "" - resource: - description: resource of the add-on configuration. - type: string - minLength: 1 - x-kubernetes-list-map-keys: - - group - - resource - x-kubernetes-list-type: map - served: true - storage: true - subresources: - status: {} + type: array + organizationUnit: + description: organizationUnit is the ou of the addon agent + items: + type: string + type: array + user: + description: user is the user name of the addon agent. + type: string + type: object + type: object + type: array + relatedObjects: + description: 'relatedObjects is a list of objects that are "interesting" + or related to this operator. Common uses are: 1. the detailed resource + driving the operator 2. operator namespaces 3. operand namespaces + 4. related ClusterManagementAddon resource' + items: + description: ObjectReference contains enough information to let + you inspect or modify the referred object. + properties: + group: + description: group of the referent. + type: string + name: + description: name of the referent. + type: string + namespace: + description: namespace of the referent. + type: string + resource: + description: resource of the referent. + type: string + required: + - group + - name + - resource + type: object + type: array + supportedConfigs: + description: SupportedConfigs is a list of configuration types that + are allowed to override the add-on configurations defined in ClusterManagementAddOn + spec. The default is an empty list, which means the add-on configurations + can not be overridden. + items: + description: ConfigGroupResource represents the GroupResource of + the add-on configuration + properties: + group: + default: "" + description: group of the add-on configuration. + type: string + resource: + description: resource of the add-on configuration. + minLength: 1 + type: string + required: + - resource + type: object + type: array + x-kubernetes-list-map-keys: + - group + - resource + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml index 0707f403c..47eb4e5bb 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/0000_02_addon.open-cluster-management.io_addondeploymentconfigs.crd.yaml @@ -9,82 +9,119 @@ spec: listKind: AddOnDeploymentConfigList plural: addondeploymentconfigs singular: addondeploymentconfig - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: AddOnDeploymentConfig represents a deployment configuration for an add-on. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: spec represents a desired configuration for an add-on. - type: object - properties: - customizedVariables: - description: CustomizedVariables is a list of name-value variables for the current add-on deployment. The add-on implementation can use these variables to render its add-on deployment. The default is an empty list. - type: array - items: - description: CustomizedVariable represents a customized variable for add-on deployment. - type: object - required: - - name - properties: - name: - description: Name of this variable. - type: string - maxLength: 255 - pattern: ^[a-zA-Z_][_a-zA-Z0-9]*$ - value: - description: Value of this variable. - type: string - maxLength: 1024 - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - nodePlacement: - description: NodePlacement enables explicit control over the scheduling of the add-on agents on the managed cluster. All add-on agent pods are expected to comply with this node placement. If the placement is nil, the placement is not specified, it will be omitted. If the placement is an empty object, the placement will match all nodes and tolerate nothing. - type: object + - name: v1alpha1 + schema: + openAPIV3Schema: + description: AddOnDeploymentConfig represents a deployment configuration for + an add-on. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: spec represents a desired configuration for an add-on. + properties: + customizedVariables: + description: CustomizedVariables is a list of name-value variables + for the current add-on deployment. The add-on implementation can + use these variables to render its add-on deployment. The default + is an empty list. + items: + description: CustomizedVariable represents a customized variable + for add-on deployment. properties: - nodeSelector: - description: NodeSelector defines which Nodes the Pods are scheduled on. If the selector is an empty list, it will match all nodes. The default is an empty list. + name: + description: Name of this variable. + maxLength: 255 + pattern: ^[a-zA-Z_][_a-zA-Z0-9]*$ + type: string + value: + description: Value of this variable. + maxLength: 1024 + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + nodePlacement: + description: NodePlacement enables explicit control over the scheduling + of the add-on agents on the managed cluster. All add-on agent pods + are expected to comply with this node placement. If the placement + is nil, the placement is not specified, it will be omitted. If the + placement is an empty object, the placement will match all nodes + and tolerate nothing. + properties: + nodeSelector: + additionalProperties: + type: string + description: NodeSelector defines which Nodes the Pods are scheduled + on. If the selector is an empty list, it will match all nodes. + The default is an empty list. + type: object + tolerations: + description: Tolerations is attached by pods to tolerate any taint + that matches the triple using the matching + operator . If the tolerations is an empty list, it + will tolerate nothing. The default is an empty list. + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, allowed + values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to + the value. Valid operators are Exists and Equal. Defaults + to Equal. Exists is equivalent to wildcard for value, + so that a pod can tolerate all taints of a particular + category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the taint + forever (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string type: object - additionalProperties: - type: string - tolerations: - description: Tolerations is attached by pods to tolerate any taint that matches the triple using the matching operator . If the tolerations is an empty list, it will tolerate nothing. The default is an empty list. - type: array - items: - description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - type: object - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. - type: integer - format: int64 - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - served: true - storage: true + type: array + type: object + type: object + type: object + served: true + storage: true status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go index c62226aac..dd96cc2e6 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_clustermanagementaddon.go @@ -2,6 +2,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" ) // +genclient @@ -127,6 +128,15 @@ type ConfigReferent struct { Name string `json:"name"` } +// ConfigSpecHash represents the namespace,name and spec hash for an add-on configuration. +type ConfigSpecHash struct { + // namespace and name for an add-on configuration. + ConfigReferent `json:",inline"` + + // spec hash for an add-on configuration. + SpecHash string `json:"specHash"` +} + // InstallStrategy represents that related ManagedClusterAddOns should be installed // on certain clusters. type InstallStrategy struct { @@ -151,9 +161,9 @@ type InstallStrategy struct { const ( // AddonInstallStrategyManual is the addon install strategy representing no automatic addon installation AddonInstallStrategyManual string = "Manual" - // AddonInstallStrategyManualPlacements is the addon install strategy representing the addon installation + // AddonInstallStrategyPlacements is the addon install strategy representing the addon installation // is based on placement decisions. - AddonInstallStrategyManualPlacements string = "Placements" + AddonInstallStrategyPlacements string = "Placements" ) type PlacementRef struct { @@ -175,10 +185,146 @@ type PlacementStrategy struct { // User can override the configuration by updating the managedClusterAddon directly. // +optional Configs []AddOnConfig `json:"configs,omitempty"` + // The rollout strategy to apply addon configurations change. + // The rollout strategy only watches the addon configurations defined in ClusterManagementAddOn. + // +kubebuilder:default={type: UpdateAll} + // +optional + RolloutStrategy RolloutStrategy `json:"rolloutStrategy,omitempty"` +} + +// RolloutStrategy represents the rollout strategy of the add-on configuration. +type RolloutStrategy struct { + // Type is the type of the rollout strategy, it supports UpdateAll, RollingUpdate and RollingUpdateWithCanary: + // - UpdateAll: when configs change, apply the new configs to all the selected clusters at once. + // This is the default strategy. + // - RollingUpdate: when configs change, apply the new configs to all the selected clusters with + // the concurrence rate defined in MaxConcurrency. + // - RollingUpdateWithCanary: when configs change, wait and check if add-ons on the canary placement + // selected clusters have applied the new configs and are healthy, then apply the new configs to + // all the selected clusters with the concurrence rate defined in MaxConcurrency. + // + // The field lastKnownGoodConfig in the status record the last successfully applied + // spec hash of canary placement. If the config spec hash changes after the canary is passed and + // before the rollout is done, the current rollout will continue, then roll out to the latest change. + // + // For example, the addon configs have spec hash A. The canary is passed and the lastKnownGoodConfig + // would be A, and all the selected clusters are rolling out to A. + // Then the config spec hash changes to B. At this time, the clusters will continue rolling out to A. + // When the rollout is done and canary passed B, the lastKnownGoodConfig would be B and + // all the clusters will start rolling out to B. + // + // The canary placement does not have to be a subset of the install placement, and it is more like a + // reference for finding and checking canary clusters before upgrading all. To trigger the rollout + // on the canary clusters, you can define another rollout strategy with the type RollingUpdate, or even + // manually upgrade the addons on those clusters. + // + // +kubebuilder:validation:Enum=UpdateAll;RollingUpdate;RollingUpdateWithCanary + // +kubebuilder:default:=UpdateAll + // +optional + Type string `json:"type"` + + // Rolling update with placement config params. Present only if the type is RollingUpdate. + // +optional + RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"` + + // Rolling update with placement config params. Present only if the type is RollingUpdateWithCanary. + // +optional + RollingUpdateWithCanary *RollingUpdateWithCanary `json:"rollingUpdateWithCanary,omitempty"` +} + +const ( + // AddonRolloutStrategyUpdateAll is the addon rollout strategy representing apply the new configs to + // all the selected clusters at once. + AddonRolloutStrategyUpdateAll string = "UpdateAll" + // AddonRolloutStrategyRollingUpdate is the addon rollout strategy representing apply the new configs to + // all the selected clusters with the concurrency rate. + AddonRolloutStrategyRollingUpdate string = "RollingUpdate" + // AddonRolloutStrategyRollingUpdate is the addon rollout strategy representing wait and check + // if add-ons on the canary have applied the new configs, then apply the new configs to + // all the selected clusters with the concurrency rate. + AddonRolloutStrategyRollingUpdateWithCanary string = "RollingUpdateWithCanary" +) + +// RollingUpdate represents the behavior to rolling update add-on configurations +// on the selected clusters. +type RollingUpdate struct { + // The maximum concurrently updating number of clusters. + // Value can be an absolute number (ex: 5) or a percentage of desired addons (ex: 10%). + // Absolute number is calculated from percentage by rounding up. + // Defaults to 25%. + // Example: when this is set to 30%, once the addon configs change, the addon on 30% of the selected clusters + // will adopt the new configs. When the addons with new configs are healthy, the addon on the remaining clusters + // will be further updated. + // +kubebuilder:default:="25%" + // +optional + MaxConcurrency intstr.IntOrString `json:"maxConcurrency,omitempty"` +} + +// RollingUpdateWithCanary represents the canary placement and behavior to rolling update add-on configurations +// on the selected clusters. +type RollingUpdateWithCanary struct { + // Canary placement reference. + // +kubebuilder:validation:Required + // +required + Placement PlacementRef `json:"placement,omitempty"` + + // the behavior to rolling update add-on configurations. + RollingUpdate `json:",inline"` } // ClusterManagementAddOnStatus represents the current status of cluster management add-on. type ClusterManagementAddOnStatus struct { + // defaultconfigReferences is a list of current add-on default configuration references. + // +optional + DefaultConfigReferences []DefaultConfigReference `json:"defaultconfigReferences,omitempty"` + // installProgression is a list of current add-on configuration references per placement. + // +optional + InstallProgressions []InstallProgression `json:"installProgressions,omitempty"` +} + +type InstallProgression struct { + PlacementRef `json:",inline"` + + // configReferences is a list of current add-on configuration references. + // +optional + ConfigReferences []InstallConfigReference `json:"configReferences,omitempty"` + + // conditions describe the state of the managed and monitored components for the operator. + // +patchMergeKey=type + // +patchStrategy=merge + // +optional + Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` +} + +// DefaultConfigReference is a reference to the current add-on configuration. +// This resource is used to record the configuration resource for the current add-on. +type DefaultConfigReference struct { + // This field is synced from ClusterManagementAddOn Configurations. + ConfigGroupResource `json:",inline"` + + // desiredConfig record the desired config spec hash. + DesiredConfig *ConfigSpecHash `json:"desiredConfig"` +} + +// InstallConfigReference is a reference to the current add-on configuration. +// This resource is used to record the configuration resource for the current add-on. +type InstallConfigReference struct { + // This field is synced from ClusterManagementAddOn Configurations. + ConfigGroupResource `json:",inline"` + + // desiredConfig record the desired config name and spec hash. + DesiredConfig *ConfigSpecHash `json:"desiredConfig"` + + // lastKnownGoodConfig records the last known good config spec hash. + // For fresh install or rollout with type UpdateAll or RollingUpdate, the + // lastKnownGoodConfig is the same as lastAppliedConfig. + // For rollout with type RollingUpdateWithCanary, the lastKnownGoodConfig + // is the last successfully applied config spec hash of the canary placement. + LastKnownGoodConfig *ConfigSpecHash `json:"lastKnownGoodConfig"` + + // lastAppliedConfig records the config spec hash when the all the corresponding + // ManagedClusterAddOn are applied successfully. + LastAppliedConfig *ConfigSpecHash `json:"lastAppliedConfig"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go index 517902868..b986e219c 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/types_managedclusteraddon.go @@ -180,13 +180,23 @@ type ConfigReference struct { // This field is synced from ClusterManagementAddOn configGroupResource field. ConfigGroupResource `json:",inline"` + // Deprecated: Use DesiredConfig instead // This field is synced from ClusterManagementAddOn defaultConfig and ManagedClusterAddOn config fields. // If both of them are defined, the ManagedClusterAddOn configs will overwrite the ClusterManagementAddOn // defaultConfigs. ConfigReferent `json:",inline"` + // Deprecated: Use LastAppliedConfig instead // lastObservedGeneration is the observed generation of the add-on configuration. LastObservedGeneration int64 `json:"lastObservedGeneration"` + + // desiredConfig record the desired config spec hash. + // +optional + DesiredConfig *ConfigSpecHash `json:"desiredConfig"` + + // lastAppliedConfig record the config spec hash when the corresponding ManifestWork is applied successfully. + // +optional + LastAppliedConfig *ConfigSpecHash `json:"lastAppliedConfig"` } // HealthCheckMode indicates the mode for the addon to check its healthiness status @@ -305,9 +315,13 @@ const ( // the managed cluster. ManagedClusterAddOnConditionDegraded string = "Degraded" + // Deprecated: Use ManagedClusterAddOnConditionProgressing instead // ManagedClusterAddOnConditionConfigured represents that the addon agent is configured with its configuration ManagedClusterAddOnConditionConfigured string = "Configured" + // ManagedClusterAddOnConditionProgressing represents that the addon agent is applying configurations. + ManagedClusterAddOnConditionProgressing string = "Progressing" + // ManagedClusterAddOnManifestApplied is a condition type representing whether the manifest of an addon is // applied correctly. ManagedClusterAddOnManifestApplied = "ManifestApplied" diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go index e427a60e1..8f0bfcbaf 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.deepcopy.go @@ -137,7 +137,7 @@ func (in *ClusterManagementAddOn) DeepCopyInto(out *ClusterManagementAddOn) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) return } @@ -221,6 +221,20 @@ func (in *ClusterManagementAddOnSpec) DeepCopy() *ClusterManagementAddOnSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterManagementAddOnStatus) DeepCopyInto(out *ClusterManagementAddOnStatus) { *out = *in + if in.DefaultConfigReferences != nil { + in, out := &in.DefaultConfigReferences, &out.DefaultConfigReferences + *out = make([]DefaultConfigReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InstallProgressions != nil { + in, out := &in.InstallProgressions, &out.InstallProgressions + *out = make([]InstallProgression, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } return } @@ -293,6 +307,16 @@ func (in *ConfigReference) DeepCopyInto(out *ConfigReference) { *out = *in out.ConfigGroupResource = in.ConfigGroupResource out.ConfigReferent = in.ConfigReferent + if in.DesiredConfig != nil { + in, out := &in.DesiredConfig, &out.DesiredConfig + *out = new(ConfigSpecHash) + **out = **in + } + if in.LastAppliedConfig != nil { + in, out := &in.LastAppliedConfig, &out.LastAppliedConfig + *out = new(ConfigSpecHash) + **out = **in + } return } @@ -322,6 +346,23 @@ func (in *ConfigReferent) DeepCopy() *ConfigReferent { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigSpecHash) DeepCopyInto(out *ConfigSpecHash) { + *out = *in + out.ConfigReferent = in.ConfigReferent + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSpecHash. +func (in *ConfigSpecHash) DeepCopy() *ConfigSpecHash { + if in == nil { + return nil + } + out := new(ConfigSpecHash) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CustomizedVariable) DeepCopyInto(out *CustomizedVariable) { *out = *in @@ -338,6 +379,28 @@ func (in *CustomizedVariable) DeepCopy() *CustomizedVariable { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DefaultConfigReference) DeepCopyInto(out *DefaultConfigReference) { + *out = *in + out.ConfigGroupResource = in.ConfigGroupResource + if in.DesiredConfig != nil { + in, out := &in.DesiredConfig, &out.DesiredConfig + *out = new(ConfigSpecHash) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefaultConfigReference. +func (in *DefaultConfigReference) DeepCopy() *DefaultConfigReference { + if in == nil { + return nil + } + out := new(DefaultConfigReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HealthCheck) DeepCopyInto(out *HealthCheck) { *out = *in @@ -354,6 +417,69 @@ func (in *HealthCheck) DeepCopy() *HealthCheck { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallConfigReference) DeepCopyInto(out *InstallConfigReference) { + *out = *in + out.ConfigGroupResource = in.ConfigGroupResource + if in.DesiredConfig != nil { + in, out := &in.DesiredConfig, &out.DesiredConfig + *out = new(ConfigSpecHash) + **out = **in + } + if in.LastKnownGoodConfig != nil { + in, out := &in.LastKnownGoodConfig, &out.LastKnownGoodConfig + *out = new(ConfigSpecHash) + **out = **in + } + if in.LastAppliedConfig != nil { + in, out := &in.LastAppliedConfig, &out.LastAppliedConfig + *out = new(ConfigSpecHash) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallConfigReference. +func (in *InstallConfigReference) DeepCopy() *InstallConfigReference { + if in == nil { + return nil + } + out := new(InstallConfigReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallProgression) DeepCopyInto(out *InstallProgression) { + *out = *in + out.PlacementRef = in.PlacementRef + if in.ConfigReferences != nil { + in, out := &in.ConfigReferences, &out.ConfigReferences + *out = make([]InstallConfigReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallProgression. +func (in *InstallProgression) DeepCopy() *InstallProgression { + if in == nil { + return nil + } + out := new(InstallProgression) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *InstallStrategy) DeepCopyInto(out *InstallStrategy) { *out = *in @@ -484,7 +610,9 @@ func (in *ManagedClusterAddOnStatus) DeepCopyInto(out *ManagedClusterAddOnStatus if in.ConfigReferences != nil { in, out := &in.ConfigReferences, &out.ConfigReferences *out = make([]ConfigReference, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.Registrations != nil { in, out := &in.Registrations, &out.Registrations @@ -578,6 +706,7 @@ func (in *PlacementStrategy) DeepCopyInto(out *PlacementStrategy) { *out = make([]AddOnConfig, len(*in)) copy(*out, *in) } + in.RolloutStrategy.DeepCopyInto(&out.RolloutStrategy) return } @@ -608,6 +737,67 @@ func (in *RegistrationConfig) DeepCopy() *RegistrationConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RollingUpdate) DeepCopyInto(out *RollingUpdate) { + *out = *in + out.MaxConcurrency = in.MaxConcurrency + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollingUpdate. +func (in *RollingUpdate) DeepCopy() *RollingUpdate { + if in == nil { + return nil + } + out := new(RollingUpdate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RollingUpdateWithCanary) DeepCopyInto(out *RollingUpdateWithCanary) { + *out = *in + out.Placement = in.Placement + out.RollingUpdate = in.RollingUpdate + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollingUpdateWithCanary. +func (in *RollingUpdateWithCanary) DeepCopy() *RollingUpdateWithCanary { + if in == nil { + return nil + } + out := new(RollingUpdateWithCanary) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RolloutStrategy) DeepCopyInto(out *RolloutStrategy) { + *out = *in + if in.RollingUpdate != nil { + in, out := &in.RollingUpdate, &out.RollingUpdate + *out = new(RollingUpdate) + **out = **in + } + if in.RollingUpdateWithCanary != nil { + in, out := &in.RollingUpdateWithCanary, &out.RollingUpdateWithCanary + *out = new(RollingUpdateWithCanary) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStrategy. +func (in *RolloutStrategy) DeepCopy() *RolloutStrategy { + if in == nil { + return nil + } + out := new(RolloutStrategy) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Subject) DeepCopyInto(out *Subject) { *out = *in diff --git a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go index d5ec1519b..c0e3c9200 100644 --- a/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/vendor/open-cluster-management.io/api/addon/v1alpha1/zz_generated.swagger_doc_generated.go @@ -102,7 +102,9 @@ func (ClusterManagementAddOnSpec) SwaggerDoc() map[string]string { } var map_ClusterManagementAddOnStatus = map[string]string{ - "": "ClusterManagementAddOnStatus represents the current status of cluster management add-on.", + "": "ClusterManagementAddOnStatus represents the current status of cluster management add-on.", + "defaultconfigReferences": "defaultconfigReferences is a list of current add-on default configuration references.", + "installProgressions": "installProgression is a list of current add-on configuration references per placement.", } func (ClusterManagementAddOnStatus) SwaggerDoc() map[string]string { @@ -149,6 +151,44 @@ func (ConfigReferent) SwaggerDoc() map[string]string { return map_ConfigReferent } +var map_ConfigSpecHash = map[string]string{ + "": "ConfigSpecHash represents the namespace,name and spec hash for an add-on configuration.", + "specHash": "spec hash for an add-on configuration.", +} + +func (ConfigSpecHash) SwaggerDoc() map[string]string { + return map_ConfigSpecHash +} + +var map_DefaultConfigReference = map[string]string{ + "": "DefaultConfigReference is a reference to the current add-on configuration. This resource is used to record the configuration resource for the current add-on.", + "desiredConfig": "desiredConfig record the desired config spec hash.", +} + +func (DefaultConfigReference) SwaggerDoc() map[string]string { + return map_DefaultConfigReference +} + +var map_InstallConfigReference = map[string]string{ + "": "InstallConfigReference is a reference to the current add-on configuration. This resource is used to record the configuration resource for the current add-on.", + "desiredConfig": "desiredConfig record the desired config name and spec hash.", + "lastKnownGoodConfig": "lastKnownGoodConfig records the last known good config spec hash. For fresh install or rollout with type UpdateAll or RollingUpdate, the lastKnownGoodConfig is the same as lastAppliedConfig. For rollout with type RollingUpdateWithCanary, the lastKnownGoodConfig is the last successfully applied config spec hash of the canary placement.", + "lastAppliedConfig": "lastAppliedConfig records the config spec hash when the all the corresponding ManagedClusterAddOn are applied successfully.", +} + +func (InstallConfigReference) SwaggerDoc() map[string]string { + return map_InstallConfigReference +} + +var map_InstallProgression = map[string]string{ + "configReferences": "configReferences is a list of current add-on configuration references.", + "conditions": "conditions describe the state of the managed and monitored components for the operator.", +} + +func (InstallProgression) SwaggerDoc() map[string]string { + return map_InstallProgression +} + var map_InstallStrategy = map[string]string{ "": "InstallStrategy represents that related ManagedClusterAddOns should be installed on certain clusters.", "type": "Type is the type of the install strategy, it can be: - Manual: no automatic install - Placements: install to clusters selected by placements.", @@ -169,16 +209,48 @@ func (PlacementRef) SwaggerDoc() map[string]string { } var map_PlacementStrategy = map[string]string{ - "configs": "Configs is the configuration of managedClusterAddon during installation. User can override the configuration by updating the managedClusterAddon directly.", + "configs": "Configs is the configuration of managedClusterAddon during installation. User can override the configuration by updating the managedClusterAddon directly.", + "rolloutStrategy": "The rollout strategy to apply addon configurations change. The rollout strategy only watches the addon configurations defined in ClusterManagementAddOn.", } func (PlacementStrategy) SwaggerDoc() map[string]string { return map_PlacementStrategy } +var map_RollingUpdate = map[string]string{ + "": "RollingUpdate represents the behavior to rolling update add-on configurations on the selected clusters.", + "maxConcurrency": "The maximum concurrently updating number of clusters. Value can be an absolute number (ex: 5) or a percentage of desired addons (ex: 10%). Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, once the addon configs change, the addon on 30% of the selected clusters will adopt the new configs. When the addons with new configs are healthy, the addon on the remaining clusters will be further updated.", +} + +func (RollingUpdate) SwaggerDoc() map[string]string { + return map_RollingUpdate +} + +var map_RollingUpdateWithCanary = map[string]string{ + "": "RollingUpdateWithCanary represents the canary placement and behavior to rolling update add-on configurations on the selected clusters.", + "placement": "Canary placement reference.", +} + +func (RollingUpdateWithCanary) SwaggerDoc() map[string]string { + return map_RollingUpdateWithCanary +} + +var map_RolloutStrategy = map[string]string{ + "": "RolloutStrategy represents the rollout strategy of the add-on configuration.", + "type": "Type is the type of the rollout strategy, it supports UpdateAll, RollingUpdate and RollingUpdateWithCanary: - UpdateAll: when configs change, apply the new configs to all the selected clusters at once.\n This is the default strategy.\n- RollingUpdate: when configs change, apply the new configs to all the selected clusters with\n the concurrence rate defined in MaxConcurrency.\n- RollingUpdateWithCanary: when configs change, wait and check if add-ons on the canary placement\n selected clusters have applied the new configs and are healthy, then apply the new configs to\n all the selected clusters with the concurrence rate defined in MaxConcurrency.\n\n The field lastKnownGoodConfig in the status record the last successfully applied\n spec hash of canary placement. If the config spec hash changes after the canary is passed and\n before the rollout is done, the current rollout will continue, then roll out to the latest change.\n\n For example, the addon configs have spec hash A. The canary is passed and the lastKnownGoodConfig\n would be A, and all the selected clusters are rolling out to A.\n Then the config spec hash changes to B. At this time, the clusters will continue rolling out to A.\n When the rollout is done and canary passed B, the lastKnownGoodConfig would be B and\n all the clusters will start rolling out to B.\n\n The canary placement does not have to be a subset of the install placement, and it is more like a\n reference for finding and checking canary clusters before upgrading all. To trigger the rollout\n on the canary clusters, you can define another rollout strategy with the type RollingUpdate, or even\n manually upgrade the addons on those clusters.", + "rollingUpdate": "Rolling update with placement config params. Present only if the type is RollingUpdate.", + "rollingUpdateWithCanary": "Rolling update with placement config params. Present only if the type is RollingUpdateWithCanary.", +} + +func (RolloutStrategy) SwaggerDoc() map[string]string { + return map_RolloutStrategy +} + var map_ConfigReference = map[string]string{ "": "ConfigReference is a reference to the current add-on configuration. This resource is used to locate the configuration resource for the current add-on.", - "lastObservedGeneration": "lastObservedGeneration is the observed generation of the add-on configuration.", + "lastObservedGeneration": "Deprecated: Use LastAppliedConfig instead lastObservedGeneration is the observed generation of the add-on configuration.", + "desiredConfig": "desiredConfig record the desired config spec hash.", + "lastAppliedConfig": "lastAppliedConfig record the config spec hash when the corresponding ManifestWork is applied successfully.", } func (ConfigReference) SwaggerDoc() map[string]string { diff --git a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/clientset.go b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/clientset.go index 49a244d9b..5b2f35b30 100644 --- a/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/clientset.go +++ b/vendor/open-cluster-management.io/api/client/addon/clientset/versioned/clientset.go @@ -17,8 +17,7 @@ type Interface interface { AddonV1alpha1() addonv1alpha1.AddonV1alpha1Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient addonV1alpha1 *addonv1alpha1.AddonV1alpha1Client diff --git a/vendor/open-cluster-management.io/api/client/addon/informers/externalversions/factory.go b/vendor/open-cluster-management.io/api/client/addon/informers/externalversions/factory.go index 383bd4816..3132431b9 100644 --- a/vendor/open-cluster-management.io/api/client/addon/informers/externalversions/factory.go +++ b/vendor/open-cluster-management.io/api/client/addon/informers/externalversions/factory.go @@ -31,6 +31,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -91,20 +96,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -151,11 +175,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Addon() addon.Interface } diff --git a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go index 042fe684d..ef2beaaed 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go +++ b/vendor/open-cluster-management.io/api/client/cluster/clientset/versioned/clientset.go @@ -23,8 +23,7 @@ type Interface interface { ClusterV1beta2() clusterv1beta2.ClusterV1beta2Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient clusterV1 *clusterv1.ClusterV1Client diff --git a/vendor/open-cluster-management.io/api/client/cluster/informers/externalversions/factory.go b/vendor/open-cluster-management.io/api/client/cluster/informers/externalversions/factory.go index a00706a48..f35711312 100644 --- a/vendor/open-cluster-management.io/api/client/cluster/informers/externalversions/factory.go +++ b/vendor/open-cluster-management.io/api/client/cluster/informers/externalversions/factory.go @@ -31,6 +31,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -91,20 +96,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -151,11 +175,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Cluster() cluster.Interface } diff --git a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go index b23452dad..69bd030e1 100644 --- a/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go +++ b/vendor/open-cluster-management.io/api/client/work/clientset/versioned/clientset.go @@ -19,8 +19,7 @@ type Interface interface { WorkV1alpha1() workv1alpha1.WorkV1alpha1Interface } -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. +// Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient workV1 *workv1.WorkV1Client diff --git a/vendor/open-cluster-management.io/api/client/work/informers/externalversions/factory.go b/vendor/open-cluster-management.io/api/client/work/informers/externalversions/factory.go index 9aa177437..38394a2c9 100644 --- a/vendor/open-cluster-management.io/api/client/work/informers/externalversions/factory.go +++ b/vendor/open-cluster-management.io/api/client/work/informers/externalversions/factory.go @@ -31,6 +31,11 @@ type sharedInformerFactory struct { // startedInformers is used for tracking which informers have been started. // This allows Start() to be called multiple times safely. startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool } // WithCustomResyncConfig sets a custom resync period for the specified informer types. @@ -91,20 +96,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy return factory } -// Start initializes all requested informers. func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { f.lock.Lock() defer f.lock.Unlock() + if f.shuttingDown { + return + } + for informerType, informer := range f.informers { if !f.startedInformers[informerType] { - go informer.Run(stopCh) + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() f.startedInformers[informerType] = true } } } -// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { informers := func() map[reflect.Type]cache.SharedIndexInformer { f.lock.Lock() @@ -151,11 +175,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal // SharedInformerFactory provides shared informers for resources in all known // API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) type SharedInformerFactory interface { internalinterfaces.SharedInformerFactory - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Work() work.Interface } diff --git a/vendor/open-cluster-management.io/api/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml index 4173576f8..88fbe6ae5 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1/0000_00_clusters.open-cluster-management.io_managedclusters.crd.yaml @@ -9,193 +9,274 @@ spec: listKind: ManagedClusterList plural: managedclusters shortNames: - - mcl - - mcls + - mcl + - mcls singular: managedcluster - scope: Cluster preserveUnknownFields: false + scope: Cluster versions: - - additionalPrinterColumns: - - jsonPath: .spec.hubAcceptsClient - name: Hub Accepted - type: boolean - - jsonPath: .spec.managedClusterClientConfigs[*].url - name: Managed Cluster URLs - type: string - - jsonPath: .status.conditions[?(@.type=="ManagedClusterJoined")].status - name: Joined - type: string - - jsonPath: .status.conditions[?(@.type=="ManagedClusterConditionAvailable")].status - name: Available - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1 - schema: - openAPIV3Schema: - description: "ManagedCluster represents the desired state and current status of managed cluster. ManagedCluster is a cluster scoped resource. The name is the cluster UID. \n The cluster join process follows a double opt-in process: \n 1. Agent on managed cluster creates CSR on hub with cluster UID and agent name. 2. Agent on managed cluster creates ManagedCluster on hub. 3. Cluster admin on hub approves the CSR for UID and agent name of the ManagedCluster. 4. Cluster admin sets spec.acceptClient of ManagedCluster to true. 5. Cluster admin on managed cluster creates credential of kubeconfig to hub. \n Once the hub creates the cluster namespace, the Klusterlet agent on the ManagedCluster pushes the credential to the hub to use against the kube-apiserver of the ManagedCluster." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec represents a desired configuration for the agent on the managed cluster. - type: object - properties: - hubAcceptsClient: - description: hubAcceptsClient represents that hub accepts the joining of Klusterlet agent on the managed cluster with the hub. The default value is false, and can only be set true when the user on hub has an RBAC rule to UPDATE on the virtual subresource of managedclusters/accept. When the value is set true, a namespace whose name is the same as the name of ManagedCluster is created on the hub. This namespace represents the managed cluster, also role/rolebinding is created on the namespace to grant the permision of access from the agent on the managed cluster. When the value is set to false, the namespace representing the managed cluster is deleted. - type: boolean - leaseDurationSeconds: - description: LeaseDurationSeconds is used to coordinate the lease update time of Klusterlet agents on the managed cluster. If its value is zero, the Klusterlet agent will update its lease every 60 seconds by default - type: integer - format: int32 - default: 60 - managedClusterClientConfigs: - description: ManagedClusterClientConfigs represents a list of the apiserver address of the managed cluster. If it is empty, the managed cluster has no accessible address for the hub to connect with it. - type: array - items: - description: ClientConfig represents the apiserver address of the managed cluster. TODO include credential to connect to managed cluster kube-apiserver - type: object - properties: - caBundle: - description: CABundle is the ca bundle to connect to apiserver of the managed cluster. System certs are used if it is not set. - type: string - format: byte - url: - description: URL is the URL of apiserver endpoint of the managed cluster. - type: string - taints: - description: Taints is a property of managed cluster that allow the cluster to be repelled when scheduling. Taints, including 'ManagedClusterUnavailable' and 'ManagedClusterUnreachable', can not be added/removed by agent running on the managed cluster; while it's fine to add/remove other taints from either hub cluser or managed cluster. - type: array - items: - description: The managed cluster this Taint is attached to has the "effect" on any placement that does not tolerate the Taint. - type: object - required: - - effect - - key - properties: - effect: - description: Effect indicates the effect of the taint on placements that do not tolerate the taint. Valid effects are NoSelect, PreferNoSelect and NoSelectIfNew. - type: string - enum: - - NoSelect - - PreferNoSelect - - NoSelectIfNew - key: - description: Key is the taint key applied to a cluster. e.g. bar or foo.example.com/bar. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - timeAdded: - description: TimeAdded represents the time at which the taint was added. - type: string - format: date-time - nullable: true - value: - description: Value is the taint value corresponding to the taint key. - type: string - maxLength: 1024 - status: - description: Status represents the current status of joined managed cluster - type: object - properties: - allocatable: - description: Allocatable represents the total allocatable resources on the managed cluster. + - additionalPrinterColumns: + - jsonPath: .spec.hubAcceptsClient + name: Hub Accepted + type: boolean + - jsonPath: .spec.managedClusterClientConfigs[*].url + name: Managed Cluster URLs + type: string + - jsonPath: .status.conditions[?(@.type=="ManagedClusterJoined")].status + name: Joined + type: string + - jsonPath: .status.conditions[?(@.type=="ManagedClusterConditionAvailable")].status + name: Available + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1 + schema: + openAPIV3Schema: + description: "ManagedCluster represents the desired state and current status + of managed cluster. ManagedCluster is a cluster scoped resource. The name + is the cluster UID. \n The cluster join process follows a double opt-in + process: \n 1. Agent on managed cluster creates CSR on hub with cluster + UID and agent name. 2. Agent on managed cluster creates ManagedCluster on + hub. 3. Cluster admin on hub approves the CSR for UID and agent name of + the ManagedCluster. 4. Cluster admin sets spec.acceptClient of ManagedCluster + to true. 5. Cluster admin on managed cluster creates credential of kubeconfig + to hub. \n Once the hub creates the cluster namespace, the Klusterlet agent + on the ManagedCluster pushes the credential to the hub to use against the + kube-apiserver of the ManagedCluster." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec represents a desired configuration for the agent on + the managed cluster. + properties: + hubAcceptsClient: + description: hubAcceptsClient represents that hub accepts the joining + of Klusterlet agent on the managed cluster with the hub. The default + value is false, and can only be set true when the user on hub has + an RBAC rule to UPDATE on the virtual subresource of managedclusters/accept. + When the value is set true, a namespace whose name is the same as + the name of ManagedCluster is created on the hub. This namespace + represents the managed cluster, also role/rolebinding is created + on the namespace to grant the permision of access from the agent + on the managed cluster. When the value is set to false, the namespace + representing the managed cluster is deleted. + type: boolean + leaseDurationSeconds: + default: 60 + description: LeaseDurationSeconds is used to coordinate the lease + update time of Klusterlet agents on the managed cluster. If its + value is zero, the Klusterlet agent will update its lease every + 60 seconds by default + format: int32 + type: integer + managedClusterClientConfigs: + description: ManagedClusterClientConfigs represents a list of the + apiserver address of the managed cluster. If it is empty, the managed + cluster has no accessible address for the hub to connect with it. + items: + description: ClientConfig represents the apiserver address of the + managed cluster. TODO include credential to connect to managed + cluster kube-apiserver + properties: + caBundle: + description: CABundle is the ca bundle to connect to apiserver + of the managed cluster. System certs are used if it is not + set. + format: byte + type: string + url: + description: URL is the URL of apiserver endpoint of the managed + cluster. + type: string type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - capacity: - description: Capacity represents the total resource capacity from all nodeStatuses on the managed cluster. + type: array + taints: + description: Taints is a property of managed cluster that allow the + cluster to be repelled when scheduling. Taints, including 'ManagedClusterUnavailable' + and 'ManagedClusterUnreachable', can not be added/removed by agent + running on the managed cluster; while it's fine to add/remove other + taints from either hub cluser or managed cluster. + items: + description: The managed cluster this Taint is attached to has the + "effect" on any placement that does not tolerate the Taint. + properties: + effect: + description: Effect indicates the effect of the taint on placements + that do not tolerate the taint. Valid effects are NoSelect, + PreferNoSelect and NoSelectIfNew. + enum: + - NoSelect + - PreferNoSelect + - NoSelectIfNew + type: string + key: + description: Key is the taint key applied to a cluster. e.g. + bar or foo.example.com/bar. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + timeAdded: + description: TimeAdded represents the time at which the taint + was added. + format: date-time + nullable: true + type: string + value: + description: Value is the taint value corresponding to the taint + key. + maxLength: 1024 + type: string + required: + - effect + - key type: object - additionalProperties: - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - anyOf: - - type: integer - - type: string - x-kubernetes-int-or-string: true - clusterClaims: - description: ClusterClaims represents cluster information that a managed cluster claims, for example a unique cluster identifier (id.k8s.io) and kubernetes version (kubeversion.open-cluster-management.io). They are written from the managed cluster. The set of claims is not uniform across a fleet, some claims can be vendor or version specific and may not be included from all managed clusters. - type: array - items: - description: ManagedClusterClaim represents a ClusterClaim collected from a managed cluster. - type: object - properties: - name: - description: Name is the name of a ClusterClaim resource on managed cluster. It's a well known or customized name to identify the claim. - type: string - maxLength: 253 - minLength: 1 - value: - description: Value is a claim-dependent string - type: string - maxLength: 1024 - minLength: 1 - conditions: - description: Conditions contains the different condition statuses for this managed cluster. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - version: - description: Version represents the kubernetes version of the managed cluster. + type: array + type: object + status: + description: Status represents the current status of joined managed cluster + properties: + allocatable: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Allocatable represents the total allocatable resources + on the managed cluster. + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Capacity represents the total resource capacity from + all nodeStatuses on the managed cluster. + type: object + clusterClaims: + description: ClusterClaims represents cluster information that a managed + cluster claims, for example a unique cluster identifier (id.k8s.io) + and kubernetes version (kubeversion.open-cluster-management.io). + They are written from the managed cluster. The set of claims is + not uniform across a fleet, some claims can be vendor or version + specific and may not be included from all managed clusters. + items: + description: ManagedClusterClaim represents a ClusterClaim collected + from a managed cluster. + properties: + name: + description: Name is the name of a ClusterClaim resource on + managed cluster. It's a well known or customized name to identify + the claim. + maxLength: 253 + minLength: 1 + type: string + value: + description: Value is a claim-dependent string + maxLength: 1024 + minLength: 1 + type: string type: object + type: array + conditions: + description: Conditions contains the different condition statuses + for this managed cluster. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" properties: - kubernetes: - description: Kubernetes is the kubernetes version of managed cluster. + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 type: string - served: true - storage: true - subresources: - status: {} + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + version: + description: Version represents the kubernetes version of the managed + cluster. + properties: + kubernetes: + description: Kubernetes is the kubernetes version of managed cluster. + type: string + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml index 16f883993..5355bb16d 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml @@ -9,34 +9,43 @@ spec: listKind: ClusterClaimList plural: clusterclaims singular: clusterclaim - scope: Cluster preserveUnknownFields: false + scope: Cluster versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of the ClusterClaim. - type: object - properties: - value: - description: Value is a claim-dependent string - type: string - maxLength: 1024 - minLength: 1 - served: true - storage: true + - name: v1alpha1 + schema: + openAPIV3Schema: + description: "ClusterClaim represents cluster information that a managed cluster + claims ClusterClaims with well known names include, 1. id.k8s.io, it contains + a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an + identifier that relates the cluster to the ClusterSet in which it belongs. + \n ClusterClaims created on a managed cluster will be collected and saved + into the status of the corresponding ManagedCluster on hub." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of the ClusterClaim. + properties: + value: + description: Value is a claim-dependent string + maxLength: 1024 + minLength: 1 + type: string + type: object + type: object + served: true + storage: true status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml index e57d15eba..1cfba5564 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0000_05_clusters.open-cluster-management.io_addonplacementscores.crd.yaml @@ -12,101 +12,139 @@ spec: preserveUnknownFields: false scope: Namespaced versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: AddOnPlacementScore represents a bundle of scores of one managed cluster, which could be used by placement. AddOnPlacementScore is a namespace scoped resource. The namespace of the resource is the cluster namespace. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - description: Status represents the status of the AddOnPlacementScore. - type: object - properties: - conditions: - description: Conditions contain the different condition statuses for this AddOnPlacementScore. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - scores: - description: Scores contain a list of score name and value of this managed cluster. - type: array - items: - description: AddOnPlacementScoreItem represents the score name and value. - type: object - required: - - name - - value - properties: - name: - description: Name is the name of the score - type: string - value: - description: Value is the value of the score. The score range is from -100 to 100. - type: integer - format: int32 - maximum: 100 - minimum: -100 - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - validUntil: - description: ValidUntil defines the valid time of the scores. After this time, the scores are considered to be invalid by placement. nil means never expire. The controller owning this resource should keep the scores up-to-date. - type: string - format: date-time - served: true - storage: true - subresources: - status: {} + - name: v1alpha1 + schema: + openAPIV3Schema: + description: AddOnPlacementScore represents a bundle of scores of one managed + cluster, which could be used by placement. AddOnPlacementScore is a namespace + scoped resource. The namespace of the resource is the cluster namespace. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + status: + description: Status represents the status of the AddOnPlacementScore. + properties: + conditions: + description: Conditions contain the different condition statuses for + this AddOnPlacementScore. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + scores: + description: Scores contain a list of score name and value of this + managed cluster. + items: + description: AddOnPlacementScoreItem represents the score name and + value. + properties: + name: + description: Name is the name of the score + type: string + value: + description: Value is the value of the score. The score range + is from -100 to 100. + format: int32 + maximum: 100 + minimum: -100 + type: integer + required: + - name + - value + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + validUntil: + description: ValidUntil defines the valid time of the scores. After + this time, the scores are considered to be invalid by placement. + nil means never expire. The controller owning this resource should + keep the scores up-to-date. + format: date-time + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml deleted file mode 100644 index bba98c653..000000000 --- a/vendor/open-cluster-management.io/api/cluster/v1alpha1/0001_02_clusters.open-cluster-management.io_clusterclaims.crd.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: clusterclaims.cluster.open-cluster-management.io -spec: - group: cluster.open-cluster-management.io - names: - kind: ClusterClaim - listKind: ClusterClaimList - plural: clusterclaims - singular: clusterclaim - scope: Cluster - preserveUnknownFields: false - validation: - openAPIV3Schema: - description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of the ClusterClaim. - type: object - properties: - value: - description: Value is a claim-dependent string - type: string - maxLength: 1024 - minLength: 1 - version: v1alpha1 - versions: - - name: v1alpha1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml index 134e26a69..5ceb4eae9 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml @@ -9,135 +9,196 @@ spec: listKind: ManagedClusterSetList plural: managedclustersets shortNames: - - mclset - - mclsets + - mclset + - mclsets singular: managedclusterset - scope: Cluster preserveUnknownFields: false + scope: Cluster versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status - name: Empty - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of the ManagedClusterSet - type: object - default: - clusterSelector: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status + name: Empty + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: "ManagedClusterSet defines a group of ManagedClusters that user's + workload can run on. A workload can be defined to deployed on a ManagedClusterSet, + which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet + 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet + 3. The service exposed by the workload can be shared in any ManagedCluster + in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian + ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` + on the ManagedCluster to refers to the ManagedClusterSet. User is not allow + to add/remove this label on a ManagedCluster unless they have a RBAC rule + to CREATE on a virtual subresource of managedclustersets/join. In order + to update this label, user must have the permission on both the old and + new ManagedClusterSet." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + default: + clusterSelector: + selectorType: LegacyClusterSetLabel + description: Spec defines the attributes of the ManagedClusterSet + properties: + clusterSelector: + default: selectorType: LegacyClusterSetLabel - properties: - clusterSelector: - description: ClusterSelector represents a selector of ManagedClusters - type: object - default: - selectorType: LegacyClusterSetLabel - properties: - labelSelector: - description: LabelSelector define the general labelSelector which clusterset will use to select target managedClusters - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: ClusterSelector represents a selector of ManagedClusters + properties: + labelSelector: + description: LabelSelector define the general labelSelector which + clusterset will use to select target managedClusters + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If + the operator is In or NotIn, the values array must + be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced + during a strategic merge patch. + items: type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: array + required: + - key + - operator type: object - additionalProperties: - type: string - selectorType: - description: SelectorType could only be "LegacyClusterSetLabel" or "LabelSelector" "LegacyClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use labelSelector to select target managedClusters + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A + single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is "key", + the operator is "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selectorType: + default: LegacyClusterSetLabel + description: SelectorType could only be "LegacyClusterSetLabel" + or "LabelSelector" "LegacyClusterSetLabel" means to use label + "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use + labelSelector to select target managedClusters + enum: + - LegacyClusterSetLabel + - LabelSelector + type: string + type: object + type: object + status: + description: Status represents the current status of the ManagedClusterSet + properties: + conditions: + description: Conditions contains the different condition statuses + for this ManagedClusterSet. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time type: string - default: LegacyClusterSetLabel + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. enum: - - LegacyClusterSetLabel - - LabelSelector - status: - description: Status represents the current status of the ManagedClusterSet - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSet. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: true - subresources: - status: {} + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml index 7a2fc0eb5..359f13f26 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml @@ -9,86 +9,125 @@ spec: listKind: ManagedClusterSetBindingList plural: managedclustersetbindings shortNames: - - mclsetbinding - - mclsetbindings + - mclsetbinding + - mclsetbindings singular: managedclustersetbinding - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - name: v1beta1 - schema: - openAPIV3Schema: - description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of ManagedClusterSetBinding. - type: object - properties: - clusterSet: - description: ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. - type: string - minLength: 1 - status: - description: Status represents the current status of the ManagedClusterSetBinding - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSetBinding. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: true - subresources: - status: {} + - name: v1beta1 + schema: + openAPIV3Schema: + description: ManagedClusterSetBinding projects a ManagedClusterSet into a + certain namespace. User is able to create a ManagedClusterSetBinding in + a namespace and bind it to a ManagedClusterSet if they have an RBAC rule + to CREATE on the virtual subresource of managedclustersets/bind. Workloads + created in the same namespace can only be distributed to ManagedClusters + in ManagedClusterSets bound in this namespace by higher level controllers. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of ManagedClusterSetBinding. + properties: + clusterSet: + description: ClusterSet is the name of the ManagedClusterSet to bind. + It must match the instance name of the ManagedClusterSetBinding + and cannot change once created. User is allowed to set this field + if they have an RBAC rule to CREATE on the virtual subresource of + managedclustersets/bind. + minLength: 1 + type: string + type: object + status: + description: Status represents the current status of the ManagedClusterSetBinding + properties: + conditions: + description: Conditions contains the different condition statuses + for this ManagedClusterSetBinding. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml index 2342ed799..a483f8725 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_02_clusters.open-cluster-management.io_placements.crd.yaml @@ -9,292 +9,476 @@ spec: listKind: PlacementList plural: placements singular: placement - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].status - name: Succeeded - type: string - - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].reason - name: Reason - type: string - - jsonPath: .status.numberOfSelectedClusters - name: SelectedClusters - type: integer - name: v1beta1 - schema: - openAPIV3Schema: - description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n Here is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters: 1. Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters; 2. ManagedClusters are organized into cluster-scoped ManagedClusterSets; 3. ManagedClusterSets are bound to workload namespaces; 4. Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set of potential ManagedClusters; 5. Then Placements subselect from that working set using label/claim selection. \n No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`. \n A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement. \n If a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly." - type: object - required: - - spec - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of Placement. - type: object - properties: - clusterSets: - description: ClusterSets represent the ManagedClusterSets from which the ManagedClusters are selected. If the slice is empty, ManagedClusters will be selected from the ManagedClusterSets bound to the placement namespace, otherwise ManagedClusters will be selected from the intersection of this slice and the ManagedClusterSets bound to the placement namespace. - type: array - items: - type: string - numberOfClusters: - description: NumberOfClusters represents the desired number of ManagedClusters to be selected which meet the placement requirements. 1) If not specified, all ManagedClusters which meet the placement requirements (including ClusterSets, and Predicates) will be selected; 2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than NumberOfClusters, a random subset with desired number of ManagedClusters will be selected; 3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters, all of them will be selected; 4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters, all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be set to false; - type: integer - format: int32 - predicates: - description: Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed. - type: array - items: - description: ClusterPredicate represents a predicate to select ManagedClusters. - type: object - properties: - requiredClusterSelector: - description: RequiredClusterSelector represents a selector of ManagedClusters by label and claim. If specified, 1) Any ManagedCluster, which does not match the selector, should not be selected by this ClusterPredicate; 2) If a selected ManagedCluster (of this ClusterPredicate) ceases to match the selector (e.g. due to an update) of any ClusterPredicate, it will be eventually removed from the placement decisions; 3) If a ManagedCluster (not selected previously) starts to match the selector, it will either be selected or at least has a chance to be selected (when NumberOfClusters is specified); - type: object - properties: - claimSelector: - description: ClaimSelector represents a selector of ManagedClusters by clusterClaims in status - type: object - properties: - matchExpressions: - description: matchExpressions is a list of cluster claim selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - labelSelector: - description: LabelSelector represents a selector of ManagedClusters by label - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - additionalProperties: - type: string - prioritizerPolicy: - description: PrioritizerPolicy defines the policy of the prioritizers. If this field is unset, then default prioritizer mode and configurations are used. Referring to PrioritizerPolicy to see more description about Mode and Configurations. - type: object + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].status + name: Succeeded + type: string + - jsonPath: .status.conditions[?(@.type=="PlacementSatisfied")].reason + name: Reason + type: string + - jsonPath: .status.numberOfSelectedClusters + name: SelectedClusters + type: integer + name: v1beta1 + schema: + openAPIV3Schema: + description: "Placement defines a rule to select a set of ManagedClusters + from the ManagedClusterSets bound to the placement namespace. \n Here is + how the placement policy combines with other selection methods to determine + a matching list of ManagedClusters: 1. Kubernetes clusters are registered + with hub as cluster-scoped ManagedClusters; 2. ManagedClusters are organized + into cluster-scoped ManagedClusterSets; 3. ManagedClusterSets are bound + to workload namespaces; 4. Namespace-scoped Placements specify a slice of + ManagedClusterSets which select a working set of potential ManagedClusters; + 5. Then Placements subselect from that working set using label/claim selection. + \n No ManagedCluster will be selected if no ManagedClusterSet is bound to + the placement namespace. User is able to bind a ManagedClusterSet to a namespace + by creating a ManagedClusterSetBinding in that namespace if they have a + RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`. + \n A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement + name} will be created to represent the ManagedClusters selected by this + placement. \n If a ManagedCluster is selected and added into the PlacementDecisions, + other components may apply workload on it; once it is removed from the PlacementDecisions, + the workload applied on this ManagedCluster should be evicted accordingly." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of Placement. + properties: + clusterSets: + description: ClusterSets represent the ManagedClusterSets from which + the ManagedClusters are selected. If the slice is empty, ManagedClusters + will be selected from the ManagedClusterSets bound to the placement + namespace, otherwise ManagedClusters will be selected from the intersection + of this slice and the ManagedClusterSets bound to the placement + namespace. + items: + type: string + type: array + numberOfClusters: + description: NumberOfClusters represents the desired number of ManagedClusters + to be selected which meet the placement requirements. 1) If not + specified, all ManagedClusters which meet the placement requirements + (including ClusterSets, and Predicates) will be selected; 2) Otherwise + if the nubmer of ManagedClusters meet the placement requirements + is larger than NumberOfClusters, a random subset with desired number + of ManagedClusters will be selected; 3) If the nubmer of ManagedClusters + meet the placement requirements is equal to NumberOfClusters, all + of them will be selected; 4) If the nubmer of ManagedClusters meet + the placement requirements is less than NumberOfClusters, all of + them will be selected, and the status of condition `PlacementConditionSatisfied` + will be set to false; + format: int32 + type: integer + predicates: + description: Predicates represent a slice of predicates to select + ManagedClusters. The predicates are ORed. + items: + description: ClusterPredicate represents a predicate to select ManagedClusters. properties: - configurations: - type: array - items: - description: PrioritizerConfig represents the configuration of prioritizer - type: object - required: - - scoreCoordinate - properties: - scoreCoordinate: - description: ScoreCoordinate represents the configuration of the prioritizer and score source. - type: object - required: - - type - properties: - addOn: - description: When type is "AddOn", AddOn defines the resource name and score name. - type: object + requiredClusterSelector: + description: RequiredClusterSelector represents a selector of + ManagedClusters by label and claim. If specified, 1) Any ManagedCluster, + which does not match the selector, should not be selected + by this ClusterPredicate; 2) If a selected ManagedCluster + (of this ClusterPredicate) ceases to match the selector (e.g. + due to an update) of any ClusterPredicate, it will be eventually + removed from the placement decisions; 3) If a ManagedCluster + (not selected previously) starts to match the selector, it + will either be selected or at least has a chance to be selected + (when NumberOfClusters is specified); + properties: + claimSelector: + description: ClaimSelector represents a selector of ManagedClusters + by clusterClaims in status + properties: + matchExpressions: + description: matchExpressions is a list of cluster claim + selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, + NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists + or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge + patch. + items: + type: string + type: array required: - - resourceName - - scoreName + - key + - operator + type: object + type: array + type: object + labelSelector: + description: LabelSelector represents a selector of ManagedClusters + by label + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that + relates the key and values. properties: - resourceName: - description: ResourceName defines the resource name of the AddOnPlacementScore. The placement prioritizer selects AddOnPlacementScore CR by this name. + key: + description: key is the label key that the selector + applies to. type: string - scoreName: - description: ScoreName defines the score name inside AddOnPlacementScore. AddOnPlacementScore contains a list of score name and score value, ScoreName specify the score to be used by the prioritizer. + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, + NotIn, Exists and DoesNotExist. type: string - builtIn: - description: 'BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names. 1) Balance: balance the decisions among the clusters. 2) Steady: ensure the existing decision is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable. 4) Spread: spread the workload evenly to topologies.' - type: string - type: - description: Type defines the type of the prioritizer score. Type is either "BuiltIn", "AddOn" or "", where "" is "BuiltIn" by default. When the type is "BuiltIn", need to specify a BuiltIn prioritizer name in BuiltIn. When the type is "AddOn", need to configure the score source in AddOn. + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists + or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: type: string - default: BuiltIn - enum: - - BuiltIn - - AddOn - weight: - description: Weight defines the weight of the prioritizer score. The value must be ranged in [-10,10]. Each prioritizer will calculate an integer score of a cluster in the range of [-100, 100]. The final score of a cluster will be sum(weight * prioritizer_score). A higher weight indicates that the prioritizer weights more in the cluster selection, while 0 weight indicates that the prioritizer is disabled. A negative weight indicates wants to select the last ones. - type: integer - format: int32 - default: 1 - maximum: 10 - minimum: -10 - mode: - description: Mode is either Exact, Additive, "" where "" is Additive by default. In Additive mode, any prioritizer not explicitly enumerated is enabled in its default Configurations, in which Steady and Balance prioritizers have the weight of 1 while other prioritizers have the weight of 0. Additive doesn't require configuring all prioritizers. The default Configurations may change in the future, and additional prioritization will happen. In Exact mode, any prioritizer not explicitly enumerated is weighted as zero. Exact requires knowing the full set of prioritizers you want, but avoids behavior changes between releases. + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field + is "key", the operator is "In", and the values array + contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + type: object + type: object + type: array + prioritizerPolicy: + description: PrioritizerPolicy defines the policy of the prioritizers. + If this field is unset, then default prioritizer mode and configurations + are used. Referring to PrioritizerPolicy to see more description + about Mode and Configurations. + properties: + configurations: + items: + description: PrioritizerConfig represents the configuration + of prioritizer + properties: + scoreCoordinate: + description: ScoreCoordinate represents the configuration + of the prioritizer and score source. + properties: + addOn: + description: When type is "AddOn", AddOn defines the + resource name and score name. + properties: + resourceName: + description: ResourceName defines the resource name + of the AddOnPlacementScore. The placement prioritizer + selects AddOnPlacementScore CR by this name. + type: string + scoreName: + description: ScoreName defines the score name inside + AddOnPlacementScore. AddOnPlacementScore contains + a list of score name and score value, ScoreName + specify the score to be used by the prioritizer. + type: string + required: + - resourceName + - scoreName + type: object + builtIn: + description: 'BuiltIn defines the name of a BuiltIn + prioritizer. Below are the valid BuiltIn prioritizer + names. 1) Balance: balance the decisions among the + clusters. 2) Steady: ensure the existing decision + is stabilized. 3) ResourceAllocatableCPU & ResourceAllocatableMemory: + sort clusters based on the allocatable. 4) Spread: + spread the workload evenly to topologies.' + type: string + type: + default: BuiltIn + description: Type defines the type of the prioritizer + score. Type is either "BuiltIn", "AddOn" or "", where + "" is "BuiltIn" by default. When the type is "BuiltIn", + need to specify a BuiltIn prioritizer name in BuiltIn. + When the type is "AddOn", need to configure the score + source in AddOn. + enum: + - BuiltIn + - AddOn + type: string + required: + - type + type: object + weight: + default: 1 + description: Weight defines the weight of the prioritizer + score. The value must be ranged in [-10,10]. Each prioritizer + will calculate an integer score of a cluster in the range + of [-100, 100]. The final score of a cluster will be sum(weight + * prioritizer_score). A higher weight indicates that the + prioritizer weights more in the cluster selection, while + 0 weight indicates that the prioritizer is disabled. A + negative weight indicates wants to select the last ones. + format: int32 + maximum: 10 + minimum: -10 + type: integer + required: + - scoreCoordinate + type: object + type: array + mode: + default: Additive + description: Mode is either Exact, Additive, "" where "" is Additive + by default. In Additive mode, any prioritizer not explicitly + enumerated is enabled in its default Configurations, in which + Steady and Balance prioritizers have the weight of 1 while other + prioritizers have the weight of 0. Additive doesn't require + configuring all prioritizers. The default Configurations may + change in the future, and additional prioritization will happen. + In Exact mode, any prioritizer not explicitly enumerated is + weighted as zero. Exact requires knowing the full set of prioritizers + you want, but avoids behavior changes between releases. + type: string + type: object + spreadPolicy: + description: SpreadPolicy defines how placement decisions should be + distributed among a set of ManagedClusters. + properties: + spreadConstraints: + description: SpreadConstraints defines how the placement decision + should be distributed among a set of ManagedClusters. The importance + of the SpreadConstraintsTerms follows the natural order of their + index in the slice. The scheduler first consider SpreadConstraintsTerms + with smaller index then those with larger index to distribute + the placement decision. + items: + description: SpreadConstraintsTerm defines a terminology to + spread placement decisions. + properties: + maxSkew: + default: 1 + description: MaxSkew represents the degree to which the + workload may be unevenly distributed. Skew is the maximum + difference between the number of selected ManagedClusters + in a topology and the global minimum. The global minimum + is the minimum number of selected ManagedClusters for + the topologies within the same TopologyKey. The minimum + possible value of MaxSkew is 1, and the default value + is 1. + format: int32 + minimum: 1 + type: integer + topologyKey: + description: TopologyKey is either a label key or a cluster + claim name of ManagedClusters. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ + type: string + topologyKeyType: + description: TopologyKeyType indicates the type of TopologyKey. + It could be Label or Claim. + enum: + - Label + - Claim + type: string + whenUnsatisfiable: + default: ScheduleAnyway + description: WhenUnsatisfiable represents the action of + the scheduler when MaxSkew cannot be satisfied. It could + be DoNotSchedule or ScheduleAnyway. The default value + is ScheduleAnyway. DoNotSchedule instructs the scheduler + not to schedule more ManagedClusters when MaxSkew is not + satisfied. ScheduleAnyway instructs the scheduler to keep + scheduling even if MaxSkew is not satisfied. + enum: + - DoNotSchedule + - ScheduleAnyway + type: string + required: + - topologyKey + - topologyKeyType + type: object + maxItems: 8 + type: array + type: object + tolerations: + description: Tolerations are applied to placements, and allow (but + do not require) the managed clusters with certain taints to be selected + by placements with matching tolerations. + items: + description: Toleration represents the toleration object that can + be attached to a placement. The placement this Toleration is attached + to tolerates any taint that matches the triple + using the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSelect, PreferNoSelect and NoSelectIfNew. + enum: + - NoSelect + - PreferNoSelect + - NoSelectIfNew + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match all + values and all keys. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + operator: + default: Equal + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to Equal. + Exists is equivalent to wildcard for value, so that a placement + can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoSelect/PreferNoSelect, + otherwise this field is ignored) tolerates the taint. The + default value is nil, which indicates it tolerates the taint + forever. The start time of counting the TolerationSeconds + should be the TimeAdded in Taint, not the cluster scheduled + time or TolerationSeconds added time. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + maxLength: 1024 type: string - default: Additive - spreadPolicy: - description: SpreadPolicy defines how placement decisions should be distributed among a set of ManagedClusters. type: object + type: array + type: object + status: + description: Status represents the current status of the Placement + properties: + conditions: + description: Conditions contains the different condition status for + this Placement. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" properties: - spreadConstraints: - description: SpreadConstraints defines how the placement decision should be distributed among a set of ManagedClusters. The importance of the SpreadConstraintsTerms follows the natural order of their index in the slice. The scheduler first consider SpreadConstraintsTerms with smaller index then those with larger index to distribute the placement decision. - type: array - maxItems: 8 - items: - description: SpreadConstraintsTerm defines a terminology to spread placement decisions. - type: object - required: - - topologyKey - - topologyKeyType - properties: - maxSkew: - description: MaxSkew represents the degree to which the workload may be unevenly distributed. Skew is the maximum difference between the number of selected ManagedClusters in a topology and the global minimum. The global minimum is the minimum number of selected ManagedClusters for the topologies within the same TopologyKey. The minimum possible value of MaxSkew is 1, and the default value is 1. - type: integer - format: int32 - default: 1 - minimum: 1 - topologyKey: - description: TopologyKey is either a label key or a cluster claim name of ManagedClusters. - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$ - topologyKeyType: - description: TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim. - type: string - enum: - - Label - - Claim - whenUnsatisfiable: - description: WhenUnsatisfiable represents the action of the scheduler when MaxSkew cannot be satisfied. It could be DoNotSchedule or ScheduleAnyway. The default value is ScheduleAnyway. DoNotSchedule instructs the scheduler not to schedule more ManagedClusters when MaxSkew is not satisfied. ScheduleAnyway instructs the scheduler to keep scheduling even if MaxSkew is not satisfied. - type: string - default: ScheduleAnyway - enum: - - DoNotSchedule - - ScheduleAnyway - tolerations: - description: Tolerations are applied to placements, and allow (but do not require) the managed clusters with certain taints to be selected by placements with matching tolerations. - type: array - items: - description: Toleration represents the toleration object that can be attached to a placement. The placement this Toleration is attached to tolerates any taint that matches the triple using the matching operator . - type: object - properties: - effect: - description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSelect, PreferNoSelect and NoSelectIfNew. - type: string - enum: - - NoSelect - - PreferNoSelect - - NoSelectIfNew - key: - description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - operator: - description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a placement can tolerate all taints of a particular category. - type: string - default: Equal - tolerationSeconds: - description: TolerationSeconds represents the period of time the toleration (which must be of effect NoSelect/PreferNoSelect, otherwise this field is ignored) tolerates the taint. The default value is nil, which indicates it tolerates the taint forever. The start time of counting the TolerationSeconds should be the TimeAdded in Taint, not the cluster scheduled time or TolerationSeconds added time. - type: integer - format: int64 - value: - description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - maxLength: 1024 - status: - description: Status represents the current status of the Placement - type: object - properties: - conditions: - description: Conditions contains the different condition status for this Placement. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - numberOfSelectedClusters: - description: NumberOfSelectedClusters represents the number of selected ManagedClusters - type: integer - format: int32 - served: true - storage: true - subresources: - status: {} + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + numberOfSelectedClusters: + description: NumberOfSelectedClusters represents the number of selected + ManagedClusters + format: int32 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml index 2a7353118..dd5bb7a29 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/0000_03_clusters.open-cluster-management.io_placementdecisions.crd.yaml @@ -9,49 +9,65 @@ spec: listKind: PlacementDecisionList plural: placementdecisions singular: placementdecision - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - name: v1beta1 - schema: - openAPIV3Schema: - description: "PlacementDecision indicates a decision from a placement PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name} to reference a certain placement. \n If a placement has spec.numberOfClusters specified, the total number of decisions contained in status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total number of decisions should be the number of ManagedClusters which match the placement requirements. \n Some of the decisions might be empty when there are no enough ManagedClusters meet the placement requirements." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - status: - description: Status represents the current status of the PlacementDecision - type: object - required: - - decisions - properties: - decisions: - description: Decisions is a slice of decisions according to a placement The number of decisions should not be larger than 100 - type: array - items: - description: ClusterDecision represents a decision from a placement An empty ClusterDecision indicates it is not scheduled yet. - type: object - required: - - clusterName - - reason - properties: - clusterName: - description: ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all placement decisions for the Placement. - type: string - reason: - description: Reason represents the reason why the ManagedCluster is selected. - type: string - served: true - storage: true - subresources: - status: {} + - name: v1beta1 + schema: + openAPIV3Schema: + description: "PlacementDecision indicates a decision from a placement PlacementDecision + should has a label cluster.open-cluster-management.io/placement={placement + name} to reference a certain placement. \n If a placement has spec.numberOfClusters + specified, the total number of decisions contained in status.decisions of + PlacementDecisions should always be NumberOfClusters; otherwise, the total + number of decisions should be the number of ManagedClusters which match + the placement requirements. \n Some of the decisions might be empty when + there are no enough ManagedClusters meet the placement requirements." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + status: + description: Status represents the current status of the PlacementDecision + properties: + decisions: + description: Decisions is a slice of decisions according to a placement + The number of decisions should not be larger than 100 + items: + description: ClusterDecision represents a decision from a placement + An empty ClusterDecision indicates it is not scheduled yet. + properties: + clusterName: + description: ClusterName is the name of the ManagedCluster. + If it is not empty, its value should be unique cross all placement + decisions for the Placement. + type: string + reason: + description: Reason represents the reason why the ManagedCluster + is selected. + type: string + required: + - clusterName + - reason + type: object + type: array + required: + - decisions + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta1/helpers.go b/vendor/open-cluster-management.io/api/cluster/v1beta1/helpers.go index e4284e172..27b5ebdfe 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta1/helpers.go +++ b/vendor/open-cluster-management.io/api/cluster/v1beta1/helpers.go @@ -119,11 +119,11 @@ type PlacementDecisionGetter interface { type PlacementDecisionClustersTracker struct { placement *Placement placementDecisionGetter PlacementDecisionGetter - existingScheduledClusters sets.String + existingScheduledClusters sets.Set[string] lock sync.RWMutex } -func NewPlacementDecisionClustersTracker(placement *Placement, pdl PlacementDecisionGetter, existingScheduledClusters sets.String) *PlacementDecisionClustersTracker { +func NewPlacementDecisionClustersTracker(placement *Placement, pdl PlacementDecisionGetter, existingScheduledClusters sets.Set[string]) *PlacementDecisionClustersTracker { pdct := &PlacementDecisionClustersTracker{ placement: placement, placementDecisionGetter: pdl, @@ -133,7 +133,7 @@ func NewPlacementDecisionClustersTracker(placement *Placement, pdl PlacementDeci } // Get() update the tracker's decisionClusters and return the added and deleted cluster names. -func (pdct *PlacementDecisionClustersTracker) Get() (sets.String, sets.String, error) { +func (pdct *PlacementDecisionClustersTracker) Get() (sets.Set[string], sets.Set[string], error) { pdct.lock.Lock() defer pdct.lock.Unlock() @@ -151,7 +151,7 @@ func (pdct *PlacementDecisionClustersTracker) Get() (sets.String, sets.String, e } // Get the decision cluster names - newScheduledClusters := sets.NewString() + newScheduledClusters := sets.New[string]() for _, d := range decisions { for _, sd := range d.Status.Decisions { newScheduledClusters.Insert(sd.ClusterName) @@ -169,7 +169,7 @@ func (pdct *PlacementDecisionClustersTracker) Get() (sets.String, sets.String, e } // Existing() returns the tracker's existing decision cluster names. -func (pdct *PlacementDecisionClustersTracker) Existing() sets.String { +func (pdct *PlacementDecisionClustersTracker) Existing() sets.Set[string] { pdct.lock.RLock() defer pdct.lock.RUnlock() diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml index 20fc25f93..c0d11bb93 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_00_clusters.open-cluster-management.io_managedclustersets.crd.yaml @@ -9,260 +9,371 @@ spec: listKind: ManagedClusterSetList plural: managedclustersets shortNames: - - mclset - - mclsets + - mclset + - mclsets singular: managedclusterset - scope: Cluster preserveUnknownFields: false + scope: Cluster versions: - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status - name: Empty - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - deprecated: true - deprecationWarning: "cluster.open-cluster-management.io/v1beta1 ManagedClusterSet is deprecated; use cluster.open-cluster-management.io/v1beta2 ManagedClusterSet" - served: true - storage: false - subresources: - status: {} - "schema": - "openAPIV3Schema": - description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of the ManagedClusterSet - type: object - default: - clusterSelector: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status + name: Empty + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + deprecated: true + deprecationWarning: cluster.open-cluster-management.io/v1beta1 ManagedClusterSet + is deprecated; use cluster.open-cluster-management.io/v1beta2 ManagedClusterSet + name: v1beta1 + schema: + openAPIV3Schema: + description: "ManagedClusterSet defines a group of ManagedClusters that user's + workload can run on. A workload can be defined to deployed on a ManagedClusterSet, + which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet + 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet + 3. The service exposed by the workload can be shared in any ManagedCluster + in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian + ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` + on the ManagedCluster to refers to the ManagedClusterSet. User is not allow + to add/remove this label on a ManagedCluster unless they have a RBAC rule + to CREATE on a virtual subresource of managedclustersets/join. In order + to update this label, user must have the permission on both the old and + new ManagedClusterSet." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + default: + clusterSelector: + selectorType: LegacyClusterSetLabel + description: Spec defines the attributes of the ManagedClusterSet + properties: + clusterSelector: + default: selectorType: LegacyClusterSetLabel - properties: - clusterSelector: - description: ClusterSelector represents a selector of ManagedClusters - type: object - default: - selectorType: LegacyClusterSetLabel - properties: - labelSelector: - description: LabelSelector define the general labelSelector which clusterset will use to select target managedClusters - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + description: ClusterSelector represents a selector of ManagedClusters + properties: + labelSelector: + description: LabelSelector define the general labelSelector which + clusterset will use to select target managedClusters + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If + the operator is In or NotIn, the values array must + be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced + during a strategic merge patch. + items: type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: array + required: + - key + - operator type: object - additionalProperties: - type: string - selectorType: - description: SelectorType could only be "LegacyClusterSetLabel" or "LabelSelector" "LegacyClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use labelSelector to select target managedClusters + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A + single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is "key", + the operator is "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selectorType: + default: LegacyClusterSetLabel + description: SelectorType could only be "LegacyClusterSetLabel" + or "LabelSelector" "LegacyClusterSetLabel" means to use label + "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use + labelSelector to select target managedClusters + enum: + - LegacyClusterSetLabel + - LabelSelector + type: string + type: object + type: object + status: + description: Status represents the current status of the ManagedClusterSet + properties: + conditions: + description: Conditions contains the different condition statuses + for this ManagedClusterSet. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time type: string - default: LegacyClusterSetLabel + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. enum: - - LegacyClusterSetLabel - - LabelSelector - status: - description: Status represents the current status of the ManagedClusterSet - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSet. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status - name: Empty - type: string - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta2 - served: true - storage: true - subresources: - status: {} - "schema": - "openAPIV3Schema": - description: "ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet." - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of the ManagedClusterSet - type: object - default: - clusterSelector: - selectorType: ExclusiveClusterSetLabel - properties: - clusterSelector: - description: ClusterSelector represents a selector of ManagedClusters + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type type: object - default: - selectorType: ExclusiveClusterSetLabel - properties: - labelSelector: - description: LabelSelector define the general labelSelector which clusterset will use to select target managedClusters - type: object - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. The requirements are ANDed. - type: array - items: - description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. - type: object - required: - - key - - operator - properties: - key: - description: key is the label key that the selector applies to. - type: string - operator: - description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: array + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="ClusterSetEmpty")].status + name: Empty + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta2 + schema: + openAPIV3Schema: + description: "ManagedClusterSet defines a group of ManagedClusters that user's + workload can run on. A workload can be defined to deployed on a ManagedClusterSet, + which mean: 1. The workload can run on any ManagedCluster in the ManagedClusterSet + 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet + 3. The service exposed by the workload can be shared in any ManagedCluster + in the ManagedClusterSet \n In order to assign a ManagedCluster to a certian + ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` + on the ManagedCluster to refers to the ManagedClusterSet. User is not allow + to add/remove this label on a ManagedCluster unless they have a RBAC rule + to CREATE on a virtual subresource of managedclustersets/join. In order + to update this label, user must have the permission on both the old and + new ManagedClusterSet." + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + default: + clusterSelector: + selectorType: ExclusiveClusterSetLabel + description: Spec defines the attributes of the ManagedClusterSet + properties: + clusterSelector: + default: + selectorType: ExclusiveClusterSetLabel + description: ClusterSelector represents a selector of ManagedClusters + properties: + labelSelector: + description: LabelSelector define the general labelSelector which + clusterset will use to select target managedClusters + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If + the operator is In or NotIn, the values array must + be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced + during a strategic merge patch. + items: type: string - values: - description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. - type: array - items: - type: string - matchLabels: - description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: array + required: + - key + - operator type: object - additionalProperties: - type: string - selectorType: - description: SelectorType could only be "ExclusiveClusterSetLabel" or "LabelSelector" "ExclusiveClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use labelSelector to select target managedClusters - type: string - default: ExclusiveClusterSetLabel - enum: - - ExclusiveClusterSetLabel - - LabelSelector - status: - description: Status represents the current status of the ManagedClusterSet - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSet. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A + single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is "key", + the operator is "In", and the values array contains only + "value". The requirements are ANDed. + type: object type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + selectorType: + default: ExclusiveClusterSetLabel + description: SelectorType could only be "ExclusiveClusterSetLabel" + or "LabelSelector" "ExclusiveClusterSetLabel" means to use label + "cluster.open-cluster-management.io/clusterset:"" to select target clusters. "LabelSelector" means use + labelSelector to select target managedClusters + enum: + - ExclusiveClusterSetLabel + - LabelSelector + type: string + type: object + type: object + status: + description: Status represents the current status of the ManagedClusterSet + properties: + conditions: + description: Conditions contains the different condition statuses + for this ManagedClusterSet. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + type: string + status: + description: status of the condition, one of True, False, Unknown. + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml index 156816f6d..e07e082e2 100644 --- a/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml +++ b/vendor/open-cluster-management.io/api/cluster/v1beta2/0000_01_clusters.open-cluster-management.io_managedclustersetbindings.crd.yaml @@ -9,162 +9,230 @@ spec: listKind: ManagedClusterSetBindingList plural: managedclustersetbindings shortNames: - - mclsetbinding - - mclsetbindings + - mclsetbinding + - mclsetbindings singular: managedclustersetbinding - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - name: v1beta1 - deprecated: true - deprecationWarning: "cluster.open-cluster-management.io/v1beta1 ManagedClusterSetBinding is deprecated; use cluster.open-cluster-management.io/v1beta2 ManagedClusterSetBinding" - schema: - openAPIV3Schema: - description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of ManagedClusterSetBinding. - type: object - properties: - clusterSet: - description: ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. - type: string - minLength: 1 - status: - description: Status represents the current status of the ManagedClusterSetBinding - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSetBinding. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: false - subresources: - status: {} - - name: v1beta2 - schema: - openAPIV3Schema: - description: ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec defines the attributes of ManagedClusterSetBinding. - type: object - properties: - clusterSet: - description: ClusterSet is the name of the ManagedClusterSet to bind. It must match the instance name of the ManagedClusterSetBinding and cannot change once created. User is allowed to set this field if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. - type: string - minLength: 1 - status: - description: Status represents the current status of the ManagedClusterSetBinding - type: object - properties: - conditions: - description: Conditions contains the different condition statuses for this ManagedClusterSetBinding. - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - served: true - storage: true - subresources: - status: {} + - deprecated: true + deprecationWarning: cluster.open-cluster-management.io/v1beta1 ManagedClusterSetBinding + is deprecated; use cluster.open-cluster-management.io/v1beta2 ManagedClusterSetBinding + name: v1beta1 + schema: + openAPIV3Schema: + description: ManagedClusterSetBinding projects a ManagedClusterSet into a + certain namespace. User is able to create a ManagedClusterSetBinding in + a namespace and bind it to a ManagedClusterSet if they have an RBAC rule + to CREATE on the virtual subresource of managedclustersets/bind. Workloads + created in the same namespace can only be distributed to ManagedClusters + in ManagedClusterSets bound in this namespace by higher level controllers. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of ManagedClusterSetBinding. + properties: + clusterSet: + description: ClusterSet is the name of the ManagedClusterSet to bind. + It must match the instance name of the ManagedClusterSetBinding + and cannot change once created. User is allowed to set this field + if they have an RBAC rule to CREATE on the virtual subresource of + managedclustersets/bind. + minLength: 1 + type: string + type: object + status: + description: Status represents the current status of the ManagedClusterSetBinding + properties: + conditions: + description: Conditions contains the different condition statuses + for this ManagedClusterSetBinding. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1beta2 + schema: + openAPIV3Schema: + description: ManagedClusterSetBinding projects a ManagedClusterSet into a + certain namespace. User is able to create a ManagedClusterSetBinding in + a namespace and bind it to a ManagedClusterSet if they have an RBAC rule + to CREATE on the virtual subresource of managedclustersets/bind. Workloads + created in the same namespace can only be distributed to ManagedClusters + in ManagedClusterSets bound in this namespace by higher level controllers. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec defines the attributes of ManagedClusterSetBinding. + properties: + clusterSet: + description: ClusterSet is the name of the ManagedClusterSet to bind. + It must match the instance name of the ManagedClusterSetBinding + and cannot change once created. User is allowed to set this field + if they have an RBAC rule to CREATE on the virtual subresource of + managedclustersets/bind. + minLength: 1 + type: string + type: object + status: + description: Status represents the current status of the ManagedClusterSetBinding + properties: + conditions: + description: Conditions contains the different condition statuses + for this ManagedClusterSetBinding. + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + type: string + status: + description: status of the condition, one of True, False, Unknown. + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/utils/work/v1/workbuilder/workbuilder.go b/vendor/open-cluster-management.io/api/utils/work/v1/workbuilder/workbuilder.go index 5935abec3..daf4df9d1 100644 --- a/vendor/open-cluster-management.io/api/utils/work/v1/workbuilder/workbuilder.go +++ b/vendor/open-cluster-management.io/api/utils/work/v1/workbuilder/workbuilder.go @@ -54,6 +54,7 @@ type internalWorkBuilder struct { executorOption *workapiv1.ManifestWorkExecutor existingManifestWorks []workapiv1.ManifestWork manifestConfigOption []workapiv1.ManifestConfigOption + annotations map[string]string } type WorkBuilderOption func(*internalWorkBuilder) *internalWorkBuilder @@ -85,6 +86,13 @@ func ManifestWorkExecutorOption(executor *workapiv1.ManifestWorkExecutor) WorkBu } } +func ManifestAnnotations(annotations map[string]string) WorkBuilderOption { + return func(builder *internalWorkBuilder) *internalWorkBuilder { + builder.annotations = annotations + return builder + } +} + func NewWorkBuilder() *WorkBuilder { return &WorkBuilder{ manifestLimit: int(float64(DefaultManifestLimit) * DefaultManifestThreshold), @@ -259,6 +267,7 @@ func (f *internalWorkBuilder) initManifestWork(index int) *workapiv1.ManifestWor ObjectMeta: f.generateManifestWorkObjectMeta(index), } f.setManifestWorkOptions(work) + f.setAnnotations(work) return work } @@ -269,6 +278,10 @@ func (f *internalWorkBuilder) setManifestWorkOptions(work *workapiv1.ManifestWor work.Spec.Executor = f.executorOption } +func (f *internalWorkBuilder) setAnnotations(work *workapiv1.ManifestWork) { + work.SetAnnotations(f.annotations) +} + func (f *internalWorkBuilder) bufferOfManifestWork(work *workapiv1.ManifestWork) int { totalSize := 0 for _, manifest := range work.Spec.Workload.Manifests { diff --git a/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml index a15286dfe..c50469f42 100644 --- a/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml +++ b/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml @@ -9,372 +9,547 @@ spec: listKind: ManifestWorkList plural: manifestworks singular: manifestwork - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - name: v1 - schema: - openAPIV3Schema: - description: ManifestWork represents a manifests workload that hub wants to deploy on the managed cluster. A manifest workload is defined as a set of Kubernetes resources. ManifestWork must be created in the cluster namespace on the hub, so that agent on the corresponding managed cluster can access this resource and deploy on the managed cluster. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec represents a desired configuration of work to be deployed on the managed cluster. - type: object - properties: - deleteOption: - description: DeleteOption represents deletion strategy when the manifestwork is deleted. Foreground deletion strategy is applied to all the resource in this manifestwork if it is not set. - type: object - properties: - propagationPolicy: - description: propagationPolicy can be Foreground, Orphan or SelectivelyOrphan SelectivelyOrphan should be rarely used. It is provided for cases where particular resources is transfering ownership from one ManifestWork to another or another management unit. Setting this value will allow a flow like 1. create manifestwork/2 to manage foo 2. update manifestwork/1 to selectively orphan foo 3. remove foo from manifestwork/1 without impacting continuity because manifestwork/2 adopts it. - type: string - default: Foreground - enum: - - Foreground - - Orphan - - SelectivelyOrphan - selectivelyOrphans: - description: selectivelyOrphan represents a list of resources following orphan deletion stratecy - type: object - properties: - orphaningRules: - description: orphaningRules defines a slice of orphaningrule. Each orphaningrule identifies a single resource included in this manifestwork - type: array - items: - description: OrphaningRule identifies a single resource included in this manifestwork to be orphaned - type: object - required: - - name - - resource - properties: - group: - description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. - type: string - name: - description: Name is the name of the Kubernetes resource. - type: string - namespace: - description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. - type: string - resource: - description: Resource is the resource name of the Kubernetes resource. - type: string - executor: - description: Executor is the configuration that makes the work agent to perform some pre-request processing/checking. e.g. the executor identity tells the work agent to check the executor has sufficient permission to write the workloads to the local managed cluster. Note that nil executor is still supported for backward-compatibility which indicates that the work agent will not perform any additional actions before applying resources. - type: object - properties: - subject: - description: Subject is the subject identity which the work agent uses to talk to the local cluster when applying the resources. - type: object - required: - - type - properties: - serviceAccount: - description: ServiceAccount is for identifying which service account to use by the work agent. Only required if the type is "ServiceAccount". - type: object - required: - - name - - namespace + - name: v1 + schema: + openAPIV3Schema: + description: ManifestWork represents a manifests workload that hub wants to + deploy on the managed cluster. A manifest workload is defined as a set of + Kubernetes resources. ManifestWork must be created in the cluster namespace + on the hub, so that agent on the corresponding managed cluster can access + this resource and deploy on the managed cluster. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec represents a desired configuration of work to be deployed + on the managed cluster. + properties: + deleteOption: + description: DeleteOption represents deletion strategy when the manifestwork + is deleted. Foreground deletion strategy is applied to all the resource + in this manifestwork if it is not set. + properties: + propagationPolicy: + default: Foreground + description: propagationPolicy can be Foreground, Orphan or SelectivelyOrphan + SelectivelyOrphan should be rarely used. It is provided for + cases where particular resources is transfering ownership from + one ManifestWork to another or another management unit. Setting + this value will allow a flow like 1. create manifestwork/2 to + manage foo 2. update manifestwork/1 to selectively orphan foo + 3. remove foo from manifestwork/1 without impacting continuity + because manifestwork/2 adopts it. + enum: + - Foreground + - Orphan + - SelectivelyOrphan + type: string + selectivelyOrphans: + description: selectivelyOrphan represents a list of resources + following orphan deletion stratecy + properties: + orphaningRules: + description: orphaningRules defines a slice of orphaningrule. + Each orphaningrule identifies a single resource included + in this manifestwork + items: + description: OrphaningRule identifies a single resource + included in this manifestwork to be orphaned properties: + group: + description: Group is the API Group of the Kubernetes + resource, empty string indicates it is in core group. + type: string name: - description: Name is the name of the service account. + description: Name is the name of the Kubernetes resource. type: string - maxLength: 253 - minLength: 1 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ namespace: - description: Namespace is the namespace of the service account. + description: Name is the namespace of the Kubernetes + resource, empty string indicates it is a cluster scoped + resource. type: string - maxLength: 253 - minLength: 1 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ - type: - description: 'Type is the type of the subject identity. Supported types are: "ServiceAccount".' - type: string - enum: - - ServiceAccount - manifestConfigs: - description: ManifestConfigs represents the configurations of manifests defined in workload field. - type: array - items: - description: ManifestConfigOption represents the configurations of a manifest defined in workload field. - type: object - required: - - resourceIdentifier - properties: - feedbackRules: - description: FeedbackRules defines what resource status field should be returned. If it is not set or empty, no feedback rules will be honored. - type: array - items: - type: object - required: - - type - properties: - jsonPaths: - description: JsonPaths defines the json path under status field to be synced. - type: array - items: - type: object - required: - - name - - path - properties: - name: - description: Name represents the alias name for this field - type: string - path: - description: Path represents the json path of the field under status. The path must point to a field with single value in the type of integer, bool or string. If the path points to a non-existing field, no value will be returned. If the path points to a structure, map or slice, no value will be returned and the status conddition of StatusFeedBackSynced will be set as false. Ref to https://kubernetes.io/docs/reference/kubectl/jsonpath/ on how to write a jsonPath. - type: string - version: - description: Version is the version of the Kubernetes resource. If it is not specified, the resource with the semantically latest version is used to resolve the path. - type: string - type: - description: Type defines the option of how status can be returned. It can be jsonPaths or wellKnownStatus. If the type is JSONPaths, user should specify the jsonPaths field If the type is WellKnownStatus, certain common fields of status defined by a rule only for types in in k8s.io/api and open-cluster-management/api will be reported, If these status fields do not exist, no values will be reported. + resource: + description: Resource is the resource name of the Kubernetes + resource. type: string - enum: - - WellKnownStatus - - JSONPaths - resourceIdentifier: - description: ResourceIdentifier represents the group, resource, name and namespace of a resoure. iff this refers to a resource not created by this manifest work, the related rules will not be executed. - type: object - required: + required: - name - resource + type: object + type: array + type: object + type: object + executor: + description: Executor is the configuration that makes the work agent + to perform some pre-request processing/checking. e.g. the executor + identity tells the work agent to check the executor has sufficient + permission to write the workloads to the local managed cluster. + Note that nil executor is still supported for backward-compatibility + which indicates that the work agent will not perform any additional + actions before applying resources. + properties: + subject: + description: Subject is the subject identity which the work agent + uses to talk to the local cluster when applying the resources. + properties: + serviceAccount: + description: ServiceAccount is for identifying which service + account to use by the work agent. Only required if the type + is "ServiceAccount". properties: - group: - description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. - type: string name: - description: Name is the name of the Kubernetes resource. + description: Name is the name of the service account. + maxLength: 253 + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ type: string namespace: - description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. + description: Namespace is the namespace of the service + account. + maxLength: 253 + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ type: string - resource: - description: Resource is the resource name of the Kubernetes resource. - type: string - updateStrategy: - description: UpdateStrategy defines the strategy to update this manifest. UpdateStrategy is Update if it is not set. - type: object required: - - type - properties: - serverSideApply: - description: serverSideApply defines the configuration for server side apply. It is honored only when type of updateStrategy is ServerSideApply - type: object - properties: - fieldManager: - description: FieldManager is the manager to apply the resource. It is work-agent by default, but can be other name with work-agent as the prefix. - type: string - default: work-agent - pattern: ^work-agent - force: - description: Force represents to force apply the manifest. - type: boolean - type: - description: type defines the strategy to update this manifest, default value is Update. Update type means to update resource by an update call. CreateOnly type means do not update resource based on current manifest. ServerSideApply type means to update resource using server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False with the reason of ApplyConflict. - type: string - default: Update - enum: - - Update - - CreateOnly - - ServerSideApply - workload: - description: Workload represents the manifest workload to be deployed on a managed cluster. - type: object - properties: - manifests: - description: Manifests represents a list of kuberenetes resources to be deployed on a managed cluster. - type: array - items: - description: Manifest represents a resource to be deployed on managed cluster. + - name + - namespace type: object - x-kubernetes-preserve-unknown-fields: true - x-kubernetes-embedded-resource: true - status: - description: Status represents the current status of work. - type: object - properties: - conditions: - description: 'Conditions contains the different condition statuses for this work. Valid condition types are: 1. Applied represents workload in ManifestWork is applied successfully on managed cluster. 2. Progressing represents workload in ManifestWork is being applied on managed cluster. 3. Available represents workload in ManifestWork exists on the managed cluster. 4. Degraded represents the current state of workload does not match the desired state for a certain period.' - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: 'Type is the type of the subject identity. Supported + types are: "ServiceAccount".' + enum: + - ServiceAccount type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - resourceStatus: - description: ResourceStatus represents the status of each resource in manifestwork deployed on a managed cluster. The Klusterlet agent on managed cluster syncs the condition from the managed cluster to the hub. - type: object + required: + - type + type: object + type: object + manifestConfigs: + description: ManifestConfigs represents the configurations of manifests + defined in workload field. + items: + description: ManifestConfigOption represents the configurations + of a manifest defined in workload field. properties: - manifests: - description: 'Manifests represents the condition of manifests deployed on managed cluster. Valid condition types are: 1. Progressing represents the resource is being applied on managed cluster. 2. Applied represents the resource is applied successfully on managed cluster. 3. Available represents the resource exists on the managed cluster. 4. Degraded represents the current state of resource does not match the desired state for a certain period.' - type: array + feedbackRules: + description: FeedbackRules defines what resource status field + should be returned. If it is not set or empty, no feedback + rules will be honored. items: - description: ManifestCondition represents the conditions of the resources deployed on a managed cluster. - type: object properties: - conditions: - description: Conditions represents the conditions of this resource on a managed cluster. - type: array + jsonPaths: + description: JsonPaths defines the json path under status + field to be synced. items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - type: object - required: - - lastTransitionTime - - message - - reason - - status - - type properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. + name: + description: Name represents the alias name for + this field type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + path: + description: Path represents the json path of the + field under status. The path must point to a field + with single value in the type of integer, bool + or string. If the path points to a non-existing + field, no value will be returned. If the path + points to a structure, map or slice, no value + will be returned and the status conddition of + StatusFeedBackSynced will be set as false. Ref + to https://kubernetes.io/docs/reference/kubectl/jsonpath/ + on how to write a jsonPath. type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. + version: + description: Version is the version of the Kubernetes + resource. If it is not specified, the resource + with the semantically latest version is used to + resolve the path. type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - resourceMeta: - description: ResourceMeta represents the group, version, kind, name and namespace of a resoure. - type: object + required: + - name + - path + type: object + type: array + type: + description: Type defines the option of how status can + be returned. It can be jsonPaths or wellKnownStatus. + If the type is JSONPaths, user should specify the jsonPaths + field If the type is WellKnownStatus, certain common + fields of status defined by a rule only for types in + in k8s.io/api and open-cluster-management/api will be + reported, If these status fields do not exist, no values + will be reported. + enum: + - WellKnownStatus + - JSONPaths + type: string + required: + - type + type: object + type: array + resourceIdentifier: + description: ResourceIdentifier represents the group, resource, + name and namespace of a resoure. iff this refers to a resource + not created by this manifest work, the related rules will + not be executed. + properties: + group: + description: Group is the API Group of the Kubernetes resource, + empty string indicates it is in core group. + type: string + name: + description: Name is the name of the Kubernetes resource. + type: string + namespace: + description: Name is the namespace of the Kubernetes resource, + empty string indicates it is a cluster scoped resource. + type: string + resource: + description: Resource is the resource name of the Kubernetes + resource. + type: string + required: + - name + - resource + type: object + updateStrategy: + description: UpdateStrategy defines the strategy to update this + manifest. UpdateStrategy is Update if it is not set. + properties: + serverSideApply: + description: serverSideApply defines the configuration for + server side apply. It is honored only when type of updateStrategy + is ServerSideApply + properties: + fieldManager: + default: work-agent + description: FieldManager is the manager to apply the + resource. It is work-agent by default, but can be + other name with work-agent as the prefix. + pattern: ^work-agent + type: string + force: + description: Force represents to force apply the manifest. + type: boolean + type: object + type: + default: Update + description: type defines the strategy to update this manifest, + default value is Update. Update type means to update resource + by an update call. CreateOnly type means do not update + resource based on current manifest. ServerSideApply type + means to update resource using server side apply with + work-controller as the field manager. If there is conflict, + the related Applied condition of manifest will be in the + status of False with the reason of ApplyConflict. + enum: + - Update + - CreateOnly + - ServerSideApply + type: string + required: + - type + type: object + required: + - resourceIdentifier + type: object + type: array + workload: + description: Workload represents the manifest workload to be deployed + on a managed cluster. + properties: + manifests: + description: Manifests represents a list of kuberenetes resources + to be deployed on a managed cluster. + items: + description: Manifest represents a resource to be deployed on + managed cluster. + type: object + x-kubernetes-embedded-resource: true + x-kubernetes-preserve-unknown-fields: true + type: array + type: object + type: object + status: + description: Status represents the current status of work. + properties: + conditions: + description: 'Conditions contains the different condition statuses + for this work. Valid condition types are: 1. Applied represents + workload in ManifestWork is applied successfully on managed cluster. + 2. Progressing represents workload in ManifestWork is being applied + on managed cluster. 3. Available represents workload in ManifestWork + exists on the managed cluster. 4. Degraded represents the current + state of workload does not match the desired state for a certain + period.' + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + resourceStatus: + description: ResourceStatus represents the status of each resource + in manifestwork deployed on a managed cluster. The Klusterlet agent + on managed cluster syncs the condition from the managed cluster + to the hub. + properties: + manifests: + description: 'Manifests represents the condition of manifests + deployed on managed cluster. Valid condition types are: 1. Progressing + represents the resource is being applied on managed cluster. + 2. Applied represents the resource is applied successfully on + managed cluster. 3. Available represents the resource exists + on the managed cluster. 4. Degraded represents the current state + of resource does not match the desired state for a certain period.' + items: + description: ManifestCondition represents the conditions of + the resources deployed on a managed cluster. + properties: + conditions: + description: Conditions represents the conditions of this + resource on a managed cluster. + items: + description: "Condition contains details for one aspect + of the current state of this API Resource. --- This + struct is intended for direct use as an array at the + field path .status.conditions. For example, \n type + FooStatus struct{ // Represents the observations of + a foo's current state. // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\" + // +patchMergeKey=type // +patchStrategy=merge // +listType=map + // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` + \n // other fields }" properties: - group: - description: Group is the API Group of the Kubernetes resource. - type: string - kind: - description: Kind is the kind of the Kubernetes resource. + lastTransitionTime: + description: lastTransitionTime is the last time the + condition transitioned from one status to another. + This should be when the underlying condition changed. If + that is not known, then using the time when the + API field changed is acceptable. + format: date-time type: string - name: - description: Name is the name of the Kubernetes resource. + message: + description: message is a human readable message indicating + details about the transition. This may be an empty + string. + maxLength: 32768 type: string - namespace: - description: Name is the namespace of the Kubernetes resource. - type: string - ordinal: - description: Ordinal represents the index of the manifest on spec. + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, + if .metadata.generation is currently 12, but the + .status.conditions[x].observedGeneration is 9, the + condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 type: integer - format: int32 - resource: - description: Resource is the resource name of the Kubernetes resource. + reason: + description: reason contains a programmatic identifier + indicating the reason for the condition's last transition. + Producers of specific condition types may define + expected values and meanings for this field, and + whether the values are considered a guaranteed API. + The value should be a CamelCase string. This field + may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, + False, Unknown. + enum: + - "True" + - "False" + - Unknown type: string - version: - description: Version is the version of the Kubernetes resource. + type: + description: type of condition in CamelCase or in + foo.example.com/CamelCase. --- Many .condition.type + values are consistent across resources like Available, + but because arbitrary conditions can be useful (see + .node.status.conditions), the ability to deconflict + is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string - statusFeedback: - description: StatusFeedback represents the values of the feild synced back defined in statusFeedbacks + required: + - lastTransitionTime + - message + - reason + - status + - type type: object - properties: - values: - description: Values represents the synced value of the interested field. - type: array - items: - type: object - required: - - fieldValue - - name - properties: - fieldValue: - description: Value is the value of the status field. The value of the status field can only be integer, string or boolean. - type: object - required: - - type - properties: - boolean: - description: Boolean is bool value when type is boolean. - type: boolean - integer: - description: Integer is the integer value when type is integer. - type: integer - format: int64 - string: - description: String is the string value when when type is string. - type: string - type: - description: Type represents the type of the value, it can be integer, string or boolean. - type: string - enum: - - Integer - - String - - Boolean - name: - description: Name represents the alias name for this field. It is the same as what is specified in StatuFeedbackRule in the spec. - type: string - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - served: true - storage: true - subresources: - status: {} + type: array + resourceMeta: + description: ResourceMeta represents the group, version, + kind, name and namespace of a resoure. + properties: + group: + description: Group is the API Group of the Kubernetes + resource. + type: string + kind: + description: Kind is the kind of the Kubernetes resource. + type: string + name: + description: Name is the name of the Kubernetes resource. + type: string + namespace: + description: Name is the namespace of the Kubernetes + resource. + type: string + ordinal: + description: Ordinal represents the index of the manifest + on spec. + format: int32 + type: integer + resource: + description: Resource is the resource name of the Kubernetes + resource. + type: string + version: + description: Version is the version of the Kubernetes + resource. + type: string + type: object + statusFeedback: + description: StatusFeedback represents the values of the + feild synced back defined in statusFeedbacks + properties: + values: + description: Values represents the synced value of the + interested field. + items: + properties: + fieldValue: + description: Value is the value of the status + field. The value of the status field can only + be integer, string or boolean. + properties: + boolean: + description: Boolean is bool value when type + is boolean. + type: boolean + integer: + description: Integer is the integer value + when type is integer. + format: int64 + type: integer + string: + description: String is the string value when + when type is string. + type: string + type: + description: Type represents the type of the + value, it can be integer, string or boolean. + enum: + - Integer + - String + - Boolean + type: string + required: + - type + type: object + name: + description: Name represents the alias name for + this field. It is the same as what is specified + in StatuFeedbackRule in the spec. + type: string + required: + - fieldValue + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + type: object + type: array + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml index b44731fca..99ef00b4b 100644 --- a/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml +++ b/vendor/open-cluster-management.io/api/work/v1/0000_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml @@ -9,77 +9,112 @@ spec: listKind: AppliedManifestWorkList plural: appliedmanifestworks singular: appliedmanifestwork - scope: Cluster preserveUnknownFields: false + scope: Cluster versions: - - name: v1 - schema: - openAPIV3Schema: - description: AppliedManifestWork represents an applied manifestwork on managed cluster that is placed on a managed cluster. An AppliedManifestWork links to a manifestwork on a hub recording resources deployed in the managed cluster. When the agent is removed from managed cluster, cluster-admin on managed cluster can delete appliedmanifestwork to remove resources deployed by the agent. The name of the appliedmanifestwork must be in the format of {hash of hub's first kube-apiserver url}-{manifestwork name} - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec represents the desired configuration of AppliedManifestWork. - type: object - properties: - agentID: - description: AgentID represents the ID of the work agent who is to handle this AppliedManifestWork. - type: string - hubHash: - description: HubHash represents the hash of the first hub kube apiserver to identify which hub this AppliedManifestWork links to. - type: string - manifestWorkName: - description: ManifestWorkName represents the name of the related manifestwork on the hub. - type: string - status: - description: Status represents the current status of AppliedManifestWork. - type: object - properties: - appliedResources: - description: AppliedResources represents a list of resources defined within the manifestwork that are applied. Only resources with valid GroupVersionResource, namespace, and name are suitable. An item in this slice is deleted when there is no mapped manifest in manifestwork.Spec or by finalizer. The resource relating to the item will also be removed from managed cluster. The deleted resource may still be present until the finalizers for that resource are finished. However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved. - type: array - items: - description: AppliedManifestResourceMeta represents the group, version, resource, name and namespace of a resource. Since these resources have been created, they must have valid group, version, resource, namespace, and name. - type: object - required: - - name - - resource - - version - properties: - group: - description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. - type: string - name: - description: Name is the name of the Kubernetes resource. - type: string - namespace: - description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. - type: string - resource: - description: Resource is the resource name of the Kubernetes resource. - type: string - uid: - description: UID is set on successful deletion of the Kubernetes resource by controller. The resource might be still visible on the managed cluster after this field is set. It is not directly settable by a client. - type: string - version: - description: Version is the version of the Kubernetes resource. - type: string - evictionStartTime: - description: 'EvictionStartTime represents the current appliedmanifestwork will be evicted after a grace period. An appliedmanifestwork will be evicted from the managed cluster in the following two scenarios: - the manifestwork of the current appliedmanifestwork is missing on the hub, or - the appliedmanifestwork hub hash does not match the current hub hash of the work agent.' - type: string - format: date-time - served: true - storage: true - subresources: - status: {} + - name: v1 + schema: + openAPIV3Schema: + description: AppliedManifestWork represents an applied manifestwork on managed + cluster that is placed on a managed cluster. An AppliedManifestWork links + to a manifestwork on a hub recording resources deployed in the managed cluster. + When the agent is removed from managed cluster, cluster-admin on managed + cluster can delete appliedmanifestwork to remove resources deployed by the + agent. The name of the appliedmanifestwork must be in the format of {hash + of hub's first kube-apiserver url}-{manifestwork name} + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec represents the desired configuration of AppliedManifestWork. + properties: + agentID: + description: AgentID represents the ID of the work agent who is to + handle this AppliedManifestWork. + type: string + hubHash: + description: HubHash represents the hash of the first hub kube apiserver + to identify which hub this AppliedManifestWork links to. + type: string + manifestWorkName: + description: ManifestWorkName represents the name of the related manifestwork + on the hub. + type: string + type: object + status: + description: Status represents the current status of AppliedManifestWork. + properties: + appliedResources: + description: AppliedResources represents a list of resources defined + within the manifestwork that are applied. Only resources with valid + GroupVersionResource, namespace, and name are suitable. An item + in this slice is deleted when there is no mapped manifest in manifestwork.Spec + or by finalizer. The resource relating to the item will also be + removed from managed cluster. The deleted resource may still be + present until the finalizers for that resource are finished. However, + the resource will not be undeleted, so it can be removed from this + list and eventual consistency is preserved. + items: + description: AppliedManifestResourceMeta represents the group, version, + resource, name and namespace of a resource. Since these resources + have been created, they must have valid group, version, resource, + namespace, and name. + properties: + group: + description: Group is the API Group of the Kubernetes resource, + empty string indicates it is in core group. + type: string + name: + description: Name is the name of the Kubernetes resource. + type: string + namespace: + description: Name is the namespace of the Kubernetes resource, + empty string indicates it is a cluster scoped resource. + type: string + resource: + description: Resource is the resource name of the Kubernetes + resource. + type: string + uid: + description: UID is set on successful deletion of the Kubernetes + resource by controller. The resource might be still visible + on the managed cluster after this field is set. It is not + directly settable by a client. + type: string + version: + description: Version is the version of the Kubernetes resource. + type: string + required: + - name + - resource + - version + type: object + type: array + evictionStartTime: + description: 'EvictionStartTime represents the current appliedmanifestwork + will be evicted after a grace period. An appliedmanifestwork will + be evicted from the managed cluster in the following two scenarios: + - the manifestwork of the current appliedmanifestwork is missing + on the hub, or - the appliedmanifestwork hub hash does not match + the current hub hash of the work agent.' + format: date-time + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: "" diff --git a/vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml deleted file mode 100644 index 06a5a9140..000000000 --- a/vendor/open-cluster-management.io/api/work/v1/0001_01_work.open-cluster-management.io_appliedmanifestworks.crd.yaml +++ /dev/null @@ -1,90 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - creationTimestamp: null - name: appliedmanifestworks.work.open-cluster-management.io -spec: - group: work.open-cluster-management.io - names: - kind: AppliedManifestWork - listKind: AppliedManifestWorkList - plural: appliedmanifestworks - singular: appliedmanifestwork - scope: "Cluster" - preserveUnknownFields: false - subresources: - status: {} - validation: - openAPIV3Schema: - description: AppliedManifestWork represents an applied manifestwork on managed cluster that is placed on a managed cluster. An AppliedManifestWork links to a manifestwork on a hub recording resources deployed in the managed cluster. When the agent is removed from managed cluster, cluster-admin on managed cluster can delete appliedmanifestwork to remove resources deployed by the agent. The name of the appliedmanifestwork must be in the format of {hash of hub's first kube-apiserver url}-{manifestwork name} - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec represents the desired configuration of AppliedManifestWork. - type: object - properties: - agentID: - description: AgentID represents the ID of the work agent who is to handle this AppliedManifestWork. - type: string - hubHash: - description: HubHash represents the hash of the first hub kube apiserver to identify which hub this AppliedManifestWork links to. - type: string - manifestWorkName: - description: ManifestWorkName represents the name of the related manifestwork on the hub. - type: string - status: - description: Status represents the current status of AppliedManifestWork. - type: object - properties: - appliedResources: - description: AppliedResources represents a list of resources defined within the manifestwork that are applied. Only resources with valid GroupVersionResource, namespace, and name are suitable. An item in this slice is deleted when there is no mapped manifest in manifestwork.Spec or by finalizer. The resource relating to the item will also be removed from managed cluster. The deleted resource may still be present until the finalizers for that resource are finished. However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved. - type: array - items: - description: AppliedManifestResourceMeta represents the group, version, resource, name and namespace of a resource. Since these resources have been created, they must have valid group, version, resource, namespace, and name. - type: object - required: - - name - - resource - - version - properties: - group: - description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. - type: string - name: - description: Name is the name of the Kubernetes resource. - type: string - namespace: - description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. - type: string - resource: - description: Resource is the resource name of the Kubernetes resource. - type: string - uid: - description: UID is set on successful deletion of the Kubernetes resource by controller. The resource might be still visible on the managed cluster after this field is set. It is not directly settable by a client. - type: string - version: - description: Version is the version of the Kubernetes resource. - type: string - evictionStartTime: - description: 'EvictionStartTime represents the current appliedmanifestwork will be evicted after a grace period. An appliedmanifestwork will be evicted from the managed cluster in the following two scenarios: - the manifestwork of the current appliedmanifestwork is missing on the hub, or - the appliedmanifestwork hub hash does not match the current hub hash of the work agent.' - type: string - format: date-time - version: v1 - versions: - - name: v1 - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/vendor/open-cluster-management.io/api/work/v1/types.go b/vendor/open-cluster-management.io/api/work/v1/types.go index c2915a79a..ff5158f7c 100644 --- a/vendor/open-cluster-management.io/api/work/v1/types.go +++ b/vendor/open-cluster-management.io/api/work/v1/types.go @@ -26,6 +26,12 @@ type ManifestWork struct { Status ManifestWorkStatus `json:"status,omitempty"` } +const ( + // ManifestConfigSpecHashAnnotationKey is the annotation key to identify the configurations + // used by the manifestwork. + ManifestConfigSpecHashAnnotationKey = "open-cluster-management.io/config-spec-hash" +) + // ManifestWorkSpec represents a desired configuration of manifests to be deployed on the managed cluster. type ManifestWorkSpec struct { // Workload represents the manifest workload to be deployed on a managed cluster. diff --git a/vendor/open-cluster-management.io/api/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml b/vendor/open-cluster-management.io/api/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml index c45b47c78..9315f0770 100644 --- a/vendor/open-cluster-management.io/api/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml +++ b/vendor/open-cluster-management.io/api/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml @@ -9,307 +9,435 @@ spec: listKind: ManifestWorkReplicaSetList plural: manifestworkreplicasets shortNames: - - mwrs + - mwrs singular: manifestworkreplicaset - scope: Namespaced preserveUnknownFields: false + scope: Namespaced versions: - - additionalPrinterColumns: - - description: Reason - jsonPath: .status.conditions[?(@.type=="PlacementVerified")].reason - name: Placement - type: string - - description: Configured - jsonPath: .status.conditions[?(@.type=="PlacementVerified")].status - name: Found - type: string - - description: Reason - jsonPath: .status.conditions[?(@.type=="ManifestworkApplied")].reason - name: ManifestWorks - type: string - - description: Applied - jsonPath: .status.conditions[?(@.type=="ManifestworkApplied")].status - name: Applied - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: ManifestWorkReplicaSet is the Schema for the ManifestWorkReplicaSet API. This custom resource is able to apply ManifestWork using Placement for 0..n ManagedCluster(in their namespaces). It will also remove the ManifestWork custom resources when deleted. Lastly the specific ManifestWork custom resources created per ManagedCluster namespace will be adjusted based on PlacementDecision changes. - type: object - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: Spec reperesents the desired ManifestWork payload and Placement reference to be reconciled - type: object - required: - - placementRefs - properties: - manifestWorkTemplate: - description: ManifestWorkTemplate is the ManifestWorkSpec that will be used to generate a per-cluster ManifestWork - type: object - properties: - deleteOption: - description: DeleteOption represents deletion strategy when the manifestwork is deleted. Foreground deletion strategy is applied to all the resource in this manifestwork if it is not set. - type: object - properties: - propagationPolicy: - description: propagationPolicy can be Foreground, Orphan or SelectivelyOrphan SelectivelyOrphan should be rarely used. It is provided for cases where particular resources is transfering ownership from one ManifestWork to another or another management unit. Setting this value will allow a flow like 1. create manifestwork/2 to manage foo 2. update manifestwork/1 to selectively orphan foo 3. remove foo from manifestwork/1 without impacting continuity because manifestwork/2 adopts it. - type: string - default: Foreground - enum: - - Foreground - - Orphan - - SelectivelyOrphan - selectivelyOrphans: - description: selectivelyOrphan represents a list of resources following orphan deletion stratecy - type: object - properties: - orphaningRules: - description: orphaningRules defines a slice of orphaningrule. Each orphaningrule identifies a single resource included in this manifestwork - type: array - items: - description: OrphaningRule identifies a single resource included in this manifestwork to be orphaned - type: object - required: - - name - - resource - properties: - group: - description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. - type: string - name: - description: Name is the name of the Kubernetes resource. - type: string - namespace: - description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. - type: string - resource: - description: Resource is the resource name of the Kubernetes resource. - type: string - executor: - description: Executor is the configuration that makes the work agent to perform some pre-request processing/checking. e.g. the executor identity tells the work agent to check the executor has sufficient permission to write the workloads to the local managed cluster. Note that nil executor is still supported for backward-compatibility which indicates that the work agent will not perform any additional actions before applying resources. - type: object - properties: - subject: - description: Subject is the subject identity which the work agent uses to talk to the local cluster when applying the resources. - type: object - required: - - type - properties: - serviceAccount: - description: ServiceAccount is for identifying which service account to use by the work agent. Only required if the type is "ServiceAccount". - type: object - required: - - name - - namespace + - additionalPrinterColumns: + - description: Reason + jsonPath: .status.conditions[?(@.type=="PlacementVerified")].reason + name: Placement + type: string + - description: Configured + jsonPath: .status.conditions[?(@.type=="PlacementVerified")].status + name: Found + type: string + - description: Reason + jsonPath: .status.conditions[?(@.type=="ManifestworkApplied")].reason + name: ManifestWorks + type: string + - description: Applied + jsonPath: .status.conditions[?(@.type=="ManifestworkApplied")].status + name: Applied + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: ManifestWorkReplicaSet is the Schema for the ManifestWorkReplicaSet + API. This custom resource is able to apply ManifestWork using Placement + for 0..n ManagedCluster(in their namespaces). It will also remove the ManifestWork + custom resources when deleted. Lastly the specific ManifestWork custom resources + created per ManagedCluster namespace will be adjusted based on PlacementDecision + changes. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec reperesents the desired ManifestWork payload and Placement + reference to be reconciled + properties: + manifestWorkTemplate: + description: ManifestWorkTemplate is the ManifestWorkSpec that will + be used to generate a per-cluster ManifestWork + properties: + deleteOption: + description: DeleteOption represents deletion strategy when the + manifestwork is deleted. Foreground deletion strategy is applied + to all the resource in this manifestwork if it is not set. + properties: + propagationPolicy: + default: Foreground + description: propagationPolicy can be Foreground, Orphan or + SelectivelyOrphan SelectivelyOrphan should be rarely used. It + is provided for cases where particular resources is transfering + ownership from one ManifestWork to another or another management + unit. Setting this value will allow a flow like 1. create + manifestwork/2 to manage foo 2. update manifestwork/1 to + selectively orphan foo 3. remove foo from manifestwork/1 + without impacting continuity because manifestwork/2 adopts + it. + enum: + - Foreground + - Orphan + - SelectivelyOrphan + type: string + selectivelyOrphans: + description: selectivelyOrphan represents a list of resources + following orphan deletion stratecy + properties: + orphaningRules: + description: orphaningRules defines a slice of orphaningrule. + Each orphaningrule identifies a single resource included + in this manifestwork + items: + description: OrphaningRule identifies a single resource + included in this manifestwork to be orphaned properties: + group: + description: Group is the API Group of the Kubernetes + resource, empty string indicates it is in core + group. + type: string name: - description: Name is the name of the service account. + description: Name is the name of the Kubernetes + resource. type: string - maxLength: 253 - minLength: 1 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ namespace: - description: Namespace is the namespace of the service account. + description: Name is the namespace of the Kubernetes + resource, empty string indicates it is a cluster + scoped resource. type: string - maxLength: 253 - minLength: 1 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ - type: - description: 'Type is the type of the subject identity. Supported types are: "ServiceAccount".' - type: string - enum: - - ServiceAccount - manifestConfigs: - description: ManifestConfigs represents the configurations of manifests defined in workload field. - type: array - items: - description: ManifestConfigOption represents the configurations of a manifest defined in workload field. - type: object - required: - - resourceIdentifier - properties: - feedbackRules: - description: FeedbackRules defines what resource status field should be returned. If it is not set or empty, no feedback rules will be honored. - type: array - items: - type: object - required: - - type - properties: - jsonPaths: - description: JsonPaths defines the json path under status field to be synced. - type: array - items: - type: object - required: - - name - - path - properties: - name: - description: Name represents the alias name for this field - type: string - path: - description: Path represents the json path of the field under status. The path must point to a field with single value in the type of integer, bool or string. If the path points to a non-existing field, no value will be returned. If the path points to a structure, map or slice, no value will be returned and the status conddition of StatusFeedBackSynced will be set as false. Ref to https://kubernetes.io/docs/reference/kubectl/jsonpath/ on how to write a jsonPath. - type: string - version: - description: Version is the version of the Kubernetes resource. If it is not specified, the resource with the semantically latest version is used to resolve the path. - type: string - type: - description: Type defines the option of how status can be returned. It can be jsonPaths or wellKnownStatus. If the type is JSONPaths, user should specify the jsonPaths field If the type is WellKnownStatus, certain common fields of status defined by a rule only for types in in k8s.io/api and open-cluster-management/api will be reported, If these status fields do not exist, no values will be reported. + resource: + description: Resource is the resource name of the + Kubernetes resource. type: string - enum: - - WellKnownStatus - - JSONPaths - resourceIdentifier: - description: ResourceIdentifier represents the group, resource, name and namespace of a resoure. iff this refers to a resource not created by this manifest work, the related rules will not be executed. - type: object - required: + required: - name - resource + type: object + type: array + type: object + type: object + executor: + description: Executor is the configuration that makes the work + agent to perform some pre-request processing/checking. e.g. + the executor identity tells the work agent to check the executor + has sufficient permission to write the workloads to the local + managed cluster. Note that nil executor is still supported for + backward-compatibility which indicates that the work agent will + not perform any additional actions before applying resources. + properties: + subject: + description: Subject is the subject identity which the work + agent uses to talk to the local cluster when applying the + resources. + properties: + serviceAccount: + description: ServiceAccount is for identifying which service + account to use by the work agent. Only required if the + type is "ServiceAccount". properties: - group: - description: Group is the API Group of the Kubernetes resource, empty string indicates it is in core group. - type: string name: - description: Name is the name of the Kubernetes resource. + description: Name is the name of the service account. + maxLength: 253 + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ type: string namespace: - description: Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource. - type: string - resource: - description: Resource is the resource name of the Kubernetes resource. + description: Namespace is the namespace of the service + account. + maxLength: 253 + minLength: 1 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$ type: string - updateStrategy: - description: UpdateStrategy defines the strategy to update this manifest. UpdateStrategy is Update if it is not set. - type: object required: - - type + - name + - namespace + type: object + type: + description: 'Type is the type of the subject identity. + Supported types are: "ServiceAccount".' + enum: + - ServiceAccount + type: string + required: + - type + type: object + type: object + manifestConfigs: + description: ManifestConfigs represents the configurations of + manifests defined in workload field. + items: + description: ManifestConfigOption represents the configurations + of a manifest defined in workload field. + properties: + feedbackRules: + description: FeedbackRules defines what resource status + field should be returned. If it is not set or empty, no + feedback rules will be honored. + items: properties: - serverSideApply: - description: serverSideApply defines the configuration for server side apply. It is honored only when type of updateStrategy is ServerSideApply - type: object - properties: - fieldManager: - description: FieldManager is the manager to apply the resource. It is work-agent by default, but can be other name with work-agent as the prefix. - type: string - default: work-agent - pattern: ^work-agent - force: - description: Force represents to force apply the manifest. - type: boolean + jsonPaths: + description: JsonPaths defines the json path under + status field to be synced. + items: + properties: + name: + description: Name represents the alias name + for this field + type: string + path: + description: Path represents the json path of + the field under status. The path must point + to a field with single value in the type of + integer, bool or string. If the path points + to a non-existing field, no value will be + returned. If the path points to a structure, + map or slice, no value will be returned and + the status conddition of StatusFeedBackSynced + will be set as false. Ref to https://kubernetes.io/docs/reference/kubectl/jsonpath/ + on how to write a jsonPath. + type: string + version: + description: Version is the version of the Kubernetes + resource. If it is not specified, the resource + with the semantically latest version is used + to resolve the path. + type: string + required: + - name + - path + type: object + type: array type: - description: type defines the strategy to update this manifest, default value is Update. Update type means to update resource by an update call. CreateOnly type means do not update resource based on current manifest. ServerSideApply type means to update resource using server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False with the reason of ApplyConflict. - type: string - default: Update + description: Type defines the option of how status + can be returned. It can be jsonPaths or wellKnownStatus. + If the type is JSONPaths, user should specify the + jsonPaths field If the type is WellKnownStatus, + certain common fields of status defined by a rule + only for types in in k8s.io/api and open-cluster-management/api + will be reported, If these status fields do not + exist, no values will be reported. enum: - - Update - - CreateOnly - - ServerSideApply - workload: - description: Workload represents the manifest workload to be deployed on a managed cluster. - type: object - properties: - manifests: - description: Manifests represents a list of kuberenetes resources to be deployed on a managed cluster. - type: array - items: - description: Manifest represents a resource to be deployed on managed cluster. + - WellKnownStatus + - JSONPaths + type: string + required: + - type type: object - x-kubernetes-preserve-unknown-fields: true - x-kubernetes-embedded-resource: true - placementRefs: - description: PacementRefs is a list of the names of the Placement resource, from which a PlacementDecision will be found and used to distribute the ManifestWork. - type: array - minItems: 1 - items: - description: localPlacementReference is the name of a Placement resource in current namespace - type: object - required: - - name + type: array + resourceIdentifier: + description: ResourceIdentifier represents the group, resource, + name and namespace of a resoure. iff this refers to a + resource not created by this manifest work, the related + rules will not be executed. + properties: + group: + description: Group is the API Group of the Kubernetes + resource, empty string indicates it is in core group. + type: string + name: + description: Name is the name of the Kubernetes resource. + type: string + namespace: + description: Name is the namespace of the Kubernetes + resource, empty string indicates it is a cluster scoped + resource. + type: string + resource: + description: Resource is the resource name of the Kubernetes + resource. + type: string + required: + - name + - resource + type: object + updateStrategy: + description: UpdateStrategy defines the strategy to update + this manifest. UpdateStrategy is Update if it is not set. + properties: + serverSideApply: + description: serverSideApply defines the configuration + for server side apply. It is honored only when type + of updateStrategy is ServerSideApply + properties: + fieldManager: + default: work-agent + description: FieldManager is the manager to apply + the resource. It is work-agent by default, but + can be other name with work-agent as the prefix. + pattern: ^work-agent + type: string + force: + description: Force represents to force apply the + manifest. + type: boolean + type: object + type: + default: Update + description: type defines the strategy to update this + manifest, default value is Update. Update type means + to update resource by an update call. CreateOnly type + means do not update resource based on current manifest. + ServerSideApply type means to update resource using + server side apply with work-controller as the field + manager. If there is conflict, the related Applied + condition of manifest will be in the status of False + with the reason of ApplyConflict. + enum: + - Update + - CreateOnly + - ServerSideApply + type: string + required: + - type + type: object + required: + - resourceIdentifier + type: object + type: array + workload: + description: Workload represents the manifest workload to be deployed + on a managed cluster. properties: - name: - description: Name of the Placement resource in the current namespace - type: string - minLength: 1 - status: - description: Status represent the current status of Placing ManifestWork resources - type: object - properties: - conditions: - description: 'Conditions contains the different condition statuses for distrbution of ManifestWork resources Valid condition types are: 1. AppliedManifestWorks represents ManifestWorks have been distributed as per placement All, Partial, None, Problem 2. PlacementRefValid' - type: array - items: - description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + manifests: + description: Manifests represents a list of kuberenetes resources + to be deployed on a managed cluster. + items: + description: Manifest represents a resource to be deployed + on managed cluster. + type: object + x-kubernetes-embedded-resource: true + x-kubernetes-preserve-unknown-fields: true + type: array type: object - required: - - lastTransitionTime - - message - - reason - - status - - type - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - type: string - format: date-time - message: - description: message is a human readable message indicating details about the transition. This may be an empty string. - type: string - maxLength: 32768 - observedGeneration: - description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. - type: integer - format: int64 - minimum: 0 - reason: - description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. - type: string - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - status: - description: status of the condition, one of True, False, Unknown. - type: string - enum: - - "True" - - "False" - - Unknown - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - type: string - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - summary: - description: Summary totals of resulting ManifestWorks + type: object + placementRefs: + description: PacementRefs is a list of the names of the Placement + resource, from which a PlacementDecision will be found and used + to distribute the ManifestWork. + items: + description: localPlacementReference is the name of a Placement + resource in current namespace + properties: + name: + description: Name of the Placement resource in the current namespace + minLength: 1 + type: string + required: + - name type: object + minItems: 1 + type: array + required: + - placementRefs + type: object + status: + description: Status represent the current status of Placing ManifestWork + resources + properties: + conditions: + description: 'Conditions contains the different condition statuses + for distrbution of ManifestWork resources Valid condition types + are: 1. AppliedManifestWorks represents ManifestWorks have been + distributed as per placement All, Partial, None, Problem 2. PlacementRefValid' + items: + description: "Condition contains details for one aspect of the current + state of this API Resource. --- This struct is intended for direct + use as an array at the field path .status.conditions. For example, + \n type FooStatus struct{ // Represents the observations of a + foo's current state. // Known .status.conditions.type are: \"Available\", + \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge + // +listType=map // +listMapKey=type Conditions []metav1.Condition + `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" + protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" properties: - Applied: - description: 'Applied is the number of ManifestWorks with condition Applied: true' + lastTransitionTime: + description: lastTransitionTime is the last time the condition + transitioned from one status to another. This should be when + the underlying condition changed. If that is not known, then + using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating + details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation + that the condition was set based upon. For instance, if .metadata.generation + is currently 12, but the .status.conditions[x].observedGeneration + is 9, the condition is out of date with respect to the current + state of the instance. + format: int64 + minimum: 0 type: integer - available: - description: 'Available is the number of ManifestWorks with condition Available: true' - type: integer - degraded: - description: 'TODO: Degraded is the number of ManifestWorks with condition Degraded: true' - type: integer - progressing: - description: 'TODO: Progressing is the number of ManifestWorks with condition Progressing: true' - type: integer - total: - description: Total number of ManifestWorks managed by the ManifestWorkReplicaSet - type: integer - served: true - storage: true - subresources: - status: {} + reason: + description: reason contains a programmatic identifier indicating + the reason for the condition's last transition. Producers + of specific condition types may define expected values and + meanings for this field, and whether the values are considered + a guaranteed API. The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + --- Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + summary: + description: Summary totals of resulting ManifestWorks + properties: + Applied: + description: 'Applied is the number of ManifestWorks with condition + Applied: true' + type: integer + available: + description: 'Available is the number of ManifestWorks with condition + Available: true' + type: integer + degraded: + description: 'TODO: Degraded is the number of ManifestWorks with + condition Degraded: true' + type: integer + progressing: + description: 'TODO: Progressing is the number of ManifestWorks + with condition Progressing: true' + type: integer + total: + description: Total number of ManifestWorks managed by the ManifestWorkReplicaSet + type: integer + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} status: acceptedNames: kind: ""