Skip to content

Commit 55e72bd

Browse files
committed
refactor annotation name constants from api/v1beta1/tags.go
- add VMTagsLastAppliedAnnotation, RGTagsLastAppliedAnnotation to azure/const.go - add deprecated message to the named constants
1 parent 0a254d8 commit 55e72bd

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

api/v1beta1/tags.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,14 @@ const (
135135
// which tracks the AdditionalTags in the Machine Provider Config.
136136
// See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
137137
// for annotation formatting rules.
138+
// Deprecated: use azure.VMTagsLastAppliedAnnotation instead. This constant will be removed in v1beta2.
138139
VMTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-vm"
139140

140141
// RGTagsLastAppliedAnnotation is the key for the Azure Cluster object annotation
141142
// which tracks the AdditionalTags for Resource Group which is part in the Azure Cluster.
142143
// See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
143144
// for annotation formatting rules.
145+
// Deprecated: use azure.RGTagsLastAppliedAnnotation instead. This constant will be removed in v1beta2.
144146
RGTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-rg"
145147
)
146148

azure/const.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
Copyright 2022 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package azure
18+
19+
const (
20+
// VMTagsLastAppliedAnnotation is the key for the machine object annotation
21+
// which tracks the AdditionalTags in the Machine Provider Config.
22+
// See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
23+
// for annotation formatting rules.
24+
VMTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-vm"
25+
26+
// RGTagsLastAppliedAnnotation is the key for the Azure Cluster object annotation
27+
// which tracks the AdditionalTags for Resource Group which is part in the Azure Cluster.
28+
// See https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
29+
// for annotation formatting rules.
30+
RGTagsLastAppliedAnnotation = "sigs.k8s.io/cluster-api-provider-azure-last-applied-tags-rg"
31+
)

azure/scope/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ func (s *ClusterScope) TagsSpecs() []azure.TagsSpec {
947947
{
948948
Scope: azure.ResourceGroupID(s.SubscriptionID(), s.ResourceGroup()),
949949
Tags: s.AdditionalTags(),
950-
Annotation: infrav1.RGTagsLastAppliedAnnotation,
950+
Annotation: azure.RGTagsLastAppliedAnnotation,
951951
},
952952
}
953953
}

azure/scope/machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (m *MachineScope) TagsSpecs() []azure.TagsSpec {
177177
{
178178
Scope: azure.VMID(m.SubscriptionID(), m.ResourceGroup(), m.Name()),
179179
Tags: m.AdditionalTags(),
180-
Annotation: infrav1.VMTagsLastAppliedAnnotation,
180+
Annotation: azure.VMTagsLastAppliedAnnotation,
181181
},
182182
}
183183
}

azure/scope/managedcontrolplane.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ func (s *ManagedControlPlaneScope) TagsSpecs() []azure.TagsSpec {
757757
{
758758
Scope: azure.ResourceGroupID(s.SubscriptionID(), s.ResourceGroup()),
759759
Tags: s.AdditionalTags(),
760-
Annotation: infrav1.RGTagsLastAppliedAnnotation,
760+
Annotation: azure.RGTagsLastAppliedAnnotation,
761761
},
762762
}
763763
}

0 commit comments

Comments
 (0)