Skip to content

Commit

Permalink
chore: remove space id from k8s unit args
Browse files Browse the repository at this point in the history
  • Loading branch information
wallyworld committed Sep 17, 2024
1 parent 662a627 commit 79a5046
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions domain/application/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ const (
// is not assigned.
UnitNotAssigned = errors.ConstError("unit not assigned")

// UnitAlreadyExists describes an error that occurs when the
// unit being created already exists.
UnitAlreadyExists = errors.ConstError("unit already exists")

// UnitHasSubordinates describes an error that occurs when trying to set a unit's life
// to Dead but it still has subordinates.
UnitHasSubordinates = errors.ConstError("unit has subordinates")
Expand Down
6 changes: 3 additions & 3 deletions domain/application/service/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,13 @@ func makeUpsertUnitArgs(in AddUnitArg) application.UpsertUnitArg {
Ports: in.CloudContainer.Ports,
}
if in.CloudContainer.Address != nil {
// TODO(units) - handle the in.CloudContainer.Address space ID
// For k8s we'll initially create a /32 subnet off the container address
// and add that to the default space.
result.CloudContainer.Address = &application.Address{
Value: in.CloudContainer.Address.Value,
AddressType: string(in.CloudContainer.Address.AddressType()),
Scope: string(in.CloudContainer.Address.Scope),
SpaceID: in.CloudContainer.Address.SpaceID,
Origin: string(network.OriginProvider),
}
if in.CloudContainer.AddressOrigin != nil {
Expand Down Expand Up @@ -520,8 +522,6 @@ func (s *ApplicationService) RegisterCAASUnit(ctx context.Context, appName strin
}
if args.Address != nil {
addr := network.NewSpaceAddress(*args.Address, network.WithScope(network.ScopeMachineLocal))
// k8s doesn't support spaces yet.
addr.SpaceID = network.AlphaSpaceId
p.CloudContainer.Address = &addr
origin := network.OriginProvider
p.CloudContainer.AddressOrigin = &origin
Expand Down
1 change: 0 additions & 1 deletion domain/application/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ type Address struct {
AddressType string
Scope string
Origin string
SpaceID string
}

// UpsertUnitArg contains parameters for adding a unit to state.
Expand Down

0 comments on commit 79a5046

Please sign in to comment.