Skip to content

Commit

Permalink
cli: don't validate unused ownerID field (#2556)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Weiße <[email protected]>
  • Loading branch information
daniel-weisse authored and msanft committed Nov 8, 2023
1 parent e46ae1e commit a7a87db
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions cli/internal/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down Expand Up @@ -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),
}
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit a7a87db

Please sign in to comment.