From a7a87dbddb417090a4a42af4f456745749a7fff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= <66256922+daniel-weisse@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:55:20 +0100 Subject: [PATCH] cli: don't validate unused ownerID field (#2556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- cli/internal/state/state.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cli/internal/state/state.go b/cli/internal/state/state.go index fa56b2556e2..49e4cef0b96 100644 --- a/cli/internal/state/state.go +++ b/cli/internal/state/state.go @@ -268,8 +268,10 @@ func (s *State) preCreateConstraints() []*validation.Constraint { // each field individually. validation.Empty(s.ClusterValues.ClusterID). WithFieldTrace(s, &s.ClusterValues.ClusterID), - validation.Empty(s.ClusterValues.OwnerID). - WithFieldTrace(s, &s.ClusterValues.OwnerID), + // ownerID is currently unused as functionality is not implemented + // Therefore, we don't want to validate it + // validation.Empty(s.ClusterValues.OwnerID). + // WithFieldTrace(s, &s.ClusterValues.OwnerID), validation.EmptySlice(s.ClusterValues.MeasurementSalt). WithFieldTrace(s, &s.ClusterValues.MeasurementSalt), } @@ -396,8 +398,10 @@ func (s *State) preInitConstraints() []*validation.Constraint { // each field individually. validation.Empty(s.ClusterValues.ClusterID). WithFieldTrace(s, &s.ClusterValues.ClusterID), - validation.Empty(s.ClusterValues.OwnerID). - WithFieldTrace(s, &s.ClusterValues.OwnerID), + // ownerID is currently unused as functionality is not implemented + // Therefore, we don't want to validate it + // validation.Empty(s.ClusterValues.OwnerID). + // WithFieldTrace(s, &s.ClusterValues.OwnerID), validation.EmptySlice(s.ClusterValues.MeasurementSalt). WithFieldTrace(s, &s.ClusterValues.MeasurementSalt), } @@ -442,9 +446,10 @@ func (s *State) postInitConstraints(csp cloudprovider.Provider) func() []*valida // ClusterID needs to be filled. validation.NotEmpty(s.ClusterValues.ClusterID). WithFieldTrace(s, &s.ClusterValues.ClusterID), - // OwnerID needs to be filled. - validation.NotEmpty(s.ClusterValues.OwnerID). - WithFieldTrace(s, &s.ClusterValues.OwnerID), + // ownerID is currently unused as functionality is not implemented + // Therefore, we don't want to validate it + // validation.NotEmpty(s.ClusterValues.OwnerID). + // WithFieldTrace(s, &s.ClusterValues.OwnerID), // MeasurementSalt needs to be filled. validation.NotEmptySlice(s.ClusterValues.MeasurementSalt). WithFieldTrace(s, &s.ClusterValues.MeasurementSalt),