Skip to content

Commit

Permalink
update management commponents annotation version; change eksa cli field
Browse files Browse the repository at this point in the history
manager name
  • Loading branch information
cxbrowne1207 committed Jan 17, 2024
1 parent 1400a46 commit 65ad481
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 17 deletions.
8 changes: 2 additions & 6 deletions internal/test/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ func NewClusterSpec(opts ...ClusterSpecOpt) *cluster.Spec {
}
s.VersionsBundles = map[v1alpha1.KubernetesVersion]*cluster.VersionsBundle{
v1alpha1.Kube119: {
VersionsBundle: &releasev1alpha1.VersionsBundle{
Eksa: releasev1alpha1.EksaBundle{
Version: "v0.0.0-dev+build.0000+000000",
},
},
KubeDistro: &cluster.KubeDistro{},
VersionsBundle: &releasev1alpha1.VersionsBundle{},
KubeDistro: &cluster.KubeDistro{},
},
}
s.Bundles = &releasev1alpha1.Bundles{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const (
// managementComponentsVersionAnnotation is an annotation applied to an EKS-A management cluster pointing to the current version of the management components.
// The value for this annotation is expected to correspond to an EKSARelease object version, following semantic version convention: e.g. v0.18.3
// This is an internal EKS-A managed annotation, not meant to be updated manually.
managementComponentsVersionAnnotation = "anywhere.eks.amazonaws.com/eksa-management-components-version"
managementComponentsVersionAnnotation = "anywhere.eks.amazonaws.com/management-components-version"

// defaultEksaNamespace is the default namespace for EKS-A resources when not specified.
defaultEksaNamespace = "default"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1alpha1/cluster_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3243,7 +3243,7 @@ func TestCluster_SetManagmentComponentsVersion(t *testing.T) {
name: "self-managed cluster",
cluster: baseCluster(),
managementComponentsVersion: "v0.0.0-dev+build.0000",
wantAnnotations: map[string]string{"anywhere.eks.amazonaws.com/eksa-management-components-version": "v0.0.0-dev+build.0000"},
wantAnnotations: map[string]string{"anywhere.eks.amazonaws.com/management-components-version": "v0.0.0-dev+build.0000"},
},
{
name: "managed cluster",
Expand Down
4 changes: 2 additions & 2 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ const (
Delete Operation = 2
)

// EKSAFieldManager is the owner name for fields applied by the EKS-A CLI.
const EKSAFieldManager = "eks-a-cli"
// EKSACLIFieldManager is the owner name for fields applied by the EKS-A CLI.
const EKSACLIFieldManager = "eks-a-cli"
2 changes: 1 addition & 1 deletion pkg/workflows/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (s *InstallEksaComponentsTask) Run(ctx context.Context, commandContext *tas

commandContext.ClusterSpec.Cluster.SetManagementComponentsVersion(commandContext.ClusterSpec.EKSARelease.Spec.Version)
if err := client.ApplyServerSide(ctx,
constants.EKSAFieldManager,
constants.EKSACLIFieldManager,
commandContext.ClusterSpec.Cluster,
kubernetes.ApplyServerSideOptions{ForceOwnership: true},
); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/workflows/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (c *createTestSetup) expectInstallEksaComponents() {

c.client.EXPECT().ApplyServerSide(
c.ctx,
constants.EKSAFieldManager,
constants.EKSACLIFieldManager,
c.clusterSpec.Cluster,
kubernetes.ApplyServerSideOptions{ForceOwnership: true},
),
Expand Down Expand Up @@ -246,7 +246,7 @@ func (c *createTestSetup) skipInstallEksaComponents() {

c.client.EXPECT().ApplyServerSide(
c.ctx,
constants.EKSAFieldManager,
constants.EKSACLIFieldManager,
c.clusterSpec.Cluster,
kubernetes.ApplyServerSideOptions{ForceOwnership: true},
),
Expand Down Expand Up @@ -389,7 +389,7 @@ func TestCreateRunInstallEksaComponentsApplyServerSideFailure(t *testing.T) {

test.client.EXPECT().ApplyServerSide(
test.ctx,
constants.EKSAFieldManager,
constants.EKSACLIFieldManager,
test.clusterSpec.Cluster,
kubernetes.ApplyServerSideOptions{ForceOwnership: true},
).Return(wantError),
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflows/management/core_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func runUpgradeCoreComponents(ctx context.Context, commandContext *task.CommandC
}
commandContext.ClusterSpec.Cluster.SetManagementComponentsVersion(commandContext.ClusterSpec.EKSARelease.Spec.Version)
if err := client.ApplyServerSide(ctx,
constants.EKSAFieldManager,
constants.EKSACLIFieldManager,
commandContext.ClusterSpec.Cluster,
kubernetes.ApplyServerSideOptions{ForceOwnership: true},
); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestRunnerHappyPath(t *testing.T) {
mocks.clientFactory.EXPECT().BuildClientFromKubeconfig(managementCluster.KubeconfigFile).Return(mocks.client, nil),
mocks.client.EXPECT().ApplyServerSide(
ctx,
constants.EKSAFieldManager,
constants.EKSACLIFieldManager,
newSpec.Cluster,
kubernetes.ApplyServerSideOptions{ForceOwnership: true},
).Return(nil),
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflows/management/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (c *upgradeManagementTestSetup) expectBuildClientFromKubeconfig(err error)
func (c *upgradeManagementTestSetup) expectApplyServerSide(err error) {
c.client.EXPECT().ApplyServerSide(
c.ctx,
constants.EKSAFieldManager,
constants.EKSACLIFieldManager,
c.newClusterSpec.Cluster,
kubernetes.ApplyServerSideOptions{ForceOwnership: true},
).Return(err)
Expand Down

0 comments on commit 65ad481

Please sign in to comment.