Skip to content

Conversation

@winstxnhdw
Copy link
Contributor

@winstxnhdw winstxnhdw commented Jul 31, 2023

  • Add v1.7 Enterprise-only Namespace
  • Add unit tests for Namespace
  • Apply lint suggestions
  • Update documentation pertaining to Namespace
  • Make EnterpriseOnlyFact skippable
  • Closes Registering a service in a namespace #117

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem to be ok but it would be great if we have a test that makes sure that separation with namespaces actually works.

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem to be ok but it would be great if we have a test that makes sure that separation with namespaces actually works.

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes for the "namespace" feature are hard to spot due to many changes suggested by linter. I suggest moving the linter-induced changes to a new PR, so we can review it separately.

@winstxnhdw
Copy link
Contributor Author

Tests still fail for Consul version >= 1.10 because enterprise is not supported. Any suggestions on how we can skip these tests?

@marcin-krystianc
Copy link
Contributor

Tests still fail for Consul version >= 1.10 because enterprise is not supported. Any suggestions on how we can skip these tests?

Look at the Operator_GetLicense test.

@winstxnhdw
Copy link
Contributor Author

Look at the Operator_GetLicense test.

Hmm.. It still fails for <1.7

Shall I create a new attribute SkippableEnterpriseOnlyFact?

@marcin-krystianc
Copy link
Contributor

I think you also need to combine two checks:

  • a version, because it is 1.7+ version feature (Skip.If(AgentVersion < SemanticVersion.Parse("1.7.0"), $"...");
  • and whether to execute enterprise tests (SkippableEnterpriseOnlyFact)

I'm not sure, but I don't think it is necessary to implement a new attribute to achieve that.

@winstxnhdw
Copy link
Contributor Author

Currently I don’t think that EnterpriseOnlyFact is skippable.

@winstxnhdw
Copy link
Contributor Author

winstxnhdw commented Aug 29, 2023

Yup, just tested. We do need to create a new attribute. For now, I'll just make EnterpriseOnlyFact skippable instead.

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, just left a few minor comments. I think it would be nice also to write a test that would exercise the namespaces feature in a way that is not yet presented in this PR. For example, we could use KV store (https://developer.hashicorp.com/consul/commands/kv) to show that it is possible to store values in different namespaces and assert that they are not visible to each other.

{
public string Name { get; set; }

public string Description { get; set; } = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm not sure about this default initialization. Was it causing any trouble when it was null by default? Is there any benefit?

Copy link
Contributor Author

@winstxnhdw winstxnhdw Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to cause any trouble when it is null but the Consul server expects an empty string and I am not sure if it could cause unforeseen effects otherwise. See here.

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this amazing work. There is just single formatting issue remaining, apart from that all looks really good. Well done 🏆

@marcin-krystianc marcin-krystianc requested a review from mfkl August 31, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Registering a service in a namespace

3 participants