File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
24
24
"github.com/pkg/errors"
25
25
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26
26
27
+ clusterv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
27
28
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta2"
28
29
clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
29
30
"sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster"
@@ -56,8 +57,9 @@ func (c *clusterctlClient) PlanUpgrade(ctx context.Context, options PlanUpgradeO
56
57
return nil , err
57
58
}
58
59
59
- // Ensure this command only runs against management clusters with the current Cluster API contract.
60
- if err := clusterClient .ProviderInventory ().CheckCAPIContract (ctx ); err != nil {
60
+ // Ensure this command only runs against management clusters with the current Cluster API contract;
61
+ // temporarily we also allow upgrading from v1beta1 to allow transition to the current Cluster API contract.
62
+ if err := clusterClient .ProviderInventory ().CheckCAPIContract (ctx , cluster.AllowCAPIContract {Contract : clusterv1beta1 .GroupVersion .Version }); err != nil {
61
63
return nil , err
62
64
}
63
65
@@ -145,8 +147,9 @@ func (c *clusterctlClient) ApplyUpgrade(ctx context.Context, options ApplyUpgrad
145
147
return err
146
148
}
147
149
148
- // Ensure this command only runs against management clusters with the current Cluster API contract.
149
- if err := clusterClient .ProviderInventory ().CheckCAPIContract (ctx ); err != nil {
150
+ // Ensure this command only runs against management clusters with the current Cluster API contract;
151
+ // temporarily we also allow upgrading from v1beta1 to allow transition to the current Cluster API contract.
152
+ if err := clusterClient .ProviderInventory ().CheckCAPIContract (ctx , cluster.AllowCAPIContract {Contract : clusterv1beta1 .GroupVersion .Version }); err != nil {
150
153
return err
151
154
}
152
155
You can’t perform that action at this time.
0 commit comments